38 paint.setAlphaf(0.125f);
41 paint.setAlphaf(1.0f);
55 if (!fReallyBigATypeface) {
65 const char*
text =
"O";
79 yOffset = boundsHalfHeight;
84 font.setSubpixel(
true);
90 xOffset -
bounds.width() * 0.25f,
91 yOffset -
bounds.height() * 0.5f);
96 font.setSubpixel(
false);
97 font.setTypeface(fEmojiTypeface);
105 font.setTypeface(fReallyBigATypeface);
133 boundsHalfWidth, boundsHalfHeight);
135 boundsHalfWidth, boundsHalfHeight);
137 interiorClip.
inset(boundsQuarterWidth, boundsQuarterHeight);
139 const SkRect clipRects[] = {
bounds, upperLeftClip, lowerRightClip, interiorClip};
142 for (
size_t x = 0;
x <
count; ++
x) {
144 if (
x == (
count >> 1) - 1) {
157 const char* fEmojiText;
160 inline static constexpr int kWidth = 1250;
161 inline static constexpr int kHeight = 700;
163 using INHERITED =
GM;
168DEF_GM(
return new MixedTextBlobsGM;)
constexpr SkColor SK_ColorGRAY
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorWHITE
@ kUTF8
uses bytes to represent UTF-8 or ASCII
#define SkScalarFloorToScalar(x)
void drawRect(const SkRect &rect, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void translate(SkScalar dx, SkScalar dy)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
@ kAlias
no transparent pixels on glyph edges
@ kSubpixelAntiAlias
glyph positioned in pixel using transparency
void setStyle(Style style)
void setColor(SkColor color)
@ kStroke_Style
set to stroke geometry
const SkRect & bounds() const
GM(SkColor backgroundColor=SK_ColorWHITE)
void onDraw(SkCanvas *canvas) override
void onOnceBeforeDraw() override
SkString getName() const override
SkISize getISize() override
Optional< SkRect > bounds
clipRect(r.rect, r.opAA.op(), r.opAA.aa())) template<> void Draw
font
Font Metadata and Metrics.
DEF_GM(return F(C(clipbox), 0.0f, 0.0f, {})) DEF_GM(return F(C(clipbox)
static void draw_blob(SkCanvas *canvas, const SkTextBlob *blob, const SkPaint &skPaint, const SkRect &clipRect)
static constexpr SkISize Make(int32_t w, int32_t h)
void inset(float dx, float dy)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)