Lines Matching refs:canvas

16 static void draw(SkCanvas* canvas, SkRect& target, int x, int y) {  in draw()  argument
27 canvas->save(); in draw()
28 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); in draw()
30 canvas->drawRect(target, borderPaint); in draw()
32 canvas->drawRect(target, backgroundPaint); in draw()
33 canvas->clipRect(target, SkRegion::kIntersect_Op, true); in draw()
35 canvas->drawRect(target, foregroundPaint); in draw()
36 canvas->restore(); in draw()
39 static void draw_square(SkCanvas* canvas, int x, int y) { in draw_square() argument
41 draw(canvas, target, x, y); in draw_square()
44 static void draw_column(SkCanvas* canvas, int x, int y) { in draw_column() argument
46 draw(canvas, target, x, y); in draw_column()
49 static void draw_bar(SkCanvas* canvas, int x, int y) { in draw_bar() argument
51 draw(canvas, target, x, y); in draw_bar()
54 static void draw_rect_tests(SkCanvas* canvas) { in draw_rect_tests() argument
55 draw_square(canvas, 10, 10); in draw_rect_tests()
56 draw_column(canvas, 30, 10); in draw_rect_tests()
57 draw_bar(canvas, 10, 30); in draw_rect_tests()
82 void onDraw(SkCanvas* canvas) override { in onDraw() argument
84 draw_rect_tests(canvas); in onDraw()
87 canvas->translate(SK_Scalar1 / 5, SK_Scalar1 / 5); in onDraw()
88 canvas->translate(SkIntToScalar(50), 0); in onDraw()
89 draw_rect_tests(canvas); in onDraw()
91 canvas->translate(SK_Scalar1 / 5, SK_Scalar1 / 5); in onDraw()
92 canvas->translate(SkIntToScalar(50), 0); in onDraw()
93 draw_rect_tests(canvas); in onDraw()
95 canvas->translate(SK_Scalar1 / 5, SK_Scalar1 / 5); in onDraw()
96 canvas->translate(SkIntToScalar(50), 0); in onDraw()
97 draw_rect_tests(canvas); in onDraw()
99 canvas->translate(SK_Scalar1 / 5, SK_Scalar1 / 5); in onDraw()
100 canvas->translate(SkIntToScalar(50), 0); in onDraw()
101 draw_rect_tests(canvas); in onDraw()
126 static void test_image(SkCanvas* canvas, const SkImageInfo& info) { in test_image() argument
141 canvas->drawBitmap(bm, 10, 10); in test_image()
149 canvas->drawBitmap(bm2, 10, 120); in test_image()
165 void onDraw(SkCanvas* canvas) override { in onDraw() argument
183 test_image(canvas, info); in onDraw()
184 canvas->translate(info.width() + 10, 0); in onDraw()
224 void doDraw(SkCanvas* canvas, const SkPath& path) { in doDraw() argument
229 canvas->drawPath(path, paint); in doDraw()
233 canvas->drawPath(path, paint); in doDraw()
236 void drawAndClip(SkCanvas* canvas, const SkPath& path, SkScalar dx, SkScalar dy) { in drawAndClip() argument
237 SkAutoCanvasRestore acr(canvas, true); in drawAndClip()
243 canvas->drawRect(r, paint); in drawAndClip()
244 this->doDraw(canvas, path); in drawAndClip()
246 canvas->translate(dx, dy); in drawAndClip()
248 canvas->drawRect(r, paint); in drawAndClip()
249 canvas->clipRect(r); in drawAndClip()
250 this->doDraw(canvas, path); in drawAndClip()
253 void onDraw(SkCanvas* canvas) override { in onDraw() argument
254 canvas->translate(80, 10); in onDraw()
255 this->drawAndClip(canvas, fVPath, 200, 0); in onDraw()
256 canvas->translate(0, 200); in onDraw()
257 this->drawAndClip(canvas, fHPath, 200, 0); in onDraw()