41 const char*
txt =
"Blobber";
42 size_t txtLen = strlen(
txt);
48 font.setSubpixel(
true);
53 int glyphCount = fGlyphs.
size();
56 run = &builder.allocRun(font, glyphCount, 10, 10,
nullptr);
57 memcpy(
run->glyphs, fGlyphs.
begin(), glyphCount *
sizeof(uint16_t));
59 run = &builder.allocRunPosH(font, glyphCount, 80,
nullptr);
60 memcpy(
run->glyphs, fGlyphs.
begin(), glyphCount *
sizeof(uint16_t));
61 for (
int i = 0; i < glyphCount; ++i) {
62 run->pos[i] = font.getSize() * i * .75f;
65 run = &builder.allocRunPos(font, glyphCount,
nullptr);
66 memcpy(
run->glyphs, fGlyphs.
begin(), glyphCount *
sizeof(uint16_t));
67 for (
int i = 0; i < glyphCount; ++i) {
68 run->pos[i * 2] = font.getSize() * i * .75f;
69 run->pos[i * 2 + 1] = 150 + 5 * sinf((
float)i * 8 / glyphCount);
72 fBlob = builder.make();
79 for (
unsigned i = 0; i < std::size(
pos); ++i) {
80 pos[i] = (float)i / (std::size(
pos) - 1);
102 constexpr int kXCount = 4;
103 constexpr int kYCount = 3;
104 for (
int i = 0; i < kXCount; ++i) {
105 for (
int j = 0; j < kYCount; ++j) {
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorGREEN
@ kUTF8
uses bytes to represent UTF-8 or ASCII
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
@ kAntiAlias
may have transparent pixels on glyph edges
static sk_sp< SkShader > MakeRadial(const SkPoint ¢er, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
@ kFill_Style
set to fill geometry
void onOnceBeforeDraw() override
SkISize getISize() override
void onDraw(SkCanvas *canvas) override
SkString getName() const override
static constexpr SkISize Make(int32_t w, int32_t h)
constexpr int32_t width() const
constexpr int32_t height() const
static constexpr SkPoint Make(float x, float y)