42 : fAllowMultipleTextures(allowMultipleTextures) {
47 options->fGlyphCacheTextureMaximumBytes = 0;
48 options->fAllowMultipleGlyphCacheTextures = fAllowMultipleTextures;
72 this->drawText(canvas);
74 static const bool kShowAtlas =
false;
77 auto img = dContext->priv().testingOnly_getFontAtlasImage(MaskFormat::kA8);
85 static const int kSizes[] = {8, 9, 10, 11, 12, 13, 18, 20, 25};
88 SkString(
"abcdefghijklmnopqrstuvwxyz"),
93 font.setSubpixel(
true);
95 static const SkScalar kSubPixelInc = 1 / 2.f;
103 canvas->
scale(10, 10);
110 for (
const auto& typeface : fTypefaces) {
111 font.setTypeface(typeface);
112 for (
const auto&
text : kTexts) {
115 if (
x + 100 > kSize) {
124 (
offsetX ? subpixelX : subpixelY) += kSubPixelInc;
130 inline static constexpr SkScalar kSize = 1280;
134 using INHERITED =
GM;
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
constexpr SkColor SK_ColorLTGRAY
@ kUTF8
uses bytes to represent UTF-8 or ASCII
#define SkScalarCeilToScalar(x)
void onOnceBeforeDraw() override
void onDraw(SkCanvas *canvas) override
SkISize getISize() override
FontCacheGM(GrContextOptions::Enable allowMultipleTextures)
void modifyGrContextOptions(GrContextOptions *options) override
SkString getName() const override
virtual GrRecordingContext * recordingContext() const
void scale(SkScalar sx, SkScalar sy)
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
static constexpr SkFontStyle Italic()
static constexpr SkFontStyle Bold()
static constexpr SkFontStyle Normal()
@ kAntiAlias
may have transparent pixels on glyph edges
GM(SkColor backgroundColor=SK_ColorWHITE)
static SkScalar draw_string(SkCanvas *canvas, const SkString &text, SkScalar x, SkScalar y, const SkFont &font)
static const size_t kSizes[]
DEF_SWITCHES_START aot vmservice shared library name
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
font
Font Metadata and Metrics.
static constexpr SkISize Make(int32_t w, int32_t h)