Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: gm/fatpathfill.cpp

Issue 1168303006: Revert[2] SkDraw and all Blitters to use pixmap instead of bitmapi (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add dox to new test Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bench/CoverageBench.cpp ('k') | include/core/SkCanvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/fatpathfill.cpp
diff --git a/gm/fatpathfill.cpp b/gm/fatpathfill.cpp
index 1d269a02899a7baa0a7c7bb0d618b259495b13e4..43e10059c120458aeb64b570dfa5e9d9eea5b326 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);
}
« no previous file with comments | « bench/CoverageBench.cpp ('k') | include/core/SkCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698