Tests image shader mirror tile mode with scale factors of 1 and -1, with nearest and linear filtering, and with/without a half pixel offset between device and image space. The linear filter should only have an effect when there is a half pixel offset. We test mirror tile mode in x and in y separately.
23 {
24
25
27 *errorMsg = "Test only works with canvases backed by CPU pixels";
29 }
30
31 uint32_t
colors[] {0xFFFF0000, 0xFF00FF00, 0xFF0000FF};
38
45
46
47 auto surf = canvas->makeSurface(canvas->imageInfo().makeWH(80, 80));
49 auto* c = surf->getCanvas();
51
52 for (
bool offset : {
false,
true}) {
55
56
60 c->save();
61 c->translate(imgx->width(), 0);
63 c->translate(0.5, 0);
64 }
66 c->restore();
67
68
72 c->save();
73 c->translate(3*imgx->width() + 3, imgy->height());
75 c->translate(0, 0.5);
76 }
78 c->restore();
79
80 c->translate(0, 3*imgy->height() + 3);
81 }
82 }
83
84 canvas->scale(8, 8);
85 canvas->drawImage(surf->makeImageSnapshot(), 0, 0);
87}
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
constexpr SkColor SK_ColorWHITE
SK_API sk_sp< SkImage > RasterFromPixmapCopy(const SkPixmap &pixmap)
PODArray< SkColor > colors
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
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)