Options
These globals are now defined:
double duration; // The requested duration of the animation. double frame; // A value in [0, 1] of where we are in the animation.
This global is now defined:
GrBackendRenderTarget backEndRenderTarget;
GrBackendTexture backEndTextureRenderTarget;
Optional source image
These globals are now defined:
SkBitmap source; sk_sp<SkImage> image; GrBackendTexture backEndTexture; // GPU Only.
Note:
Adding comments with SK_FOLD_START and SK_FOLD_END creates foldable code
blocks.
These blocks will be folded by default and are useful for highlighting specific lines of code.
You can also use the keyboard shortcuts Ctrl+S and Ctrl+E in the code editor to set them.
These blocks will be folded by default and are useful for highlighting specific lines of code.
You can also use the keyboard shortcuts Ctrl+S and Ctrl+E in the code editor to set them.
xxxxxxxxxx
21
void draw(SkCanvas* canvas) {
skia::textlayout::ParagraphStyle s;
s.setTextAlign(skia::textlayout::TextAlign::kStart);
//s.setMaxLines(3);
s.setEllipsis(u"\u2026");
auto c = sk_make_sp<skia::textlayout::FontCollection>();
c->setDefaultFontManager(fontMgr);
auto b = skia::textlayout::ParagraphBuilder::make(s, c);
skia::textlayout::TextStyle ts;
ts.setFontSize(24);
ts.setColor(SK_ColorBLACK);
b->pushStyle(ts);
const char* text = "Hello Hello Hello Hello\nHello Hello Hello Hello";
b->addText(text, strlen(text));
b->pop();
auto p = b->Build();
p->layout(200);
p->paint(canvas, 40, 40);
}