Home
last modified time | relevance | path

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

12345678910>>...29

/external/skia/gm/
Dtextblobtransforms.cpp63 void onDraw(SkCanvas* canvas) override { in onDraw() argument
65 canvas->drawColor(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.cpp16 void test_concave(SkCanvas* canvas, const SkPaint& paint) { in test_concave() argument
18 canvas->translate(0, 0); in test_concave()
23 canvas->drawPath(path, paint); in test_concave()
27 void test_reverse_concave(SkCanvas* canvas, const SkPaint& paint) { in test_reverse_concave() argument
29 canvas->save(); in test_reverse_concave()
30 canvas->translate(100, 0); in test_reverse_concave()
35 canvas->drawPath(path, paint); in test_reverse_concave()
36 canvas->restore(); in test_reverse_concave()
40 void test_bowtie(SkCanvas* canvas, const SkPaint& paint) { in test_bowtie() argument
42 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 …]
Dpixelsnap.cpp35 void onDraw(SkCanvas* canvas) override { in onDraw() argument
39 canvas->drawPaint(bgPaint); in onDraw()
52 canvas->save(); in onDraw()
53 canvas->translate(0, SkIntToScalar(kLabelOffsetY)); in onDraw()
56 canvas->drawText(offset.c_str(), offset.size(), in onDraw()
60 canvas->restore(); in onDraw()
63 canvas->save(); in onDraw()
64 canvas->translate(SkIntToScalar(kLabelOffsetX), 0); in onDraw()
67 canvas->drawText(offset.c_str(), offset.size(), in onDraw()
71 canvas->restore(); in onDraw()
[all …]
Dimage.cpp19 static void drawJpeg(SkCanvas* canvas, const SkISize& size) { in drawJpeg() argument
29 SkAutoCanvasRestore acr(canvas, true); in drawJpeg()
30 canvas->scale(size.width() * 1.0f / image->width(), in drawJpeg()
32 canvas->drawImage(image, 0, 0, NULL); in drawJpeg()
40 SkCanvas* canvas = surface->getCanvas(); in drawContents() local
49 canvas->drawCircle(size.fWidth/2, size.fHeight/2, radius, paint); in drawContents()
54 canvas->drawCircle(size.fWidth/2, size.fHeight/2, radius, paint); in drawContents()
57 static void test_surface(SkCanvas* canvas, SkSurface* surf, bool usePaint) { in test_surface() argument
79 canvas->drawImage(imgR, 0, 0, usePaint ? &paint : NULL); in test_surface()
80 canvas->drawImage(imgG, 0, 80, usePaint ? &paint : NULL); in test_surface()
[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 …]
Dcubicpaths.cpp26 virtual void onDraw(SkCanvas* canvas) { in onDraw() argument
35 canvas->save(); in onDraw()
37 canvas->save(); in onDraw()
38 canvas->clipRect(bounds); in onDraw()
39 canvas->translate(dx, dy); in onDraw()
40 canvas->drawPath(path, paint); in onDraw()
41 canvas->restore(); in onDraw()
43 canvas->translate(bounds.width(), 0); in onDraw()
45 canvas->restore(); in onDraw()
46 canvas->translate(0, bounds.height()); in onDraw()
[all …]
Dglyph_pos.cpp50 void onDraw(SkCanvas* canvas) override { in onDraw() argument
56 canvas->drawPoint(40.0f, 40.0f, SK_ColorBLACK); in onDraw()
59 canvas->translate(50.0f, 50.0f); in onDraw()
60 drawTestCase(canvas, 1.0f); in onDraw()
62 canvas->translate(0.0f, 50.0f); in onDraw()
63 drawTestCase(canvas, 3.0f); in onDraw()
66 canvas->translate(0.0f, 100.0f); in onDraw()
67 canvas->save(); in onDraw()
68 canvas->scale(3.0f, 3.0f); in onDraw()
69 drawTestCase(canvas, 1.0f); 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 …]
Dbleed.cpp106 void drawCase1(SkCanvas* canvas, int transX, int transY, in drawCase1() argument
116 canvas->save(); in drawCase1()
117 canvas->translate(SkIntToScalar(transX), SkIntToScalar(transY)); in drawCase1()
118 canvas->drawBitmapRectToRect(fBitmapSmall, &src, dst, &paint, flags); in drawCase1()
119 canvas->restore(); in drawCase1()
123 void drawCase2(SkCanvas* canvas, int transX, int transY, in drawCase2() argument
133 canvas->save(); in drawCase2()
134 canvas->translate(SkIntToScalar(transX), SkIntToScalar(transY)); in drawCase2()
135 canvas->drawBitmapRectToRect(fBitmapBig, &src, dst, &paint, flags); in drawCase2()
136 canvas->restore(); in drawCase2()
[all …]
Dfilltypespersp.cpp36 void showPath(SkCanvas* canvas, int x, int y, SkPath::FillType ft, in showPath() argument
40 canvas->save(); in showPath()
41 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); in showPath()
42 canvas->clipRect(r); in showPath()
43 canvas->drawColor(SK_ColorWHITE); in showPath()
45 canvas->translate(r.centerX(), r.centerY()); in showPath()
46 canvas->scale(scale, scale); in showPath()
47 canvas->translate(-r.centerX(), -r.centerY()); in showPath()
48 canvas->drawPath(fPath, paint); in showPath()
49 canvas->restore(); in showPath()
[all …]
Dpictureimagefilter.cpp27 SkCanvas* canvas = recorder.beginRecording(100, 100, NULL, 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 …]
Dpathreverse.cpp13 static void test_path(SkCanvas* canvas, const SkPath& path) { in test_path() argument
16 canvas->drawPath(path, paint); in test_path()
20 canvas->drawPath(path, paint); in test_path()
23 static void test_rev(SkCanvas* canvas, const SkPath& path) { in test_rev() argument
24 test_path(canvas, path); in test_rev()
28 canvas->save(); in test_rev()
29 canvas->translate(150, 0); in test_rev()
30 test_path(canvas, rev); in test_rev()
31 canvas->restore(); in test_rev()
34 static void test_rev(SkCanvas* canvas) { in test_rev() argument
[all …]
Dtechtalk1.cpp57 static void show_mesh(SkCanvas* canvas, const SkRect& r) { in show_mesh() argument
61 canvas->drawRect(r, paint); in show_mesh()
62 canvas->drawLine(r.fLeft, r.fTop, r.fRight, r.fBottom, paint); in show_mesh()
65 static void drawLine(SkCanvas* canvas, const SkPoint& p0, const SkPoint& p1, in drawLine() argument
67 canvas->drawLine(p0.fX, p0.fY, p1.fX, p1.fY, paint); in drawLine()
70 static void show_mesh(SkCanvas* canvas, const SkPoint pts[], in show_mesh() argument
76 drawLine(canvas, pts[indices[i]], pts[indices[i+1]], paint); in show_mesh()
77 drawLine(canvas, pts[indices[i+1]], pts[indices[i+2]], paint); in show_mesh()
78 drawLine(canvas, pts[indices[i+2]], pts[indices[i]], paint); in show_mesh()
82 static void show_glframe(SkCanvas* canvas, const SkPath& path) { in show_glframe() argument
[all …]
Dfilltypes.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 …]
/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 …]
DSamplePicture.cpp48 static void drawCircle(SkCanvas* canvas, int r, SkColor color) { in drawCircle() argument
53 canvas->drawCircle(SkIntToScalar(r), SkIntToScalar(r), SkIntToScalar(r), in drawCircle()
69 SkCanvas* canvas = recorder.beginRecording(100, 100, NULL, 0); in PictureView() local
73 canvas->drawBitmap(fBitmap, 0, 0, NULL); in PictureView()
75 drawCircle(canvas, 50, SK_ColorBLACK); in PictureView()
76 canvas->drawPicture(fSubPicture); in PictureView()
77 canvas->translate(SkIntToScalar(50), 0); in PictureView()
78 canvas->drawPicture(fSubPicture); in PictureView()
79 canvas->translate(0, SkIntToScalar(50)); in PictureView()
80 canvas->drawPicture(fSubPicture); in PictureView()
[all …]
DSampleClock.cpp33 void onDrawContent(SkCanvas* canvas) override { in onDrawContent() argument
38 canvas->save(); in onDrawContent()
39 canvas->translate(150, 150); in onDrawContent()
40 canvas->scale(0.4f, 0.4f); in onDrawContent()
41 canvas->rotate(-180.f/2.f); in onDrawContent()
59 canvas->save(); in onDrawContent()
61 canvas->rotate(180.f/6.f); in onDrawContent()
66 canvas->drawPath(path, paintStroke); in onDrawContent()
68 canvas->drawRRect(rrect, paintFill); in onDrawContent()
71 canvas->restore(); in onDrawContent()
[all …]
/external/skia/tools/
Dfiltermain.cpp51 static bool check_0(SkDebugCanvas* canvas, int curCommand) { in check_0() argument
52 if (SkDrawCommand::kSaveLayer_OpType != canvas->getDrawCommandAt(curCommand)->getType() || in check_0()
53 canvas->getSize() <= curCommand+2 || in check_0()
54 … SkDrawCommand::kDrawBitmapRect_OpType != canvas->getDrawCommandAt(curCommand+1)->getType() || in check_0()
55 SkDrawCommand::kRestore_OpType != canvas->getDrawCommandAt(curCommand+2)->getType()) { in check_0()
60 (SkSaveLayerCommand*) canvas->getDrawCommandAt(curCommand); in check_0()
62 (SkDrawBitmapRectCommand*) canvas->getDrawCommandAt(curCommand+1); in check_0()
81 static void apply_0(SkDebugCanvas* canvas, int curCommand) { in apply_0() argument
83 (SkSaveLayerCommand*) canvas->getDrawCommandAt(curCommand); in apply_0()
89 (SkDrawBitmapRectCommand*) canvas->getDrawCommandAt(curCommand+1); in apply_0()
[all …]
/external/skia/tests/
DDeferredCanvasTest.cpp44 SkCanvas canvas(bitmap); in read_pixel() local
48 surface->draw(&canvas, -SkIntToScalar(x), -SkIntToScalar(y), &paint); in read_pixel()
97 SkAutoTUnref<SkDeferredCanvas> canvas(SkDeferredCanvas::Create(surface.get())); in TestDeferredCanvasWritePixelsToSurface() local
108 canvas->clear(SK_ColorWHITE); in TestDeferredCanvasWritePixelsToSurface()
114 canvas->flush(); in TestDeferredCanvasWritePixelsToSurface()
122 SkAutoTUnref<SkImage> image1(canvas->newImageSnapshot()); in TestDeferredCanvasWritePixelsToSurface()
128 canvas->clear(SK_ColorWHITE); in TestDeferredCanvasWritePixelsToSurface()
134 canvas->flush(); in TestDeferredCanvasWritePixelsToSurface()
141 SkAutoTUnref<SkImage> image2(canvas->newImageSnapshot()); in TestDeferredCanvasWritePixelsToSurface()
148 SkAutoTUnref<SkImage> image3(canvas->newImageSnapshot()); in TestDeferredCanvasWritePixelsToSurface()
[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 …]
DCanvasTest.cpp208 static void test_clipVisitor(skiatest::Reporter* reporter, SkCanvas* canvas) { in test_clipVisitor() argument
209 SkISize size = canvas->getDeviceSize(); in test_clipVisitor()
216 canvas->replayClips(&visitor); in test_clipVisitor()
218 REPORTER_ASSERT(reporter, equal_clips(c, *canvas)); in test_clipVisitor()
226 SkCanvas canvas(10, 10); in test_clipstack() local
227 cs = SkRef(canvas.getClipStack()); in test_clipstack()
301 virtual void draw(SkCanvas* canvas, const TestData& d, \
303 FUNCTION (canvas, d, reporter, this); \
313 virtual void draw(SkCanvas* canvas, const TestData& d, \
315 FUNCTION (canvas, d, reporter, this); \
[all …]
/external/skia/src/utils/debugger/
DSkDrawCommand.cpp79 void SkClearCommand::execute(SkCanvas* canvas) const { in execute()
80 canvas->clear(fColor); in execute()
85 void xlate_and_scale_to_bounds(SkCanvas* canvas, const SkRect& bounds) { in xlate_and_scale_to_bounds() argument
86 const SkISize& size = canvas->getDeviceSize(); in xlate_and_scale_to_bounds()
90 canvas->translate(size.fWidth/2.0f, size.fHeight/2.0f); in xlate_and_scale_to_bounds()
92 canvas->scale(SkDoubleToScalar((kInsetFrac*size.fWidth)/bounds.width()), in xlate_and_scale_to_bounds()
95 canvas->scale(SkDoubleToScalar((kInsetFrac*size.fWidth)/bounds.height()), in xlate_and_scale_to_bounds()
98 canvas->translate(-bounds.centerX(), -bounds.centerY()); in xlate_and_scale_to_bounds()
102 void render_path(SkCanvas* canvas, const SkPath& path) { in render_path() argument
103 canvas->clear(0xFFFFFFFF); in render_path()
[all …]

12345678910>>...29