/third_party/skia/gm/ |
D | runtimeintrinsics.cpp | 31 static void next_column(SkCanvas* canvas) { in next_column() argument 32 canvas->translate(kBoxSize + kPadding, 0); in next_column() 35 static void next_row(SkCanvas* canvas) { in next_row() argument 36 canvas->restore(); in next_row() 37 canvas->translate(0, kBoxSize + kPadding + kLabelHeight); in next_row() 38 canvas->save(); in next_row() 49 static void draw_label(SkCanvas* canvas, const char* label) { in draw_label() argument 55 canvas->drawSimpleText(label, strlen(label), SkTextEncoding::kUTF8, in draw_label() 58 canvas->translate(0, kLabelHeight); in draw_label() 61 static SkBitmap draw_shader(SkCanvas* canvas, sk_sp<SkShader> shader, in draw_shader() argument [all …]
|
D | concavepaths.cpp | 16 void test_concave(SkCanvas* canvas, const SkPaint& paint) { in test_concave() argument 17 canvas->translate(0, 0); in test_concave() 18 canvas->drawPath(SkPath::Polygon({{20,20}, {80,20}, {30,30}, {20,80}}, false), paint); in test_concave() 22 void test_reverse_concave(SkCanvas* canvas, const SkPaint& paint) { in test_reverse_concave() argument 23 canvas->save(); in test_reverse_concave() 24 canvas->translate(100, 0); in test_reverse_concave() 25 canvas->drawPath(SkPath::Polygon({{20,20}, {20,80}, {30,30}, {80,20}}, false), paint); in test_reverse_concave() 26 canvas->restore(); in test_reverse_concave() 30 void test_bowtie(SkCanvas* canvas, const SkPaint& paint) { in test_bowtie() argument 31 canvas->save(); in test_bowtie() [all …]
|
D | textblobtransforms.cpp | 70 void onDraw(SkCanvas* canvas) override { in onDraw() argument 72 canvas->drawColor(SK_ColorGRAY); in onDraw() 77 canvas->translate(20, 20); in onDraw() 87 canvas->translate(xOffset, 2 * yOffset); in onDraw() 88 canvas->drawTextBlob(fBlob, 0, 0, paint); in onDraw() 89 canvas->translate(-xOffset, 0); in onDraw() 90 canvas->drawTextBlob(fBlob, 0, 0, paint); in onDraw() 91 canvas->translate(2 * xOffset, 0); in onDraw() 92 canvas->drawTextBlob(fBlob, 0, 0, paint); in onDraw() 93 canvas->translate(-xOffset, -yOffset); in onDraw() [all …]
|
D | p3.cpp | 52 SkCanvas* canvas, int x, int y, in compare_pixel() argument 56 auto canvas_cs = canvas->imageInfo().refColorSpace(); in compare_pixel() 61 const SkMatrix& m = canvas->getTotalMatrix(); in compare_pixel() 69 if (!canvas->readPixels(bm, x,y)) { in compare_pixel() 70 MarkGMGood(canvas, 140,40); in compare_pixel() 71 canvas->drawString("can't readPixels() on this canvas :(", 100,20, font, paint); in compare_pixel() 79 if (SkColorTypeIsNormalized(canvas->imageInfo().colorType())) { in compare_pixel() 85 if (canvas->imageInfo().colorType() == kGray_8_SkColorType) { in compare_pixel() 92 MarkGMGood(canvas, 140,40); in compare_pixel() 94 MarkGMBad(canvas, 140,40); in compare_pixel() [all …]
|
D | thinconcavepaths.cpp | 16 void draw_thin_stroked_rect(SkCanvas* canvas, const SkPaint& paint, SkScalar width) { in draw_thin_stroked_rect() argument 26 canvas->drawPath(path, paint); in draw_thin_stroked_rect() 29 void draw_thin_right_angle(SkCanvas* canvas, const SkPaint& paint, SkScalar width) { in draw_thin_right_angle() argument 37 canvas->drawPath(path, paint); in draw_thin_right_angle() 41 void draw_golf_club(SkCanvas* canvas, const SkPaint& paint, SkScalar width) { in draw_golf_club() argument 49 canvas->drawPath(path, paint); in draw_golf_club() 54 void draw_barbell(SkCanvas* canvas, const SkPaint& paint, SkScalar width) { in draw_barbell() argument 65 canvas->drawPath(path, paint); in draw_barbell() 70 void draw_thin_rect_and_triangle(SkCanvas* canvas, const SkPaint& paint, SkScalar width) { in draw_thin_rect_and_triangle() argument 79 canvas->drawPath(path, paint); in draw_thin_rect_and_triangle() [all …]
|
D | complexclip.cpp | 56 void onDraw(SkCanvas* canvas) override { in onDraw() argument 96 canvas->translate(20, 20); in onDraw() 97 canvas->scale(3 * SK_Scalar1 / 4, 3 * SK_Scalar1 / 4); in onDraw() 113 canvas->drawRect(bounds, boundPaint); in onDraw() 114 canvas->clipRect(bounds); in onDraw() 115 canvas->saveLayer(&bounds, nullptr); in onDraw() 119 canvas->save(); in onDraw() 121 this->drawHairlines(canvas, path, clipA, clipB); in onDraw() 125 canvas->save(); in onDraw() 131 canvas->clipPath(clipA, fDoAAClip); in onDraw() [all …]
|
D | complexclip4.cpp | 43 void emulateDeviceRestriction(SkCanvas* canvas, const SkIRect& deviceRestriction) { in emulateDeviceRestriction() argument 46 canvas->androidFramework_setDeviceClipRestriction(deviceRestriction); in emulateDeviceRestriction() 49 void emulateClipRectReplace(SkCanvas* canvas, in emulateClipRectReplace() argument 52 SkCanvasPriv::ResetClip(canvas); in emulateClipRectReplace() 53 canvas->clipRect(clipRect, SkClipOp::kIntersect, aa); in emulateClipRectReplace() 56 void emulateClipRRectReplace(SkCanvas* canvas, in emulateClipRRectReplace() argument 59 SkCanvasPriv::ResetClip(canvas); in emulateClipRRectReplace() 60 canvas->clipRRect(clipRRect, SkClipOp::kIntersect, aa); in emulateClipRRectReplace() 63 void emulateClipPathReplace(SkCanvas* canvas, in emulateClipPathReplace() argument 66 SkCanvasPriv::ResetClip(canvas); in emulateClipPathReplace() [all …]
|
D | aaclip.cpp | 27 static void draw(SkCanvas* canvas, SkRect& target, int x, int y) { in draw() argument 38 canvas->save(); in draw() 39 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); in draw() 41 canvas->drawRect(target, borderPaint); in draw() 43 canvas->drawRect(target, backgroundPaint); in draw() 44 canvas->clipRect(target, true); in draw() 46 canvas->drawRect(target, foregroundPaint); in draw() 47 canvas->restore(); in draw() 50 static void draw_square(SkCanvas* canvas, int x, int y) { in draw_square() argument 52 draw(canvas, target, x, y); in draw_square() [all …]
|
D | cubicpaths.cpp | 32 void onDraw(SkCanvas* canvas) override { in onDraw() argument 41 canvas->save(); in onDraw() 43 canvas->save(); in onDraw() 44 canvas->clipRect(bounds); in onDraw() 45 canvas->translate(dx, dy); in onDraw() 46 canvas->drawPath(path, paint); in onDraw() 47 canvas->restore(); in onDraw() 49 canvas->translate(bounds.width(), 0); in onDraw() 51 canvas->restore(); in onDraw() 52 canvas->translate(0, bounds.height()); in onDraw() [all …]
|
D | imagefilters.cpp | 43 static void do_draw(SkCanvas* canvas, SkBlendMode mode, sk_sp<SkImageFilter> imf) { in do_draw() argument 44 SkAutoCanvasRestore acr(canvas, true); in do_draw() 45 canvas->clipRect(SkRect::MakeWH(220, 220)); in do_draw() 50 canvas->saveLayer(nullptr, nullptr); in do_draw() 51 canvas->drawColor(SK_ColorGREEN); in do_draw() 60 canvas->drawOval(r0, paint); in do_draw() 65 canvas->drawOval(r1, paint); in do_draw() 68 DEF_SIMPLE_GM(imagefilters_xfermodes, canvas, 480, 480) { 69 canvas->translate(10, 10); 81 canvas->save(); [all …]
|
D | perlinnoise.cpp | 39 void drawRect(SkCanvas* canvas, int x, int y, const SkPaint& paint, const SkISize& size) { in drawRect() argument 40 canvas->save(); in drawRect() 41 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); in drawRect() 44 canvas->drawRect(r, paint); in drawRect() 45 canvas->restore(); in drawRect() 48 void test(SkCanvas* canvas, int x, int y, Type type, in test() argument 72 drawRect(canvas, x, y, paint, tileSize); in test() 74 drawRect(canvas, x, y, paint, tileSize); in test() 76 drawRect(canvas, x, y, paint, tileSize); in test() 78 drawRect(canvas, x, y, paint, tileSize); in test() [all …]
|
D | dashing.cpp | 29 static void drawline(SkCanvas* canvas, int on, int off, const SkPaint& paint, in drawline() argument 41 canvas->drawLine(startX, startY, finalX, finalY, p); in drawline() 47 static void show_giant_dash(SkCanvas* canvas) { in show_giant_dash() argument 50 drawline(canvas, 1, 1, paint, SkIntToScalar(20 * 1000)); in show_giant_dash() 53 static void show_zero_len_dash(SkCanvas* canvas) { in show_zero_len_dash() argument 56 drawline(canvas, 2, 2, paint, SkIntToScalar(0)); in show_zero_len_dash() 59 canvas->translate(0, SkIntToScalar(20)); in show_zero_len_dash() 60 drawline(canvas, 4, 4, paint, SkIntToScalar(0)); in show_zero_len_dash() 68 void onDraw(SkCanvas* canvas) override { in onDraw() argument 77 canvas->translate(SkIntToScalar(20), SkIntToScalar(20)); in onDraw() [all …]
|
D | aaa.cpp | 21 DEF_SIMPLE_GM(analytic_antialias_convex, canvas, W, H) { in DEF_SIMPLE_GM() argument 26 canvas->clear(0xFFFFFFFF); in DEF_SIMPLE_GM() 28 canvas->save(); in DEF_SIMPLE_GM() 32 canvas->translate(0, y); in DEF_SIMPLE_GM() 33 canvas->rotate(1); in DEF_SIMPLE_GM() 34 canvas->drawRect({ 20, 20, 200, 200 }, p); in DEF_SIMPLE_GM() 35 canvas->restore(); in DEF_SIMPLE_GM() 39 canvas->save(); in DEF_SIMPLE_GM() 40 canvas->translate(0, y); in DEF_SIMPLE_GM() 41 canvas->rotate(1); in DEF_SIMPLE_GM() [all …]
|
D | savelayer.cpp | 49 DEF_SIMPLE_GM(savelayer_initfromprev, canvas, 256, 256) { 50 canvas->drawImage(GetResourceAsImage("images/mandrill_256.png"), 0, 0); 57 canvas->saveLayer(rec); 59 canvas->drawCircle(128, 128, 96, paint); 60 canvas->restore(); 63 DEF_SIMPLE_GM(savelayer_coverage, canvas, 500, 500) { 64 canvas->saveLayer(nullptr, nullptr); 72 auto proc = [layerPaint](SkCanvas* canvas, SkCanvas::SaveLayerRec& rec) { in __anon572f263a0102() argument 76 canvas->saveLayer(rec); in __anon572f263a0102() 77 canvas->drawCircle(100, 100, 50, paint); in __anon572f263a0102() [all …]
|
D | shadowutils.cpp | 27 void draw_shadow(SkCanvas* canvas, const SkPath& path, SkScalar height, SkColor color, in draw_shadow() argument 35 SkShadowUtils::DrawShadow(canvas, path, SkPoint3{ 0, 0, height}, lightPos, lightR, in draw_shadow() 48 void draw_paths(SkCanvas* canvas, ShadowMode mode) { in draw_paths() argument 85 SkPoint lightXY = canvas->getTotalMatrix().mapXY(250, 400); in draw_paths() 88 canvas->translate(3 * kPad, 3 * kPad); in draw_paths() 89 canvas->save(); in draw_paths() 104 canvas->restore(); in draw_paths() 105 canvas->translate(0, dy); in draw_paths() 106 canvas->save(); in draw_paths() 111 canvas->save(); in draw_paths() [all …]
|
D | perspshaders.cpp | 33 SkCanvas* canvas = surface->getCanvas(); in make_image() local 35 ToolUtils::draw_checkerboard(canvas, SK_ColorRED, SK_ColorGREEN, w / 10); in make_image() 90 void drawRow(SkCanvas* canvas, const SkSamplingOptions& sampling) { in drawRow() argument 107 canvas->save(); in drawRow() 109 canvas->save(); in drawRow() 110 canvas->concat(fPerspMatrix); in drawRow() 111 canvas->drawImageRect(fBitmapImage, r, sampling, &filterPaint); in drawRow() 112 canvas->restore(); in drawRow() 114 canvas->translate(SkIntToScalar(kCellSize), 0); in drawRow() 115 canvas->save(); in drawRow() [all …]
|
D | overstroke.cpp | 107 void draw_ribs(SkCanvas *canvas, SkPath path) { in draw_ribs() argument 114 canvas->drawPath(ribs, p); in draw_ribs() 119 void draw_small_quad(SkCanvas *canvas) { in draw_small_quad() argument 126 draw_ribs(canvas, path); in draw_small_quad() 127 canvas->drawPath(path, p); in draw_small_quad() 130 void draw_large_quad(SkCanvas *canvas) { in draw_large_quad() argument 134 canvas->drawPath(path, p); in draw_large_quad() 135 draw_ribs(canvas, path); in draw_large_quad() 138 void draw_quad_fillpath(SkCanvas *canvas) { in draw_quad_fillpath() argument 148 canvas->drawPath(fillpath, fillp); in draw_quad_fillpath() [all …]
|
D | aaxfermodes.cpp | 106 void draw_pass(SkCanvas* canvas, DrawingPass drawingPass) { in draw_pass() argument 110 canvas->save(); in draw_pass() 112 canvas->translate(kMargin, kMargin); in draw_pass() 114 canvas->translate(0, kTitleSpacing); in draw_pass() 118 canvas->save(); in draw_pass() 121 SkTextUtils::DrawString(canvas, "Src Unknown", in draw_pass() 125 SkTextUtils::DrawString(canvas, "Src Opaque", in draw_pass() 131 canvas->translate(0, kSubtitleSpacing + kShapeSpacing/2); in draw_pass() 138 canvas->save(); in draw_pass() 141 this->drawModeName(canvas, mode); in draw_pass() [all …]
|
D | runtimeshader.cpp | 72 void onDraw(SkCanvas* canvas) override { in onDraw() argument 81 canvas->drawRect({0, 0, 256, 256}, p); in onDraw() 96 auto canvas = surf->getCanvas(); in make_threshold() local 107 canvas->saveLayer(nullptr, &layerPaint); in make_threshold() 113 canvas->save(); in make_threshold() 114 canvas->translate(x, y); in make_threshold() 115 canvas->drawCircle(0, 0, rad, paint); in make_threshold() 116 canvas->restore(); in make_threshold() 119 canvas->restore(); // apply the blur in make_threshold() 159 void onDraw(SkCanvas* canvas) override { in onDraw() argument [all …]
|
/third_party/skia/docs/examples/ |
D | example3ps.cpp | 12 void draw(SkCanvas* canvas) { in draw() argument 13 canvas->save(); in draw() 14 canvas->scale(15, -15); in draw() 15 canvas->translate(0, -28); in draw() 27 canvas->save(); in draw() 28 canvas->translate(0, 18); in draw() 30 canvas->drawPath(path, p); in draw() 31 canvas->restore(); in draw() 34 canvas->save(); in draw() 35 canvas->translate(8, 19); in draw() [all …]
|
/third_party/skia/modules/canvaskit/tests/ |
D | canvas.spec.js | 17 gm('canvas_api_example', (canvas) => { 24 canvas.drawLine(3, 10, 30, 15, paint); 26 canvas.drawRRect(rrect, paint); 28 canvas.drawOval(CanvasKit.LTRBRect(5, 35, 45, 80), paint); 30 canvas.drawArc(CanvasKit.LTRBRect(55, 35, 95, 80), 15, 270, true, paint); 33 canvas.drawText('this is ascii text', 5, 100, paint, font); 36 canvas.drawTextBlob(blob, 5, 130, paint); 44 gm('effect_and_text_example', (canvas) => { 62 canvas.clear(CanvasKit.Color(255, 255, 255, 1.0)); 64 canvas.drawPath(path, paint); [all …]
|
/third_party/skia/samplecode/ |
D | SampleAARects.cpp | 18 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() 46 void onDrawContent(SkCanvas* canvas) override { in onDrawContent() argument 47 canvas->translate(SkIntToScalar(10), SkIntToScalar(10)); in onDrawContent() 71 canvas->save(); in onDrawContent() 76 canvas->drawRect(rect, paints[p]); in onDrawContent() 77 canvas->translate(dx, 0); in onDrawContent() 83 canvas->drawRect(rect, paints[p]); in onDrawContent() [all …]
|
D | SampleMaterialShadows.cpp | 42 void drawShadowedPath(SkCanvas* canvas, const SkPath& path, in drawShadowedPath() argument 51 SkShadowUtils::DrawShadow(canvas, path, zPlaneParams, lightPos, lightRadius, in drawShadowedPath() 54 canvas->drawPath(path, paint); in drawShadowedPath() 57 void onDrawContent(SkCanvas* canvas) override { in onDrawContent() argument 58 canvas->drawColor(0xFFFFFFFF); in onDrawContent() 73 canvas->save(); in onDrawContent() 74 canvas->translate(80, 80); in onDrawContent() 77 this->drawShadowedPath(canvas, fCirclePath, zPlaneParams, paint, kAmbientAlpha, in onDrawContent() 79 canvas->translate(80, 0); in onDrawContent() 81 canvas->restore(); in onDrawContent() [all …]
|
/third_party/skia/tests/ |
D | CanvasTest.cpp | 94 SkCanvas canvas(10, 10); in DEF_TEST() local 98 irect = canvas.getDeviceClipBounds(); in DEF_TEST() 100 REPORTER_ASSERT(reporter, canvas.getDeviceClipBounds(&irect2)); in DEF_TEST() 104 rect = canvas.getLocalClipBounds(); in DEF_TEST() 106 REPORTER_ASSERT(reporter, canvas.getLocalClipBounds(&rect2)); in DEF_TEST() 109 canvas.clipRect(SkRect::MakeEmpty()); in DEF_TEST() 111 irect = canvas.getDeviceClipBounds(); in DEF_TEST() 113 REPORTER_ASSERT(reporter, !canvas.getDeviceClipBounds(&irect2)); in DEF_TEST() 116 rect = canvas.getLocalClipBounds(); in DEF_TEST() 118 REPORTER_ASSERT(reporter, !canvas.getLocalClipBounds(&rect2)); in DEF_TEST() [all …]
|
D | MatrixClipCollapseTest.cpp | 141 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 …]
|