46 const char*
text =
"The quick brown fox jumps over the lazy dog.";
49 paint.setAntiAlias(
true);
60 font.setTypeface(sk_make_sp<SkRandomTypeface>(std::move(typeface),
paint,
false));
70 const char* bigtext1 =
"The quick brown fox";
71 const char* bigtext2 =
"jumps over the lazy dog.";
73 font.setSubpixel(
false);
107#if defined(SK_GRAPHITE)
109 isGPU = isGPU ||
SkToBool(recorder);
127 *errorMsg =
"This test requires a surface";
132 paint.setAntiAlias(
true);
150 surfaceCanvas->
rotate(-0.05f);
169 inline static constexpr int kWidth = 2000;
170 inline static constexpr int kHeight = 1600;
172 using INHERITED =
GM;
177DEF_GM(
return new TextBlobRandomFont;)
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
constexpr SkColor SK_ColorMAGENTA
constexpr SkColor SK_ColorWHITE
@ kUTF8
uses bytes to represent UTF-8 or ASCII
#define SkScalarCeilToScalar(x)
@ kUnknown_SkPixelGeometry
static constexpr bool SkToBool(const T &x)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
virtual GrRecordingContext * recordingContext() const
virtual skgpu::graphite::Recorder * recorder() const
void rotate(SkScalar degrees)
SkImageInfo imageInfo() const
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
static constexpr SkFontStyle Bold()
@ kAntiAlias
may have transparent pixels on glyph edges
@ kSubpixelAntiAlias
glyph positioned in pixel using transparency
const SkRect & bounds() const
GM(SkColor backgroundColor=SK_ColorWHITE)
static constexpr char kErrorMsg_DrawSkippedGpuOnly[]
SkISize getISize() override
void onOnceBeforeDraw() override
SkString getName() const override
DrawResult onDraw(SkCanvas *canvas, SkString *errorMsg) override
Optional< SkRect > bounds
font
Font Metadata and Metrics.
DEF_GM(return F(C(clipbox), 0.0f, 0.0f, {})) DEF_GM(return F(C(clipbox)
static constexpr SkISize Make(int32_t w, int32_t h)
sk_sp< SkColorSpace > refColorSpace() const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
SkColorType colorType() const
constexpr float height() const