Home
last modified time | relevance | path

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

12345678910>>...36

/external/skia/gm/
Dconcavepaths.cpp14 void test_concave(SkCanvas* canvas, const SkPaint& paint) { in test_concave() argument
16 canvas->translate(0, 0); in test_concave()
21 canvas->drawPath(path, paint); in test_concave()
25 void test_reverse_concave(SkCanvas* canvas, const SkPaint& paint) { in test_reverse_concave() argument
27 canvas->save(); in test_reverse_concave()
28 canvas->translate(100, 0); in test_reverse_concave()
33 canvas->drawPath(path, paint); in test_reverse_concave()
34 canvas->restore(); in test_reverse_concave()
38 void test_bowtie(SkCanvas* canvas, const SkPaint& paint) { in test_bowtie() argument
40 canvas->save(); in test_bowtie()
[all …]
Dtextblobtransforms.cpp64 void onDraw(SkCanvas* canvas) override { in onDraw() argument
66 canvas->drawColor(sk_tool_utils::color_to_565(SK_ColorGRAY)); in onDraw()
71 canvas->translate(20, 20); in onDraw()
81 canvas->translate(xOffset, 2 * yOffset); in onDraw()
82 canvas->drawTextBlob(fBlob, 0, 0, paint); in onDraw()
83 canvas->translate(-xOffset, 0); in onDraw()
84 canvas->drawTextBlob(fBlob, 0, 0, paint); in onDraw()
85 canvas->translate(2 * xOffset, 0); in onDraw()
86 canvas->drawTextBlob(fBlob, 0, 0, paint); in onDraw()
87 canvas->translate(-xOffset, -yOffset); in onDraw()
[all …]
Dthinconcavepaths.cpp14 void draw_thin_stroked_rect(SkCanvas* canvas, const SkPaint& paint, SkScalar width) { in draw_thin_stroked_rect() argument
24 canvas->drawPath(path, paint); in draw_thin_stroked_rect()
27 void draw_thin_right_angle(SkCanvas* canvas, const SkPaint& paint, SkScalar width) { in draw_thin_right_angle() argument
35 canvas->drawPath(path, paint); in draw_thin_right_angle()
39 void draw_golf_club(SkCanvas* canvas, const SkPaint& paint, SkScalar width) { in draw_golf_club() argument
47 canvas->drawPath(path, paint); in draw_golf_club()
52 void draw_barbell(SkCanvas* canvas, const SkPaint& paint, SkScalar width) { in draw_barbell() argument
63 canvas->drawPath(path, paint); in draw_barbell()
68 void draw_thin_rect_and_triangle(SkCanvas* canvas, const SkPaint& paint, SkScalar width) { in draw_thin_rect_and_triangle() argument
77 canvas->drawPath(path, paint); in draw_thin_rect_and_triangle()
[all …]
Daaclip.cpp14 static void do_draw(SkCanvas* canvas, const SkRect& r) { in do_draw() argument
18 canvas->drawRect(r, paint); in do_draw()
47 DEF_SIMPLE_GM(dont_clip_to_layer, canvas, 120, 120) {
52 canvas->saveLayer(&r, nullptr);
53 canvas->drawColor(SK_ColorRED);
63 canvas->saveLayer(rec);
65 canvas->saveLayer(rec);
66 do_draw(canvas, r);
67 canvas->restore();
68 canvas->restore();
[all …]
Dperlinnoise.cpp37 void drawRect(SkCanvas* canvas, int x, int y, const SkPaint& paint, const SkISize& size) { in drawRect() argument
38 canvas->save(); in drawRect()
39 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); in drawRect()
42 canvas->drawRect(r, paint); in drawRect()
43 canvas->restore(); in drawRect()
46 void test(SkCanvas* canvas, int x, int y, Type type, in test() argument
58 drawRect(canvas, x, y, paint, tileSize); in test()
60 drawRect(canvas, x, y, paint, tileSize); in test()
62 drawRect(canvas, x, y, paint, tileSize); in test()
64 drawRect(canvas, x, y, paint, tileSize); in test()
[all …]
Ddashing.cpp14 static void drawline(SkCanvas* canvas, int on, int off, const SkPaint& paint, in drawline() argument
26 canvas->drawLine(startX, startY, finalX, finalY, p); in drawline()
32 static void show_giant_dash(SkCanvas* canvas) { in show_giant_dash() argument
35 drawline(canvas, 1, 1, paint, SkIntToScalar(20 * 1000)); in show_giant_dash()
38 static void show_zero_len_dash(SkCanvas* canvas) { in show_zero_len_dash() argument
41 drawline(canvas, 2, 2, paint, SkIntToScalar(0)); in show_zero_len_dash()
44 canvas->translate(0, SkIntToScalar(20)); in show_zero_len_dash()
45 drawline(canvas, 4, 4, paint, SkIntToScalar(0)); in show_zero_len_dash()
60 virtual void onDraw(SkCanvas* canvas) { in onDraw() argument
72 canvas->translate(SkIntToScalar(20), SkIntToScalar(20)); in onDraw()
[all …]
Dcubicpaths.cpp29 virtual void onDraw(SkCanvas* canvas) { in onDraw() argument
38 canvas->save(); in onDraw()
40 canvas->save(); in onDraw()
41 canvas->clipRect(bounds); in onDraw()
42 canvas->translate(dx, dy); in onDraw()
43 canvas->drawPath(path, paint); in onDraw()
44 canvas->restore(); in onDraw()
46 canvas->translate(bounds.width(), 0); in onDraw()
48 canvas->restore(); in onDraw()
49 canvas->translate(0, bounds.height()); in onDraw()
[all …]
Dimagefilters.cpp22 static void do_draw(SkCanvas* canvas, SkBlendMode mode, sk_sp<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);
60 canvas->save();
[all …]
Dperspshaders.cpp21 SkCanvas* canvas = surface->getCanvas(); in make_image() local
23 sk_tool_utils::draw_checkerboard(canvas, SK_ColorRED, SK_ColorGREEN, w/10); in make_image()
81 void drawRow(SkCanvas* canvas, SkFilterQuality filterQ) { in drawRow() argument
100 canvas->save(); in drawRow()
102 canvas->save(); in drawRow()
103 canvas->concat(fPerspMatrix); in drawRow()
104 canvas->drawBitmapRect(fBitmap, r, &filterPaint); in drawRow()
105 canvas->restore(); in drawRow()
107 canvas->translate(SkIntToScalar(kCellSize), 0); in drawRow()
108 canvas->save(); in drawRow()
[all …]
DOverStroke.cpp110 void draw_ribs(SkCanvas *canvas, SkPath path) { in draw_ribs() argument
117 canvas->drawPath(ribs, p); in draw_ribs()
122 void draw_small_quad(SkCanvas *canvas) { in draw_small_quad() argument
129 draw_ribs(canvas, path); in draw_small_quad()
130 canvas->drawPath(path, p); in draw_small_quad()
133 void draw_large_quad(SkCanvas *canvas) { in draw_large_quad() argument
137 canvas->drawPath(path, p); in draw_large_quad()
138 draw_ribs(canvas, path); in draw_large_quad()
141 void draw_quad_fillpath(SkCanvas *canvas) { in draw_quad_fillpath() argument
151 canvas->drawPath(fillpath, fillp); in draw_quad_fillpath()
[all …]
Daaxfermodes.cpp94 void draw_pass(SkCanvas* canvas, DrawingPass drawingPass) { in draw_pass() argument
98 canvas->save(); in draw_pass()
100 canvas->translate(kMargin, kMargin); in draw_pass()
102 canvas->translate(0, kTitleSpacing); in draw_pass()
106 canvas->save(); in draw_pass()
110 canvas->drawString("Src Unknown", in draw_pass()
113 canvas->drawString("Src Opaque", in draw_pass()
119 canvas->translate(0, kSubtitleSpacing + kShapeSpacing/2); in draw_pass()
126 canvas->save(); in draw_pass()
129 this->drawModeName(canvas, mode); in draw_pass()
[all …]
Ddeferredtextureimage.cpp19 static void DrawDeferredTextureImageData(SkCanvas* canvas, in DrawDeferredTextureImageData() argument
23 GrContext* context = canvas->getGrContext(); in DrawDeferredTextureImageData()
25 skiagm::GM::DrawGpuOnlyMessage(canvas); in DrawDeferredTextureImageData()
39 *proxy, params, 1, nullptr, canvas->imageInfo().colorSpace(), dstColorType); in DrawDeferredTextureImageData()
48 *proxy, params, 1, memory.data(), canvas->imageInfo().colorSpace(), dstColorType); in DrawDeferredTextureImageData()
52 canvas->drawImage(uploadedEncodedImage, 10, 10); in DrawDeferredTextureImageData()
64 *proxy, params, 1, nullptr, canvas->imageInfo().colorSpace(), dstColorType); in DrawDeferredTextureImageData()
72 *proxy, params, 1, memory.data(), canvas->imageInfo().colorSpace(), dstColorType); in DrawDeferredTextureImageData()
76 canvas->drawImage(uploadedDecodedImage, encodedImage->width() + 20, 10); in DrawDeferredTextureImageData()
79 static void DrawDeferredTextureImageMipMapTree(SkCanvas* canvas, SkImage* image, in DrawDeferredTextureImageMipMapTree() argument
[all …]
Dcomplexclip4.cpp34 virtual void onDraw(SkCanvas* canvas) { in onDraw() argument
39 canvas->save(); in onDraw()
41 canvas->save(); in onDraw()
42canvas->androidFramework_setDeviceClipRestriction(SkIRect::MakeLTRB(100, 100, 300, 300)); in onDraw()
43 canvas->drawColor(SK_ColorGREEN); in onDraw()
44 canvas->clipRect(SkRect::MakeLTRB(100, 200, 400, 500), in onDraw()
46 canvas->drawRect(SkRect::MakeLTRB(100, 200, 400, 500), p); in onDraw()
47 canvas->restore(); in onDraw()
50 canvas->save(); in onDraw()
51canvas->androidFramework_setDeviceClipRestriction(SkIRect::MakeLTRB(500, 100, 800, 300)); in onDraw()
[all …]
Dglyph_pos.cpp21 static void drawTestCase(SkCanvas* canvas,
26 static void draw_gm(SkCanvas* canvas, in draw_gm() argument
30 canvas->drawPoint(40, 40, SkPaint()); in draw_gm()
33 canvas->translate(50.0f, 50.0f); in draw_gm()
34 drawTestCase(canvas, 1.0f, strokeWidth, strokeStyle); in draw_gm()
36 canvas->translate(0.0f, 50.0f); in draw_gm()
37 drawTestCase(canvas, 3.0f, strokeWidth, strokeStyle); in draw_gm()
40 canvas->translate(0.0f, 100.0f); in draw_gm()
41 canvas->save(); in draw_gm()
42 canvas->scale(3.0f, 3.0f); in draw_gm()
[all …]
Drecordopts.cpp55 static void draw_save_layer_draw_rect_restore_sequence(SkCanvas* canvas, SkColor shapeColor, in draw_save_layer_draw_rect_restore_sequence() argument
60 canvas->saveLayer(&targetRect, &layerPaint); in draw_save_layer_draw_rect_restore_sequence()
64 canvas->drawRect(targetRect, drawPaint); in draw_save_layer_draw_rect_restore_sequence()
65 canvas->restore(); in draw_save_layer_draw_rect_restore_sequence()
70 static void draw_save_layer_draw_bitmap_restore_sequence(SkCanvas* canvas, SkColor shapeColor, in draw_save_layer_draw_bitmap_restore_sequence() argument
77 SkCanvas canvas(bitmap); in draw_save_layer_draw_bitmap_restore_sequence() local
81 canvas.drawRect(SkRect::MakeWH(SkIntToScalar(7), SkIntToScalar(7)), p); in draw_save_layer_draw_bitmap_restore_sequence()
82 canvas.flush(); in draw_save_layer_draw_bitmap_restore_sequence()
88 canvas->saveLayer(&targetRect, &layerPaint); in draw_save_layer_draw_bitmap_restore_sequence()
91 canvas->drawBitmap(bitmap, SkIntToScalar(0), SkIntToScalar(0), &drawPaint); in draw_save_layer_draw_bitmap_restore_sequence()
[all …]
Doffsetimagefilter.cpp45 void onDraw(SkCanvas* canvas) override { in onDraw() argument
46 canvas->clear(SK_ColorBLACK); in onDraw()
60 DrawClippedImage(canvas, image.get(), paint, 1, cropRect); in onDraw()
61 canvas->translate(SkIntToScalar(image->width() + MARGIN), 0); in onDraw()
67 DrawClippedImage(canvas, fBitmap.get(), paint, 2, cropRect); in onDraw()
70 static void DrawClippedImage(SkCanvas* canvas, const SkImage* image, const SkPaint& paint, in DrawClippedImage() argument
74 canvas->save(); in DrawClippedImage()
75 canvas->clipRect(clipRect); in DrawClippedImage()
76 canvas->scale(scale, scale); in DrawClippedImage()
77 canvas->drawImage(image, 0, 0, &paint); in DrawClippedImage()
[all …]
Dpictureimagefilter.cpp16 static void fill_rect_filtered(SkCanvas* canvas, in fill_rect_filtered() argument
21 canvas->save(); in fill_rect_filtered()
22 canvas->clipRect(clipRect); in fill_rect_filtered()
23 canvas->drawPaint(paint); in fill_rect_filtered()
24 canvas->restore(); in fill_rect_filtered()
29 SkCanvas* canvas = recorder.beginRecording(100, 100, nullptr, 0); in make_picture() local
36 canvas->drawString(str, SkIntToScalar(20), SkIntToScalar(70), paint); in make_picture()
43 SkCanvas* canvas = recorder.beginRecording(100, 100, nullptr, 0); in make_LCD_picture() local
44 canvas->clear(SK_ColorTRANSPARENT); in make_LCD_picture()
53 canvas->drawString(str, SkIntToScalar(20), SkIntToScalar(70), paint); in make_LCD_picture()
[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 …]
Dimage.cpp22 static void drawJpeg(SkCanvas* canvas, const SkISize& size) { in drawJpeg() argument
32 SkAutoCanvasRestore acr(canvas, true); in drawJpeg()
33 canvas->scale(size.width() * 1.0f / image->width(), in drawJpeg()
35 canvas->drawImage(image, 0, 0, nullptr); in drawJpeg()
42 SkCanvas* canvas = surface->getCanvas(); in drawContents() local
51 canvas->drawCircle(size.fWidth/2, size.fHeight/2, radius, paint); in drawContents()
56 canvas->drawCircle(size.fWidth/2, size.fHeight/2, radius, paint); in drawContents()
59 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 …]
/external/skia/tests/
DCanvasTest.cpp72 SkCanvas canvas(10, 10); in DEF_TEST() local
76 irect = canvas.getDeviceClipBounds(); in DEF_TEST()
78 REPORTER_ASSERT(reporter, canvas.getDeviceClipBounds(&irect2)); in DEF_TEST()
82 rect = canvas.getLocalClipBounds(); in DEF_TEST()
84 REPORTER_ASSERT(reporter, canvas.getLocalClipBounds(&rect2)); in DEF_TEST()
87 canvas.clipRect(SkRect::MakeEmpty()); in DEF_TEST()
89 irect = canvas.getDeviceClipBounds(); in DEF_TEST()
91 REPORTER_ASSERT(reporter, !canvas.getDeviceClipBounds(&irect2)); in DEF_TEST()
94 rect = canvas.getLocalClipBounds(); in DEF_TEST()
96 REPORTER_ASSERT(reporter, !canvas.getLocalClipBounds(&rect2)); in DEF_TEST()
[all …]
DPictureTest.cpp65 SkCanvas* canvas = recorder.beginRecording(100, 100); in test_analysis() local
67 canvas->drawRect(SkRect::MakeWH(10, 10), SkPaint ()); in test_analysis()
72 canvas = recorder.beginRecording(100, 100); in test_analysis()
85 canvas->drawRect(SkRect::MakeWH(10, 10), paint); in test_analysis()
114 static void rand_op(SkCanvas* canvas, SkRandom& rand) { in rand_op() argument
121 canvas->save(); in rand_op()
124 canvas->restore(); in rand_op()
127 canvas->clipRect(rect); in rand_op()
130 canvas->drawPaint(paint); in rand_op()
158 SkCanvas* canvas = recorder.beginRecording(100, 100); in test_gpu_veto() local
[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 …]
/external/skia/samplecode/
DSampleAARects.cpp18 SkCanvas canvas(bitmap); in createBitmap() local
25 canvas.drawOval(r, paint); in createBitmap()
29 canvas.drawLine(0, 0, r.fRight, r.fBottom, paint); in createBitmap()
30 canvas.drawLine(0, r.fBottom, r.fRight, 0, paint); in createBitmap()
57 virtual void onDrawContent(SkCanvas* canvas) { in onDrawContent() argument
58 canvas->translate(SkIntToScalar(10), SkIntToScalar(10)); in onDrawContent()
82 canvas->save(); in onDrawContent()
87 canvas->drawRect(rect, paints[p]); in onDrawContent()
88 canvas->translate(dx, 0); in onDrawContent()
94 canvas->drawRect(rect, paints[p]); in onDrawContent()
[all …]
DSampleShadowReference.cpp79 void drawBG(SkCanvas* canvas) { in drawBG() argument
80 canvas->drawColor(0xFFFFFFFF); in drawBG()
81 canvas->drawImage(fReferenceImage, 10, 30); in drawBG()
84 void drawShadowedPath(SkCanvas* canvas, const SkPath& path, in drawShadowedPath() argument
98 SkShadowUtils::DrawShadow(canvas, path, zPlaneParams, in drawShadowedPath()
103 canvas->drawPath(path, paint); in drawShadowedPath()
110 canvas->drawPath(path, strokePaint); in drawShadowedPath()
114 void onDrawContent(SkCanvas* canvas) override { in onDrawContent() argument
115 this->drawBG(canvas); in onDrawContent()
134 canvas->save(); in onDrawContent()
[all …]
/external/python/cpython2/Lib/lib-tk/
DCanvas.py14 def __init__(self, canvas, itemType, *args, **kw): argument
15 self.canvas = canvas
16 self.id = canvas._create(itemType, args, kw)
17 if not hasattr(canvas, 'items'):
18 canvas.items = {}
19 canvas.items[self.id] = self
25 del self.canvas.items[self.id]
26 self.canvas.delete(self.id)
28 v = self.canvas.tk.split(self.canvas.tk.call(
29 self.canvas._w, 'itemconfigure',
[all …]

12345678910>>...36