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

Unified Diff: gm/imagefiltersscaled.cpp

Issue 23011012: Implement correct clipping for image filters. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Add morphology to the list of ignored tests Created 6 years, 10 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 | « gm/imagefiltersclipped.cpp ('k') | gyp/gmslides.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefiltersscaled.cpp
diff --git a/gm/imagefiltersscaled.cpp b/gm/imagefiltersscaled.cpp
index ad52d902e76062292eb9181cac6df3ad7d0f205f..a9c4a10587515c5eaf859df15e903bdc58132b29 100644
--- a/gm/imagefiltersscaled.cpp
+++ b/gm/imagefiltersscaled.cpp
@@ -13,6 +13,7 @@
#include "SkDropShadowImageFilter.h"
#include "SkGradientShader.h"
#include "SkMorphologyImageFilter.h"
+#include "SkOffsetImageFilter.h"
#include "SkScalar.h"
namespace skiagm {
@@ -96,6 +97,7 @@ protected:
checkerboard.get()),
new SkDilateImageFilter(1, 1, checkerboard.get()),
new SkErodeImageFilter(1, 1, checkerboard.get()),
+ new SkOffsetImageFilter(SkIntToScalar(32), 0),
};
SkVector scales[] = {
@@ -120,7 +122,9 @@ protected:
paint.setAntiAlias(true);
canvas->save();
canvas->scale(scales[j].fX, scales[j].fY);
- canvas->clipRect(bounds);
+ if (5 == i) {
+ canvas->translate(SkIntToScalar(-32), 0);
+ }
canvas->drawCircle(r.centerX(), r.centerY(),
SkScalarDiv(r.width()*2, SkIntToScalar(5)), paint);
canvas->restore();
« no previous file with comments | « gm/imagefiltersclipped.cpp ('k') | gyp/gmslides.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698