27#ifdef SK_BUILD_FOR_ANDROID
29#elif defined(SK_BUILD_FOR_WIN)
31#elif defined(SK_BUILD_FOR_MAC)
33#elif defined(SK_BUILD_FOR_IOS)
35#elif defined(SK_BUILD_FOR_UNIX)
43 inline static constexpr int kNumBlobs = 200;
44 inline static constexpr int kWordLength = 16;
56 canvas->
clear(0xFFDDDDDD);
59 paint.setColor(0xDE000000);
81 font.getMetrics(&fMetrics);
84 for (int32_t
i = 0;
i < kNumBlobs; ++
i) {
102 for (
int i = 0;
i < kWordLength; ++
i) {
109 inline static constexpr int kNumBlobs = 8;
110 inline static constexpr int kParagraphLength = 175;
112 bool fAfterFirstFrame =
false;
136 canvas->
clear(0xFFDDDDDD);
139 paint.setAntiAlias(
true);
140 paint.setColor(0xDE000000);
142 if (fAfterFirstFrame) {
143#if defined(SK_GANESH)
151 image = direct->priv().testingOnly_getFontAtlasImage(MaskFormat::kA8, 1);
155 image = direct->priv().testingOnly_getFontAtlasImage(MaskFormat::kA8, 2);
159 image = direct->priv().testingOnly_getFontAtlasImage(MaskFormat::kA8, 3);
167 canvas->
scale(fScale, fScale);
173 for (
int index = 0; index < kNumBlobs; ++index) {
179 if (!fAfterFirstFrame) {
180 fAfterFirstFrame =
true;
188 font.getMetrics(&fMetrics);
191 paint.setColor(0xDE000000);
194 for (int32_t
i = 0;
i < kNumBlobs; ++
i) {
196 auto paragraphLength = kParagraphLength;
198 while (paragraphLength - 45 > 0) {
199 auto currentLineLength =
std::min(45, paragraphLength - 45);
204 currentLineLength * 4,
210 paragraphLength -= 45;
218 for (
auto i = 0;
i < lineLength; ++
i) {
static sk_sp< SkTypeface > chinese_typeface()
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
@ kUTF32
uses four byte words to represent all of Unicode
void createRandomWord(SkUnichar glyphs[kWordLength])
void load(SkScalar w, SkScalar h) override
void draw(SkCanvas *canvas) override
void load(SkScalar w, SkScalar h) override
void createRandomLine(SkUnichar glyphs[45], int lineLength)
bool onChar(SkUnichar uni) override
void draw(SkCanvas *canvas) override
void translate(SkScalar dx, SkScalar dy)
virtual GrRecordingContext * recordingContext() const
void clear(SkColor color)
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
void scale(SkScalar sx, SkScalar sy)
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
uint32_t nextRangeU(uint32_t min, uint32_t max)
static float min(float r, float g, float b)
sk_sp< const SkImage > image
font
Font Metadata and Metrics.
SkSamplingOptions(SkFilterMode::kLinear))
SkScalar fLeading
distance to add between lines, typically positive or zero
SkScalar fAscent
distance to reserve above baseline, typically negative
SkScalar fDescent
distance to reserve below baseline, typically positive
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)