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

Unified Diff: gm/canvasstate.cpp

Issue 340403003: SaveFlags be-gone (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « no previous file | include/core/SkCanvas.h » ('j') | include/core/SkCanvas.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/canvasstate.cpp
diff --git a/gm/canvasstate.cpp b/gm/canvasstate.cpp
index b61ee720d5154729ec573ef824ba7b2efb5a3fd7..e02f342c8ba26b00e5110d4bc1113eea3fd8325a 100644
--- a/gm/canvasstate.cpp
+++ b/gm/canvasstate.cpp
@@ -64,19 +64,10 @@ protected:
}
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
-
- SkCanvas::SaveFlags flags[] = { SkCanvas::kMatrix_SaveFlag,
- SkCanvas::kClip_SaveFlag,
- SkCanvas::kMatrixClip_SaveFlag };
-
- // columns -- flags
// rows -- permutations of setting the clip and matrix
- for (int i = 0; i < static_cast<int>(SK_ARRAY_COUNT(flags)); ++i) {
- for (int j = 0; j < 2; ++j) {
- for (int k = 0; k < 2; ++k) {
- this->drawTestPattern(i, (2*j)+k, canvas, flags[i],
- SkToBool(j), SkToBool(k));
- }
+ for (int j = 0; j < 2; ++j) {
+ for (int k = 0; k < 2; ++k) {
+ this->drawTestPattern((2*j)+k, canvas, SkToBool(j), SkToBool(k));
}
}
}
@@ -85,13 +76,12 @@ protected:
virtual uint32_t onGetFlags() const SK_OVERRIDE { return kSkipPicture_Flag; }
private:
- void drawTestPattern(int x, int y, SkCanvas* canvas,
- SkCanvas::SaveFlags flags, bool doClip, bool doScale) {
+ void drawTestPattern(int y, SkCanvas* canvas, bool doClip, bool doScale) {
canvas->save();
- canvas->translate(SkIntToScalar(x*WIDTH), SkIntToScalar(y*HEIGHT));
+ canvas->translate(0, SkIntToScalar(y*HEIGHT));
canvas->drawRect(fOutlineRect, fStrokePaint);
- canvas->save(flags);
+ canvas->save();
if(doClip) {
canvas->clipPath(fPath);
}
« no previous file with comments | « no previous file | include/core/SkCanvas.h » ('j') | include/core/SkCanvas.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698