Lines Matching refs:canvas
36 SkCanvas* canvas, int x, int y, in compare_pixel() argument
40 auto canvas_cs = canvas->imageInfo().refColorSpace(); in compare_pixel()
45 const SkMatrix& m = canvas->getTotalMatrix(); in compare_pixel()
53 if (!canvas->readPixels(bm, x,y)) { in compare_pixel()
54 MarkGMGood(canvas, 140,40); in compare_pixel()
55 canvas->drawString("can't readPixels() on this canvas :(", 100,20, font, paint); in compare_pixel()
63 if (canvas->imageInfo().colorType() < kRGBA_F16_SkColorType) { in compare_pixel()
69 if (canvas->imageInfo().colorType() == kGray_8_SkColorType) { in compare_pixel()
76 MarkGMGood(canvas, 140,40); in compare_pixel()
78 MarkGMBad(canvas, 140,40); in compare_pixel()
89 SkAutoCanvasRestore saveRestore(canvas, true); in compare_pixel()
90 canvas->drawString(label, 80,20, font, paint); in compare_pixel()
92 canvas->translate(0,20); in compare_pixel()
93 canvas->drawString(l.label, 80,20, font, paint); in compare_pixel()
94 canvas->drawString(fmt(l.color).c_str(), 140,20, font, paint); in compare_pixel()
98 DEF_SIMPLE_GM(p3, canvas, 450, 1300) {
113 canvas->drawRect({10,10,70,70}, paint);
115 canvas, 10,10,
119 canvas->translate(0,80);
130 canvas->drawBitmap(bm, 10,10);
132 canvas, 10,10,
136 canvas->translate(0,80);
145 canvas->drawBitmap(bm, 10,10);
147 canvas, 10,10,
151 canvas->translate(0,80);
163 canvas->drawBitmap(bm, 10,10);
165 canvas, 10,10,
169 canvas->translate(0,80);
185 canvas->drawRect({10,10,70,70}, paint);
187 canvas, 10,10,
191 canvas->translate(0,80);
203 canvas->drawRect({10,10,70,70}, paint);
204 canvas->save();
206 canvas, 10,10,
209 canvas->translate(180, 0);
212 canvas, 69,69,
214 canvas->restore();
217 canvas->translate(0,80);
232 canvas->drawRect({10,10,70,70}, paint);
233 canvas->save();
235 canvas, 10,10,
238 canvas->translate(180, 0);
241 canvas, 69,69,
243 canvas->restore();
246 canvas->translate(0,80);
258 canvas->drawRect({10,10,70,70}, paint);
259 canvas->save();
261 canvas, 10,10,
264 canvas->translate(180, 0);
267 canvas, 69,69,
269 canvas->restore();
272 canvas->translate(0,80);
287 canvas->drawRect({10,10,70,70}, paint);
288 canvas->save();
290 canvas, 10,10,
293 canvas->translate(180, 0);
296 canvas, 69,69,
298 canvas->restore();
301 canvas->translate(0,80);
315 canvas->drawRect({10,10,70,70}, paint);
316 canvas->save();
318 canvas, 10,10,
321 canvas->translate(180, 0);
324 canvas, 10,69,
326 canvas->restore();
329 canvas->translate(0,80);
350 canvas->drawBitmap(bm, 10,10, &as_bitmap);
352 canvas, 10,10,
355 canvas->translate(0, 80);
357 canvas->save();
358 canvas->translate(10,10);
359 canvas->drawRect({0,0,16,16}, as_shader);
360 canvas->restore();
362 canvas, 10,10,
365 canvas->translate(0,80);
367 canvas->drawBitmapRect(bm, {10,10,70,70}, &as_bitmap);
369 canvas, 10,10,
372 canvas->translate(0,80);
374 canvas->save();
375 canvas->translate(10,10);
376 canvas->scale(3.75,3.75);
377 canvas->drawRect({0,0,16,16}, as_shader);
378 canvas->restore();
380 canvas, 10,10,
387 DEF_SIMPLE_GM(p3_ovals, canvas, 450, 320) {
398 canvas->drawCircle(40, 40, 30, paint);
400 canvas, 40, 40,
404 canvas->translate(0, 80);
412 canvas->drawOval({ 20,10,60,70 }, paint);
414 canvas, 40, 40,
418 canvas->translate(0, 80);
430 canvas->drawCircle(40, 40, 30, paint);
432 canvas, 40, 10,
436 canvas->translate(0, 80);
444 canvas->save();
445 canvas->translate(40, 40);
446 canvas->rotate(45);
447 canvas->drawOval({ -20,-30,20,30 }, paint);
448 canvas->restore();
450 canvas, 40, 40,
454 canvas->translate(0, 80);