aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar reed <reed@chromium.org>2015-06-08 19:58:07 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-08 19:58:07 -0700
commitb3f0ec9f9967da2f80f0d842cb7fd53617b48de3 (patch)
treef00f2095e30e48180a2a3a073be5bf1a1fe3f4c2 /gm
parent86ae0a9e465f157eaa263ef7515e10619946ff83 (diff)
Revert of change SkDraw and all Blitters to use pixmap instead of bitmap (patchset #6 id:100001 of https://codereview.chromium.org/1148793007/)
Reason for revert: speculative revert to try to unblock DEPS roll Original issue's description: > change SkDraw and all Blitters to use pixmap instead of bitmap > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/c31af44336f5eb4a50e83e76e51962d46c3ed458 TBR=scroggo@google.com,jvanverth@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1164373003
Diffstat (limited to 'gm')
-rw-r--r--gm/fatpathfill.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/gm/fatpathfill.cpp b/gm/fatpathfill.cpp
index 43e10059c1..1d269a0289 100644
--- a/gm/fatpathfill.cpp
+++ b/gm/fatpathfill.cpp
@@ -31,17 +31,22 @@ static void draw_pixel_centers(SkCanvas* canvas) {
}
}
-static void draw_fatpath(SkCanvas* canvas, SkSurface* surface, const SkPath& path) {
+static void draw_fatpath(SkCanvas* canvas, SkSurface* surface,
+ const SkPath paths[], int count) {
SkPaint paint;
surface->getCanvas()->clear(SK_ColorTRANSPARENT);
- surface->getCanvas()->drawPath(path, paint);
+ for (int i = 0; i < count; ++i) {
+ surface->getCanvas()->drawPath(paths[i], paint);
+ }
surface->draw(canvas, 0, 0, NULL);
paint.setAntiAlias(true);
paint.setColor(SK_ColorRED);
paint.setStyle(SkPaint::kStroke_Style);
- canvas->drawPath(path, paint);
+ for (int j = 0; j < count; ++j) {
+ canvas->drawPath(paths[j], paint);
+ }
draw_pixel_centers(canvas);
}
@@ -52,15 +57,15 @@ public:
protected:
- SkString onShortName() override {
+ virtual SkString onShortName() {
return SkString("fatpathfill");
}
- SkISize onISize() override {
+ virtual SkISize onISize() {
return SkISize::Make(SMALL_W * ZOOM, SMALL_H * ZOOM * REPEAT_LOOP);
}
- void onDraw(SkCanvas* canvas) override {
+ virtual void onDraw(SkCanvas* canvas) {
SkAutoTUnref<SkSurface> surface(new_surface(SMALL_W, SMALL_H));
canvas->scale(ZOOM, ZOOM);
@@ -71,10 +76,10 @@ protected:
for (int i = 0; i < REPEAT_LOOP; ++i) {
SkPath line, path;
- line.moveTo(1, 2);
- line.lineTo(SkIntToScalar(4 + i), 1);
+ line.moveTo(SkIntToScalar(1), SkIntToScalar(2));
+ line.lineTo(SkIntToScalar(4 + i), SkIntToScalar(1));
paint.getFillPath(line, &path);
- draw_fatpath(canvas, surface, path);
+ draw_fatpath(canvas, surface, &path, 1);
canvas->translate(0, SMALL_H);
}