47 SkPoint pts[] = { { 0, 0 }, { 1, 0 } };
67 paint.setShader(make_chrome_solid());
93 paint.setShader(make_chrome_solid());
103DEF_GM(
return new ChromeGradTextGM1; )
104DEF_GM(
return new ChromeGradTextGM2; )
107 static constexpr float kTextSize = 26.0f;
122 for (
int i = 0; i < 2; ++i) {
125 font.setEdging(edging);
126 canvas->
drawString(
"When in the course of human events", 0, 0, font,
paint);
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorGREEN
void drawRect(const SkRect &rect, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void translate(SkScalar dx, SkScalar dy)
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
@ kAntiAlias
may have transparent pixels on glyph edges
@ kAlias
no transparent pixels on glyph edges
@ kSubpixelAntiAlias
glyph positioned in pixel using transparency
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
@ kStroke_Style
set to stroke geometry
@ kFill_Style
set to fill geometry
void setShader(sk_sp< SkShader > shader)
virtual SkISize getISize()=0
virtual SkString getName() const =0
virtual DrawResult onDraw(SkCanvas *, SkString *errorMsg)
#define DEF_SIMPLE_GM(NAME, CANVAS, W, H)
static sk_sp< SkShader > make_grad(SkScalar width)
PODArray< SkColor > colors
font
Font Metadata and Metrics.
static constexpr SkRect MakeWH(float w, float h)