Lines Matching refs:canvas
51 void onDraw(SkCanvas* canvas) override { in onDraw() argument
58 SkAutoCanvasRestore acr(canvas, true); in onDraw()
59 canvas->translate(0, SH * y); in onDraw()
60 canvas->clipRect(SkRect::MakeLTRB( in onDraw()
69 canvas->drawOval(r, paint); in onDraw()
71 canvas->drawRoundRect(r, r.width()/4, r.height()/4, paint); in onDraw()
114 void onDraw(SkCanvas* canvas) override { in onDraw() argument
124 canvas->save(); in onDraw()
125 canvas->translate(10 + i * 100.f, 10); in onDraw()
126 canvas->drawPath(fMoveHfPath, strokePaint); in onDraw()
127 canvas->translate(0, 20); in onDraw()
128 canvas->drawPath(fMoveZfPath, strokePaint); in onDraw()
134 canvas->translate(0, 20); in onDraw()
135 canvas->drawPath(fDashedfPath, dashPaint); in onDraw()
136 canvas->translate(0, 20); in onDraw()
137 canvas->drawPath(fRefPath[i * 2], fillPaint); in onDraw()
140 canvas->translate(0, 50); in onDraw()
141 canvas->drawPath(fMoveHfPath, strokePaint); in onDraw()
142 canvas->translate(0, 30); in onDraw()
143 canvas->drawPath(fMoveZfPath, strokePaint); in onDraw()
144 canvas->translate(0, 30); in onDraw()
146 canvas->drawPath(fRefPath[1 + i * 2], fillPaint); in onDraw()
147 canvas->translate(0, 30); in onDraw()
148 canvas->drawPath(fCubicPath, strokePaint); in onDraw()
149 canvas->translate(0, 30); in onDraw()
150 canvas->drawPath(fQuadPath, strokePaint); in onDraw()
151 canvas->translate(0, 30); in onDraw()
152 canvas->drawPath(fLinePath, strokePaint); in onDraw()
153 canvas->restore(); in onDraw()
171 static void line(SkScalar scale, SkCanvas* canvas, SkColor color) { in line() argument
176 canvas->translate(50, 0); in line()
177 canvas->save(); in line()
179 canvas->scale(1 / scale, 1 / scale); in line()
180 canvas->drawLine(20 * scale, 20 * scale, 20 * scale, 100 * scale, p); in line()
181 canvas->drawLine(20 * scale, 20 * scale, 100 * scale, 100 * scale, p); in line()
182 canvas->restore(); in line()
185 void onDraw(SkCanvas* canvas) override { in onDraw() argument
186 line(0.00005f, canvas, SK_ColorBLACK); in onDraw()
187 line(0.000045f, canvas, SK_ColorRED); in onDraw()
188 line(0.0000035f, canvas, SK_ColorGREEN); in onDraw()
189 line(0.000003f, canvas, SK_ColorBLUE); in onDraw()
190 line(0.000002f, canvas, SK_ColorBLACK); in onDraw()
196 DEF_SIMPLE_GM(CubicStroke, canvas, 384, 384) {
204 canvas->drawPath(path, p);
206 canvas->translate(10, 10);
207 canvas->drawPath(path, p);
209 canvas->translate(10, 10);
210 canvas->drawPath(path, p);
213 DEF_SIMPLE_GM(zerolinestroke, canvas, 90, 120) {
225 canvas->drawPath(path, paint);
230 canvas->drawPath(path, paint);
236 canvas->drawPath(path, paint);
239 DEF_SIMPLE_GM(quadcap, canvas, 200, 200) {
261 canvas->drawPath(path, p);
267 canvas->translate(30, 0);
268 canvas->drawPath(path, p);
293 static void rotate(SkScalar angle, SkScalar px, SkScalar py, SkCanvas* canvas) { in rotate() argument
296 canvas->concat(matrix); in rotate()
299 void onDraw(SkCanvas* canvas) override { in onDraw() argument
300 canvas->drawColor(SK_ColorWHITE); in onDraw()
308 SkAutoCanvasRestore acr(canvas, true); in onDraw()
309 canvas->translate(0, SH * y); in onDraw()
310 canvas->clipRect(SkRect::MakeLTRB(SkIntToScalar(2), in onDraw()
319 rotate(SkIntToScalar(15), SW/2, SH/2, canvas); in onDraw()
320 canvas->drawPath(fPath, paint); in onDraw()
391 void onDraw(SkCanvas* canvas) override { in onDraw() argument
404 canvas->translate(SkIntToScalar(20), SkIntToScalar(80)); in onDraw()
415 canvas->save(); in onDraw()
418 canvas->drawPath(orig, strokePaint); in onDraw()
419 canvas->drawPath(orig, origPaint); in onDraw()
422 canvas->drawPath(fill, fillPaint); in onDraw()
423 canvas->translate(dx + strokePaint.getStrokeWidth(), 0); in onDraw()
425 canvas->restore(); in onDraw()
426 canvas->translate(0, dy); in onDraw()
448 void onDraw(SkCanvas* canvas) override { in onDraw() argument
453 canvas->scale(1000, 1000); in onDraw()
454 canvas->drawCircle(0, 2, 1.97f, paint); in onDraw()
476 void onDraw(SkCanvas* canvas) override { in onDraw() argument
487 canvas->drawPath(path, p); in onDraw()
491 canvas->drawPath(path, p); in onDraw()
495 canvas->drawPath(path, p); in onDraw()
500 canvas->drawPath(path, p); in onDraw()
504 canvas->drawPath(path, p); in onDraw()
508 canvas->drawPath(path, p); in onDraw()