diff options
author | reed <reed@google.com> | 2015-06-09 12:16:53 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-09 12:16:53 -0700 |
commit | 41e010cb901c0da9066c4df562030808c9ccd7f8 (patch) | |
tree | 3bf17e946f9eadd43040ea6968adcfa5f2f882a4 /gm/fatpathfill.cpp | |
parent | 1831f990c31bad0d84641663c96aa8eebf846ab9 (diff) |
Revert[2] SkDraw and all Blitters to use pixmap instead of bitmapi
This reverts commit b3f0ec9f9967da2f80f0d842cb7fd53617b48de3.
BUG=skia:
Review URL: https://codereview.chromium.org/1168303006
Diffstat (limited to 'gm/fatpathfill.cpp')
-rw-r--r-- | gm/fatpathfill.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/gm/fatpathfill.cpp b/gm/fatpathfill.cpp index 1d269a0289..43e10059c1 100644 --- a/gm/fatpathfill.cpp +++ b/gm/fatpathfill.cpp @@ -31,22 +31,17 @@ static void draw_pixel_centers(SkCanvas* canvas) { } } -static void draw_fatpath(SkCanvas* canvas, SkSurface* surface, - const SkPath paths[], int count) { +static void draw_fatpath(SkCanvas* canvas, SkSurface* surface, const SkPath& path) { SkPaint paint; surface->getCanvas()->clear(SK_ColorTRANSPARENT); - for (int i = 0; i < count; ++i) { - surface->getCanvas()->drawPath(paths[i], paint); - } + surface->getCanvas()->drawPath(path, paint); surface->draw(canvas, 0, 0, NULL); paint.setAntiAlias(true); paint.setColor(SK_ColorRED); paint.setStyle(SkPaint::kStroke_Style); - for (int j = 0; j < count; ++j) { - canvas->drawPath(paths[j], paint); - } + canvas->drawPath(path, paint); draw_pixel_centers(canvas); } @@ -57,15 +52,15 @@ public: protected: - virtual SkString onShortName() { + SkString onShortName() override { return SkString("fatpathfill"); } - virtual SkISize onISize() { + SkISize onISize() override { return SkISize::Make(SMALL_W * ZOOM, SMALL_H * ZOOM * REPEAT_LOOP); } - virtual void onDraw(SkCanvas* canvas) { + void onDraw(SkCanvas* canvas) override { SkAutoTUnref<SkSurface> surface(new_surface(SMALL_W, SMALL_H)); canvas->scale(ZOOM, ZOOM); @@ -76,10 +71,10 @@ protected: for (int i = 0; i < REPEAT_LOOP; ++i) { SkPath line, path; - line.moveTo(SkIntToScalar(1), SkIntToScalar(2)); - line.lineTo(SkIntToScalar(4 + i), SkIntToScalar(1)); + line.moveTo(1, 2); + line.lineTo(SkIntToScalar(4 + i), 1); paint.getFillPath(line, &path); - draw_fatpath(canvas, surface, &path, 1); + draw_fatpath(canvas, surface, path); canvas->translate(0, SMALL_H); } |