26static constexpr char kGlyphs[] =
"ABCDEFGH7JKLMNOPQRSTUVWXYZabcdefghijk1mnopqrstuvwxyz";
28static_assert(52 ==
kNumGlyphs,
"expected 52 glyphs");
35 PathTextBench(
bool clipped,
bool uncached) : fClipped(clipped), fUncached(uncached) {}
56 const SkGlyph* glyph = pathMaker.glyph(
id);
58 fGlyphs[i] = *glyph->
path();
67 float glyphSize = std::max(bounds.width(), bounds.height());
70 float t0 = pow(rand.
nextF(), 100);
73 float scale = size / glyphSize;
77 (1 - t2) * sqrt(2) *
scale/2 * glyphSize +
100 canvas->
drawPath(glyph, fPaints[i]);
105 const bool fUncached;
static constexpr int kNumDraws
static constexpr int kScreenHeight
static constexpr int kNumGlyphs
static constexpr char kGlyphs[]
static constexpr int kScreenWidth
SkISize onGetSize() override
const char * onGetName() override
void onDelayedSetup() override
void onDraw(int loops, SkCanvas *canvas) override
PathTextBench(bool clipped, bool uncached)
void clipPath(const SkPath &path, SkClipOp op, bool doAntiAlias)
void drawPath(const SkPath &path, const SkPaint &paint)
void setMatrix(const SkM44 &matrix)
SkGlyphID unicharToGlyph(SkUnichar uni) const
const SkPath * path() const
SkMatrix & setTranslate(SkScalar dx, SkScalar dy)
SkMatrix & preTranslate(SkScalar dx, SkScalar dy)
SkMatrix & preRotate(SkScalar degrees, SkScalar px, SkScalar py)
SkMatrix & preScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
void setColor(SkColor color)
void setAntiAlias(bool aa)
SkPath & setIsVolatile(bool isVolatile)
const SkRect & getBounds() const
static SkStrikeSpec MakeWithNoDevice(const SkFont &font, const SkPaint *paint=nullptr)
void append(const char text[])
const char * c_str() const
static constexpr SkISize Make(int32_t w, int32_t h)
static SkRect MakeIWH(int w, int h)