Home
last modified time | relevance | path

Searched refs:canvas (Results 1 – 25 of 847) sorted by relevance

12345678910>>...34

/external/skia/gm/
Dtextblobtransforms.cpp63 void onDraw(SkCanvas* canvas) override { in onDraw() argument
65 canvas->drawColor(sk_tool_utils::color_to_565(SK_ColorGRAY)); in onDraw()
70 canvas->translate(20, 20); in onDraw()
80 canvas->translate(xOffset, 2 * yOffset); in onDraw()
81 canvas->drawTextBlob(fBlob, 0, 0, paint); in onDraw()
82 canvas->translate(-xOffset, 0); in onDraw()
83 canvas->drawTextBlob(fBlob, 0, 0, paint); in onDraw()
84 canvas->translate(2 * xOffset, 0); in onDraw()
85 canvas->drawTextBlob(fBlob, 0, 0, paint); in onDraw()
86 canvas->translate(-xOffset, -yOffset); in onDraw()
[all …]
Dconcavepaths.cpp17 void test_concave(SkCanvas* canvas, const SkPaint& paint) { in test_concave() argument
19 canvas->translate(0, 0); in test_concave()
24 canvas->drawPath(path, paint); in test_concave()
28 void test_reverse_concave(SkCanvas* canvas, const SkPaint& paint) { in test_reverse_concave() argument
30 canvas->save(); in test_reverse_concave()
31 canvas->translate(100, 0); in test_reverse_concave()
36 canvas->drawPath(path, paint); in test_reverse_concave()
37 canvas->restore(); in test_reverse_concave()
41 void test_bowtie(SkCanvas* canvas, const SkPaint& paint) { in test_bowtie() argument
43 canvas->save(); in test_bowtie()
[all …]
Dperlinnoise.cpp27 void drawRect(SkCanvas* canvas, int x, int y, const SkPaint& paint, const SkISize& size) { in drawRect() argument
28 canvas->save(); in drawRect()
29 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); in drawRect()
32 canvas->drawRect(r, paint); in drawRect()
33 canvas->restore(); in drawRect()
36 void test(SkCanvas* canvas, int x, int y, SkPerlinNoiseShader::Type type, in test() argument
48 drawRect(canvas, x, y, paint, tileSize); in test()
50 drawRect(canvas, x, y, paint, tileSize); in test()
52 drawRect(canvas, x, y, paint, tileSize); in test()
54 drawRect(canvas, x, y, paint, tileSize); in test()
[all …]
Ddashing.cpp13 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()
[all …]
Daaclip.cpp16 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()
[all …]
Dcubicpaths.cpp28 virtual void onDraw(SkCanvas* canvas) { in onDraw() argument
37 canvas->save(); in onDraw()
39 canvas->save(); in onDraw()
40 canvas->clipRect(bounds); in onDraw()
41 canvas->translate(dx, dy); in onDraw()
42 canvas->drawPath(path, paint); in onDraw()
43 canvas->restore(); in onDraw()
45 canvas->translate(bounds.width(), 0); in onDraw()
47 canvas->restore(); in onDraw()
48 canvas->translate(0, bounds.height()); in onDraw()
[all …]
Dimagefilters.cpp22 static void do_draw(SkCanvas* canvas, SkXfermode::Mode mode, SkImageFilter* imf) { in do_draw() argument
23 SkAutoCanvasRestore acr(canvas, true); in do_draw()
24 canvas->clipRect(SkRect::MakeWH(220, 220)); in do_draw()
29 canvas->saveLayer(nullptr, nullptr); in do_draw()
30 canvas->drawColor(SK_ColorGREEN); in do_draw()
39 canvas->drawOval(r0, paint); in do_draw()
44 canvas->drawOval(r1, paint); in do_draw()
47 DEF_SIMPLE_GM(imagefilters_xfermodes, canvas, 480, 480) {
48 canvas->translate(10, 10);
59 canvas->save();
[all …]
Dperspshaders.cpp20 SkCanvas* canvas = surface->getCanvas(); in make_image() local
22 sk_tool_utils::draw_checkerboard(canvas, SK_ColorRED, SK_ColorGREEN, w/10); in make_image()
83 void drawRow(SkCanvas* canvas, SkFilterQuality filterQ) { in drawRow() argument
102 canvas->save(); in drawRow()
104 canvas->save(); in drawRow()
105 canvas->concat(fPerspMatrix); in drawRow()
106 canvas->drawBitmapRect(fBitmap, r, &filterPaint); in drawRow()
107 canvas->restore(); in drawRow()
109 canvas->translate(SkIntToScalar(kCellSize), 0); in drawRow()
110 canvas->save(); in drawRow()
[all …]
Daaxfermodes.cpp96 void draw_pass(SkCanvas* canvas, DrawingPass drawingPass) { in draw_pass() argument
100 canvas->save(); in draw_pass()
102 canvas->translate(kMargin, kMargin); in draw_pass()
104 canvas->translate(0, kTitleSpacing); in draw_pass()
108 canvas->save(); in draw_pass()
112 canvas->drawText("Src Unknown", sizeof("Src Unknown") - 1, in draw_pass()
115 canvas->drawText("Src Opaque", sizeof("Src Opaque") - 1, in draw_pass()
121 canvas->translate(0, kSubtitleSpacing + kShapeSpacing/2); in draw_pass()
125 canvas->save(); in draw_pass()
128 this->drawModeName(canvas, mode); in draw_pass()
[all …]
Dpixelsnap.cpp35 void onDraw(SkCanvas* canvas) override { in onDraw() argument
41 canvas->drawPaint(bgPaint); in onDraw()
53 canvas->save(); in onDraw()
54 canvas->translate(0, SkIntToScalar(kLabelOffsetY)); in onDraw()
57 canvas->drawText(offset.c_str(), offset.size(), in onDraw()
61 canvas->restore(); in onDraw()
64 canvas->save(); in onDraw()
65 canvas->translate(SkIntToScalar(kLabelOffsetX), 0); in onDraw()
68 canvas->drawText(offset.c_str(), offset.size(), in onDraw()
72 canvas->restore(); in onDraw()
[all …]
Dglyph_pos.cpp20 static void drawTestCase(SkCanvas* canvas,
25 static void draw_gm(SkCanvas* canvas, in draw_gm() argument
29 canvas->drawPoint(40.0f, 40.0f, SK_ColorBLACK); in draw_gm()
32 canvas->translate(50.0f, 50.0f); in draw_gm()
33 drawTestCase(canvas, 1.0f, strokeWidth, strokeStyle); in draw_gm()
35 canvas->translate(0.0f, 50.0f); in draw_gm()
36 drawTestCase(canvas, 3.0f, strokeWidth, strokeStyle); in draw_gm()
39 canvas->translate(0.0f, 100.0f); in draw_gm()
40 canvas->save(); in draw_gm()
41 canvas->scale(3.0f, 3.0f); in draw_gm()
[all …]
Doffsetimagefilter.cpp45 void onDraw(SkCanvas* canvas) override { in onDraw() argument
46 canvas->clear(SK_ColorBLACK); in onDraw()
62 DrawClippedImage(canvas, image, paint, 1, cropRect); in onDraw()
63 canvas->translate(SkIntToScalar(image->width() + MARGIN), 0); in onDraw()
70 DrawClippedImage(canvas, fBitmap, paint, 2, cropRect); in onDraw()
73 static void DrawClippedImage(SkCanvas* canvas, const SkImage* image, const SkPaint& paint, in DrawClippedImage() argument
77 canvas->save(); in DrawClippedImage()
78 canvas->clipRect(clipRect); in DrawClippedImage()
79 canvas->scale(scale, scale); in DrawClippedImage()
80 canvas->drawImage(image, 0, 0, &paint); in DrawClippedImage()
[all …]
Dstrokes.cpp51 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()
[all …]
Dthinrects.cpp28 void onDraw(SkCanvas* canvas) override { in onDraw() argument
39 canvas->save(); in onDraw()
40 canvas->translate(i*0.125f, i*40.0f); in onDraw()
41 DrawVertRects(canvas, white); in onDraw()
43 canvas->translate(40.0f, 0.0f); in onDraw()
44 DrawVertRects(canvas, green); in onDraw()
45 canvas->restore(); in onDraw()
47 canvas->save(); in onDraw()
48 canvas->translate(80.0f, i*40.0f + i*0.125f); in onDraw()
49 DrawHorizRects(canvas, white); in onDraw()
[all …]
Drecordopts.cpp57 static void draw_save_layer_draw_rect_restore_sequence(SkCanvas* canvas, SkColor shapeColor, in draw_save_layer_draw_rect_restore_sequence() argument
62 canvas->saveLayer(&targetRect, &layerPaint); in draw_save_layer_draw_rect_restore_sequence()
66 canvas->drawRect(targetRect, drawPaint); in draw_save_layer_draw_rect_restore_sequence()
67 canvas->restore(); in draw_save_layer_draw_rect_restore_sequence()
72 static void draw_save_layer_draw_bitmap_restore_sequence(SkCanvas* canvas, SkColor shapeColor, in draw_save_layer_draw_bitmap_restore_sequence() argument
79 SkCanvas canvas(bitmap); in draw_save_layer_draw_bitmap_restore_sequence() local
83 canvas.drawRect(SkRect::MakeWH(SkIntToScalar(7), SkIntToScalar(7)), p); in draw_save_layer_draw_bitmap_restore_sequence()
84 canvas.flush(); in draw_save_layer_draw_bitmap_restore_sequence()
90 canvas->saveLayer(&targetRect, &layerPaint); in draw_save_layer_draw_bitmap_restore_sequence()
93 canvas->drawBitmap(bitmap, SkIntToScalar(0), SkIntToScalar(0), &drawPaint); in draw_save_layer_draw_bitmap_restore_sequence()
[all …]
Dscaledstrokes.cpp27 static void draw_path(SkScalar size, SkCanvas* canvas, SkPaint paint) { in draw_path() argument
35 canvas->drawPath(path, paint); in draw_path()
38 void onDraw(SkCanvas* canvas) override { in onDraw() argument
42 canvas->translate(5.0f, 5.0f); in onDraw()
46 canvas->save(); in onDraw()
50 canvas->save(); in onDraw()
51 canvas->translate(size / 2.0f, size / 2.0f); in onDraw()
52 canvas->scale(scale, scale); in onDraw()
53 draw_path(size / 2.0f / scale, canvas, paint); in onDraw()
54 canvas->restore(); in onDraw()
[all …]
Dimage.cpp20 static void drawJpeg(SkCanvas* canvas, const SkISize& size) { in drawJpeg() argument
30 SkAutoCanvasRestore acr(canvas, true); in drawJpeg()
31 canvas->scale(size.width() * 1.0f / image->width(), in drawJpeg()
33 canvas->drawImage(image, 0, 0, nullptr); in drawJpeg()
41 SkCanvas* canvas = surface->getCanvas(); in drawContents() local
50 canvas->drawCircle(size.fWidth/2, size.fHeight/2, radius, paint); in drawContents()
55 canvas->drawCircle(size.fWidth/2, size.fHeight/2, radius, paint); in drawContents()
58 static void test_surface(SkCanvas* canvas, SkSurface* surf, bool usePaint) { in test_surface() argument
80 canvas->drawImage(imgR, 0, 0, usePaint ? &paint : nullptr); in test_surface()
81 canvas->drawImage(imgG, 0, 80, usePaint ? &paint : nullptr); in test_surface()
[all …]
Dfilltypespersp.cpp37 void showPath(SkCanvas* canvas, int x, int y, SkPath::FillType ft, in showPath() argument
41 canvas->save(); in showPath()
42 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); in showPath()
43 canvas->clipRect(r); in showPath()
44 canvas->drawColor(SK_ColorWHITE); in showPath()
46 canvas->translate(r.centerX(), r.centerY()); in showPath()
47 canvas->scale(scale, scale); in showPath()
48 canvas->translate(-r.centerX(), -r.centerY()); in showPath()
49 canvas->drawPath(fPath, paint); in showPath()
50 canvas->restore(); in showPath()
[all …]
Dpictureimagefilter.cpp27 SkCanvas* canvas = recorder.beginRecording(100, 100, nullptr, 0); in makePicture() local
28 canvas->clear(SK_ColorBLACK); in makePicture()
35 canvas->drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint); in makePicture()
45 static void fillRectFiltered(SkCanvas* canvas, const SkRect& clipRect, SkImageFilter* filter) { in fillRectFiltered() argument
48 canvas->save(); in fillRectFiltered()
49 canvas->clipRect(clipRect); in fillRectFiltered()
50 canvas->drawPaint(paint); in fillRectFiltered()
51 canvas->restore(); in fillRectFiltered()
54 void onDraw(SkCanvas* canvas) override { in onDraw() argument
55 canvas->clear(SK_ColorBLACK); in onDraw()
[all …]
Dfilltypes.cpp38 void showPath(SkCanvas* canvas, int x, int y, SkPath::FillType ft, in showPath() argument
42 canvas->save(); in showPath()
43 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); in showPath()
44 canvas->clipRect(r); in showPath()
45 canvas->drawColor(SK_ColorWHITE); in showPath()
47 canvas->translate(r.centerX(), r.centerY()); in showPath()
48 canvas->scale(scale, scale); in showPath()
49 canvas->translate(-r.centerX(), -r.centerY()); in showPath()
50 canvas->drawPath(fPath, paint); in showPath()
51 canvas->restore(); in showPath()
[all …]
/external/skia/samplecode/
DSampleAARects.cpp20 SkCanvas canvas(bitmap); in createBitmap() local
27 canvas.drawOval(r, paint); in createBitmap()
31 canvas.drawLine(0, 0, r.fRight, r.fBottom, paint); in createBitmap()
32 canvas.drawLine(0, r.fBottom, r.fRight, 0, paint); in createBitmap()
59 virtual void onDrawContent(SkCanvas* canvas) { in onDrawContent() argument
60 canvas->translate(SkIntToScalar(10), SkIntToScalar(10)); in onDrawContent()
86 canvas->save(); in onDrawContent()
91 canvas->drawRect(rect, paints[p]); in onDrawContent()
92 canvas->translate(dx, 0); in onDrawContent()
98 canvas->drawRect(rect, paints[p]); in onDrawContent()
[all …]
DSampleClock.cpp34 void onDrawContent(SkCanvas* canvas) override { in onDrawContent() argument
39 canvas->save(); in onDrawContent()
40 canvas->translate(150, 150); in onDrawContent()
41 canvas->scale(0.4f, 0.4f); in onDrawContent()
42 canvas->rotate(-180.f/2.f); in onDrawContent()
60 canvas->save(); in onDrawContent()
62 canvas->rotate(180.f/6.f); in onDrawContent()
67 canvas->drawPath(path, paintStroke); in onDrawContent()
69 canvas->drawRRect(rrect, paintFill); in onDrawContent()
72 canvas->restore(); in onDrawContent()
[all …]
DSampleFillType.cpp39 void showPath(SkCanvas* canvas, int x, int y, SkPath::FillType ft, in showPath() argument
44 canvas->save(); in showPath()
45 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); in showPath()
46 canvas->clipRect(r); in showPath()
47 canvas->drawColor(SK_ColorWHITE); in showPath()
49 canvas->translate(r.centerX(), r.centerY()); in showPath()
50 canvas->scale(scale, scale); in showPath()
51 canvas->translate(-r.centerX(), -r.centerY()); in showPath()
52 canvas->drawPath(fPath, paint); in showPath()
53 canvas->restore(); in showPath()
[all …]
/external/skia/tests/
DCanvasTest.cpp203 static void test_clipVisitor(skiatest::Reporter* reporter, SkCanvas* canvas) { in test_clipVisitor() argument
204 SkISize size = canvas->getDeviceSize(); in test_clipVisitor()
211 canvas->replayClips(&visitor); in test_clipVisitor()
213 REPORTER_ASSERT(reporter, equal_clips(c, *canvas)); in test_clipVisitor()
221 SkCanvas canvas(10, 10); in test_clipstack() local
222 cs = SkRef(canvas.getClipStack()); in test_clipstack()
288 virtual void draw(SkCanvas* canvas, const TestData& d, \
290 FUNCTION (canvas, d, reporter, this); \
300 virtual void draw(SkCanvas* canvas, const TestData& d, \
302 FUNCTION (canvas, d, reporter, this); \
[all …]
DMatrixClipCollapseTest.cpp141 typedef void (*PFEmitMC)(SkCanvas* canvas, MatType mat, ClipType clip,
144 typedef void (*PFEmitBody)(SkCanvas* canvas, PFEmitMC emitMC, MatType mat,
147 typedef void (*PFEmitStruct)(SkCanvas* canvas, PFEmitMC emitMC, MatType mat,
154 static void emit_clip(SkCanvas* canvas, ClipType clip) { in emit_clip() argument
160 canvas->clipRect(r, SkRegion::kIntersect_Op, true); in emit_clip()
167 canvas->clipRRect(rr, SkRegion::kIntersect_Op, true); in emit_clip()
176 canvas->clipPath(p, SkRegion::kIntersect_Op, true); in emit_clip()
186 canvas->clipRegion(r, SkRegion::kIntersect_Op); in emit_clip()
224 static void emit_mat(SkCanvas* canvas, MatType mat) { in emit_mat() argument
229 canvas->translate(5.0f, 5.0f); in emit_mat()
[all …]

12345678910>>...34