351 {
352
353
354
355
356
358
359 {{kConcatBeforeClips, kDoesntMatter, kNoLocalMat},
360 {kConcatAfterClips, kDoesntMatter, kBothWithLocalMat}},
361
362 {{kConcatBetweenClips, kClipGradientFirst, kNoLocalMat},
363 {kConcatAfterClips, kDoesntMatter, kImageWithLocalMat}},
364
365 {{kConcatBetweenClips, kClipImageFirst, kNoLocalMat},
366 {kConcatAfterClips, kDoesntMatter, kGradientWithLocalMat}}
367 };
368
369
371
373
377 {img->width() + 28.f, -100.f},
378 {img->width() - 28.f, img->height() + 100.f},
379 {0.f, img->height() - 80.f}};
382
384
385 auto drawConfig = [&](
Config config) {
386 canvas->save();
387
388 draw_banner(canvas, config);
389
390
391 bool gradLM = config.fLM == kGradientWithLocalMat || config.fLM == kBothWithLocalMat;
394 0.1f * img->width(), gradColors, nullptr, 2,
396 gradLM ? &persp : nullptr);
397 bool imageLM = config.fLM == kImageWithLocalMat || config.fLM == kBothWithLocalMat;
400
401
402 if (config.fConcat == kConcatBeforeClips) {
403 canvas->concat(persp);
404 }
405
406
407 canvas->clipShader(config.fOrder == kClipImageFirst ? imgShader : gradShader);
408
409
410 if (config.fConcat == kConcatBetweenClips) {
411 canvas->concat(persp);
412 }
413
414
415 canvas->clipShader(config.fOrder == kClipImageFirst ? gradShader : imgShader);
416
417
418 if (config.fConcat == kConcatAfterClips) {
419 canvas->concat(persp);
420 }
421
422
423 canvas->clipIRect(img->bounds());
425 canvas->drawImage(img, 0, 0);
426
427 canvas->restore();
428 };
429
432
433 canvas->translate(10.f, 10.f);
434
436 canvas->save();
437 canvas->translate(-grid.
fLeft, -grid.
fTop);
439 canvas->translate(0.f, grid.
height());
441 canvas->restore();
442
443 canvas->translate(grid.
width(), 0.f);
444 }
445}
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
static SkMatrix Concat(const SkMatrix &a, const SkMatrix &b)
bool setPolyToPoly(const SkPoint src[], const SkPoint dst[], int count)
bool mapRect(SkRect *dst, const SkRect &src, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
constexpr int32_t height() const
int32_t fTop
smaller y-axis bounds
constexpr int32_t width() const
int32_t fLeft
smaller x-axis bounds
static SkRect Make(const SkISize &size)
void toQuad(SkPoint quad[4]) const