29#if defined(SK_GRAPHITE)
33#if defined(SK_GANESH) || defined(SK_GRAPHITE)
38 SlugGM(
const char*
txt) : fText(
txt) {}
45#if defined(SK_GRAPHITE)
47 options->fSupportBilerpFromGlyphAtlas =
true;
54 size_t txtLen = strlen(fText);
57 fGlyphs.append(glyphCount);
70 canvas->
scale(1.3f, 1.3f);
72 if (slug ==
nullptr) {
79 slug->
draw(canvas,
p);
92 slug->
draw(canvas,
p);
102 font.setSubpixel(
true);
104 font.setTypeface(fTypeface);
108 memcpy(buf.
glyphs, fGlyphs.begin(), fGlyphs.size() *
sizeof(uint16_t));
118DEF_GM(
return new SlugGM(
"hamburgefons");)
@ kUTF8
uses bytes to represent UTF-8 or ASCII
#define INHERITED(method,...)
void translate(SkScalar dx, SkScalar dy)
void clipIRect(const SkIRect &irect, SkClipOp op=SkClipOp::kIntersect)
void rotate(SkScalar degrees)
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
virtual SkISize getISize()=0
virtual void modifyGraphiteContextOptions(skgpu::graphite::ContextOptions *) const
virtual void onOnceBeforeDraw()
virtual SkString getName() const =0
virtual void modifyGrContextOptions(GrContextOptions *)
virtual DrawResult onDraw(SkCanvas *, SkString *errorMsg)
static sk_sp< Slug > ConvertBlob(SkCanvas *canvas, const SkTextBlob &blob, SkPoint origin, const SkPaint &paint)
void draw(SkCanvas *canvas, const SkPaint &paint) const
font
Font Metadata and Metrics.
bool fSupportBilerpFromGlyphAtlas
static constexpr SkIRect MakeSize(const SkISize &size)
static constexpr SkISize Make(int32_t w, int32_t h)
SkGlyphID * glyphs
storage for glyph indexes in run