29 0x00000000, 0x5fff0000, 0x2f0000ff, 0x2f00ff00, 0x3fff0000, 0x7fff0000,
38 auto c = offscreen->getCanvas();
58 canvas->drawString(
"This is some text:", 180, 300, font,
SkPaint());
70 for (
int n = 1; n <= 20; n++) {
71 const float x = 10.0f;
72 const float y = n * 20.0f;
74 for (
int i = 0; i < n * 10; i++) {
75 const char*
text =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
78 canvas.translate(
x,
y);
79 canvas.drawString(
text, 0, 0, font,
paint);
86 return surface->makeImageSnapshot();
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorWHITE
@ kUTF8
uses bytes to represent UTF-8 or ASCII
void drawRect(const SkRect &rect, const SkPaint &paint)
void drawSimpleText(const void *text, size_t byteLength, SkTextEncoding encoding, SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
static sk_sp< SkColorFilter > MakeWithSkColors(const SkColor[kNumColors])
void setColor(SkColor color)
#define DEF_SIMPLE_GM_BG(NAME, CANVAS, W, H, BGCOLOR)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static const SkColor kOverdrawColors[6]
static sk_sp< SkImage > overdraw_text_grid(bool useCTM)
static SkImageInfo MakeA8(int width, int height)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)