116 {
119
122 p.setColor4f(c, p3.get());
123 return p.getColor4f();
124 };
125
126
127 {
129 paint.setColor4f({1,0,0,1}, p3.get());
130
131 canvas->drawRect({10,10,70,70},
paint);
133 canvas, 10,10,
134 {1,0,0,1}, p3.get());
135 }
136
137 canvas->translate(0,80);
138
139
140 {
143
145 paint.setColor4f({1,0,0,1}, p3.get());
147
148 canvas->drawImage(bm.
asImage(), 10,10);
150 canvas, 10,10,
151 {1,0,0,1}, p3.get());
152 }
153
154 canvas->translate(0,80);
155
156
157
158
159 {
160
163
168 canvas->drawRect({10,10,70,70},
paint);
169 canvas->save();
171 canvas, 10,10,
172 {1,0,0,1}, p3.get());
173
174 canvas->translate(180, 0);
175
177 canvas, 69,69,
178 {0,1,0,1}, p3.get());
179 canvas->restore();
180 }
181
182 canvas->translate(0,80);
183
184
185 {
186
189
196 nullptr));
197 canvas->drawRect({10,10,70,70},
paint);
198 canvas->save();
200 canvas, 10,10,
201 {1,0,0,1}, p3.get());
202
203 canvas->translate(180, 0);
204
206 canvas, 69,69,
207 {0,1,0,1}, p3.get());
208 canvas->restore();
209 }
210
211 canvas->translate(0,80);
212
213
214 {
215
218
223 canvas->drawRect({10,10,70,70},
paint);
224 canvas->save();
226 canvas, 10,10,
227 {1,0,0,1}, p3.get());
228
229 canvas->translate(180, 0);
230
232 canvas, 69,69,
233 {0,1,0,1}, p3.get());
234 canvas->restore();
235 }
236
237 canvas->translate(0,80);
238
239
240 {
241
244
251 nullptr));
252 canvas->drawRect({10,10,70,70},
paint);
253 canvas->save();
255 canvas, 10,10,
256 {1,0,0,1}, p3.get());
257
258 canvas->translate(180, 0);
259
261 canvas, 69,69,
262 {0,1,0,1}, p3.get());
263 canvas->restore();
264 }
265
266 canvas->translate(0,80);
267
268
269 {
271 SkColor4f colors[] = { {0,0,1,1}, {0,1,0,1}, {1,0,0,1} };
272
279 nullptr));
280 canvas->drawRect({10,10,70,70},
paint);
281 canvas->save();
283 canvas, 10,10,
284 {0,0,1,1}, p3.get());
285
286 canvas->translate(180, 0);
287
289 canvas, 10,69,
290 {1,0,0,1}, p3.get());
291 canvas->restore();
292 }
293
294 canvas->translate(0,80);
295
296
297 {
298 uint8_t mask[256];
299 for (
int i = 0;
i < 256;
i++) {
301 }
302
305
309
313
316 canvas, 10,10,
317 {1,0,0,1}, p3.get());
318
319 canvas->translate(0, 80);
320
321 canvas->save();
322 canvas->translate(10,10);
323 canvas->drawRect({0,0,16,16}, as_shader);
324 canvas->restore();
326 canvas, 10,10,
327 {1,0,0,1}, p3.get());
328
329 canvas->translate(0,80);
330
331 canvas->drawImageRect(bm.
asImage(), {10,10,70,70},
sampling, &as_bitmap);
333 canvas, 10,10,
334 {1,0,0,1}, p3.get());
335
336 canvas->translate(0,80);
337
338 canvas->save();
339 canvas->translate(10,10);
340 canvas->scale(3.75,3.75);
341 canvas->drawRect({0,0,16,16}, as_shader);
342 canvas->restore();
344 canvas, 10,10,
345 {1,0,0,1}, p3.get());
346 }
347
348
349}
static const int points[]
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
sk_sp< SkImage > asImage() const
bool installPixels(const SkImageInfo &info, void *pixels, size_t rowBytes, void(*releaseProc)(void *addr, void *context), void *context)
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
static sk_sp< SkColorSpace > MakeSRGB()
static sk_sp< SkColorSpace > MakeRGB(const skcms_TransferFunction &transferFn, const skcms_Matrix3x3 &toXYZ)
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
@ kInterpolateColorsInPremul_Flag
void setColor4f(const SkColor4f &color, SkColorSpace *colorSpace=nullptr)
void setShader(sk_sp< SkShader > shader)
static constexpr skcms_Matrix3x3 kDisplayP3
static constexpr skcms_TransferFunction kSRGB
PODArray< SkColor > colors
SkSamplingOptions sampling
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 void compare_pixel(const char *label, SkCanvas *canvas, int x, int y, SkColor4f color, SkColorSpace *cs)
static SkImageInfo MakeA8(int width, int height)