34 static constexpr char txt[] =
"TEST";
42 const auto& buf = builder.allocRunRSXform(font, glyph_count);
46 for (
int i = 0; i < glyph_count; ++i) {
54 fBlob = builder.make();
58 canvas->
scale(kScale, kScale);
59 this->draw_one(canvas,
61 this->draw_one(canvas,
63 this->draw_one(canvas,
65 this->draw_one(canvas,
85 static constexpr SkISize kTileSize = { 30, 30 };
90 p.setColor(0xffffff00);
91 surface->getCanvas()->drawPaint(p);
92 p.setColor(0xff008000);
94 ->drawRect({0, 0, kTileSize.
width()*0.9f, kTileSize.
height()*0.9f},
p);
96 return surface->makeImageSnapshot()
99 ->makeWithLocalMatrix(outer_lm);
102 inline static constexpr float kSZ = 300,
103 kFontSZ = kSZ * 0.38,
static sk_sp< SkShader > make_shader()
@ kUTF8
uses bytes to represent UTF-8 or ASCII
void onOnceBeforeDraw() override
SkString getName() const override
void onDraw(SkCanvas *canvas) override
SkISize getISize() override
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void scale(SkScalar sx, SkScalar sy)
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
@ kAntiAlias
may have transparent pixels on glyph edges
static SkMatrix Scale(SkScalar sx, SkScalar sy)
static SkMatrix RotateDeg(SkScalar deg)
static const SkMatrix & I()
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static constexpr SkISize Make(int32_t w, int32_t h)
constexpr int32_t width() const
constexpr int32_t height() const
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkRect MakeWH(float w, float h)