Lines Matching refs:canvas

13 static void drawline(SkCanvas* canvas, int on, int off, const SkPaint& paint,  in drawline()  argument
25 canvas->drawLine(startX, startY, finalX, finalY, p); in drawline()
31 static void show_giant_dash(SkCanvas* canvas) { in show_giant_dash() argument
34 drawline(canvas, 1, 1, paint, SkIntToScalar(20 * 1000)); in show_giant_dash()
37 static void show_zero_len_dash(SkCanvas* canvas) { in show_zero_len_dash() argument
40 drawline(canvas, 2, 2, paint, SkIntToScalar(0)); in show_zero_len_dash()
43 canvas->translate(0, SkIntToScalar(20)); in show_zero_len_dash()
44 drawline(canvas, 4, 4, paint, SkIntToScalar(0)); in show_zero_len_dash()
59 virtual void onDraw(SkCanvas* canvas) { in onDraw() argument
71 canvas->translate(SkIntToScalar(20), SkIntToScalar(20)); in onDraw()
72 canvas->translate(0, SK_ScalarHalf); in onDraw()
82 drawline(canvas, gData[data].fOnInterval * scale, in onDraw()
85 canvas->translate(0, SkIntToScalar(20)); in onDraw()
90 show_giant_dash(canvas); in onDraw()
91 canvas->translate(0, SkIntToScalar(20)); in onDraw()
92 show_zero_len_dash(canvas); in onDraw()
93 canvas->translate(0, SkIntToScalar(20)); in onDraw()
96 drawline(canvas, 0, 0, paint); in onDraw()
147 virtual void onDraw(SkCanvas* canvas) { in onDraw() argument
185 canvas->drawPath(path, paint); in onDraw()
208 void drawDashedLines(SkCanvas* canvas, in drawDashedLines() argument
233 canvas->drawPoints(SkCanvas::kLines_PointMode, 2, pts, p); in drawDashedLines()
242 canvas->drawPoints(SkCanvas::kLines_PointMode, 2, pts, p); in drawDashedLines()
246 virtual void onDraw(SkCanvas* canvas) { in onDraw() argument
248 canvas->save(); in onDraw()
249 canvas->translate(2, 0); in onDraw()
250 this->drawDashedLines(canvas, 100, 0, SK_Scalar1, 1, false); in onDraw()
251 canvas->restore(); in onDraw()
254 canvas->save(); in onDraw()
255 canvas->translate(112, 0); in onDraw()
256 this->drawDashedLines(canvas, 100, SK_ScalarHalf, SK_Scalar1, 1, false); in onDraw()
257 canvas->restore(); in onDraw()
260 canvas->save(); in onDraw()
261 canvas->translate(222, 0); in onDraw()
262 this->drawDashedLines(canvas, 100, SK_Scalar1, SK_Scalar1, 1, false); in onDraw()
263 canvas->restore(); in onDraw()
266 canvas->save(); in onDraw()
267 canvas->translate(332, 0); in onDraw()
268 this->drawDashedLines(canvas, 99.5f, SK_ScalarHalf, SK_Scalar1, 1, false); in onDraw()
269 canvas->restore(); in onDraw()
272 canvas->save(); in onDraw()
273 canvas->translate(446, 0); in onDraw()
274 this->drawDashedLines(canvas, 100, 0, SkIntToScalar(255), 1, false); in onDraw()
275 canvas->restore(); in onDraw()
278 canvas->save(); in onDraw()
279 canvas->translate(2, 110); in onDraw()
280 this->drawDashedLines(canvas, 100, 0, SkIntToScalar(3), 3, false); in onDraw()
281 canvas->restore(); in onDraw()
284 canvas->save(); in onDraw()
285 canvas->translate(112, 110); in onDraw()
286 this->drawDashedLines(canvas, 100, 1.5f, SkIntToScalar(3), 3, false); in onDraw()
287 canvas->restore(); in onDraw()
290 canvas->save(); in onDraw()
291 canvas->translate(2, 220); in onDraw()
292 this->drawDashedLines(canvas, 100, SK_Scalar1, SK_Scalar1, 1, true); in onDraw()
293 canvas->restore(); in onDraw()
296 canvas->save(); in onDraw()
297 canvas->translate(112, 220); in onDraw()
298 this->drawDashedLines(canvas, 100, 0, SkIntToScalar(3), 3, true); in onDraw()
299 canvas->restore(); in onDraw()
302 canvas->save(); in onDraw()
303 canvas->translate(332+SK_ScalarRoot2Over2*100, 110+SK_ScalarRoot2Over2*100); in onDraw()
304 canvas->rotate(45); in onDraw()
305 canvas->translate(-50, -50); in onDraw()
307 this->drawDashedLines(canvas, 100, SK_Scalar1, SK_Scalar1, 1, false); in onDraw()
308 canvas->restore(); in onDraw()
312 canvas->save(); in onDraw()
313 canvas->translate(SkIntToScalar(phase*110+2), in onDraw()
315 … this->drawDashedLines(canvas, 100, SkIntToScalar(phase), SkIntToScalar(3), 1, false); in onDraw()
316 canvas->restore(); in onDraw()
336 virtual void onDraw(SkCanvas* canvas) { in onDraw() argument
349 canvas->translate(SkIntToScalar(20), SkIntToScalar(20)); in onDraw()
350 canvas->translate(0, SK_ScalarHalf); in onDraw()
365 drawline(canvas, gData[data].fOnInterval * scale, in onDraw()
368 canvas->translate(0, SkIntToScalar(20)); in onDraw()
379 drawline(canvas, 32, 16, paint, 20.f, 0, 5.f); in onDraw()
380 canvas->translate(0, SkIntToScalar(20)); in onDraw()
383 drawline(canvas, 32, 16, paint, 56.f, 0, 5.f); in onDraw()
384 canvas->translate(0, SkIntToScalar(20)); in onDraw()
387 drawline(canvas, 32, 16, paint, 584.f, 0, 5.f); in onDraw()
388 canvas->translate(0, SkIntToScalar(20)); in onDraw()
392 drawline(canvas, 32, 16, paint, 600.f, 30.f); in onDraw()
393 canvas->translate(0, SkIntToScalar(20)); in onDraw()
396 drawline(canvas, 32, 16, paint, 8.f, 0.f, 40.f); in onDraw()
397 canvas->translate(0, SkIntToScalar(20)); in onDraw()
422 void onDraw(SkCanvas* canvas) override { in onDraw() argument
447 canvas->concat(rot); in onDraw()
456 drawline(canvas, kOn, kOff, paint, in onDraw()
467 drawline(canvas, kOn, kOff, paint, in onDraw()
479 DEF_SIMPLE_GM(longpathdash, canvas, 512, 512) {
502 canvas->drawPath(lines, p);
505 DEF_SIMPLE_GM(longlinedash, canvas, 512, 512) {
513 canvas->drawRect(SkRect::MakeXYWH(-10000, 100, 20000, 20), p);
516 DEF_SIMPLE_GM(longwavyline, canvas, 512, 512) {
528 canvas->drawPath(wavy, p);