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

Unified Diff: gm/imagefilterscropped.cpp

Issue 785493003: remove unnecessary save/clip/restore (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefilterscropped.cpp
diff --git a/gm/imagefilterscropped.cpp b/gm/imagefilterscropped.cpp
index e7d37901d814b4dab51bf8de80164f32587b6b2b..ad8fd5cc0423eb3d97f933ff4732f3db3330e183 100644
--- a/gm/imagefilterscropped.cpp
+++ b/gm/imagefilterscropped.cpp
@@ -34,10 +34,7 @@ static void draw_path(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
paint.setColor(SK_ColorMAGENTA);
paint.setImageFilter(imf);
paint.setAntiAlias(true);
- canvas->save();
- canvas->clipRect(r);
canvas->drawCircle(r.centerX(), r.centerY(), r.width()*2/5, paint);
- canvas->restore();
}
static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
@@ -48,10 +45,7 @@ static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
sk_tool_utils::set_portable_typeface(&paint);
paint.setTextSize(r.height()/2);
paint.setTextAlign(SkPaint::kCenter_Align);
- canvas->save();
- canvas->clipRect(r);
canvas->drawText("Text", 4, r.centerX(), r.centerY(), paint);
- canvas->restore();
}
static void draw_bitmap(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
@@ -67,10 +61,7 @@ static void draw_bitmap(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
draw_path(&c, r, NULL);
paint.setImageFilter(imf);
- canvas->save();
- canvas->clipRect(r);
canvas->drawBitmap(bm, 0, 0, &paint);
- canvas->restore();
}
static void draw_sprite(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698