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

Unified Diff: gm/imagefiltersclipped.cpp

Issue 168283006: Fix CTM application in SkResizeImagefilter; implement bounds traversals. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Simplify imageresizetiled GM a tad (layerBounds are useless) 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 | « expectations/gm/ignored-tests.txt ('k') | gm/imagefiltersscaled.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefiltersclipped.cpp
diff --git a/gm/imagefiltersclipped.cpp b/gm/imagefiltersclipped.cpp
index 331ea49061160b929cdf9655e0e79f77dda5200d..757cd1bf27df4bfafd9cfc87857b6a5e72d1cb38 100644
--- a/gm/imagefiltersclipped.cpp
+++ b/gm/imagefiltersclipped.cpp
@@ -14,8 +14,12 @@
#include "SkGradientShader.h"
#include "SkMorphologyImageFilter.h"
#include "SkOffsetImageFilter.h"
+#include "SkResizeImageFilter.h"
#include "SkScalar.h"
+#define RESIZE_FACTOR_X SkIntToScalar(2)
+#define RESIZE_FACTOR_Y SkIntToScalar(5)
+
namespace skiagm {
class ImageFiltersClippedGM : public GM {
@@ -96,6 +100,7 @@ protected:
new SkDilateImageFilter(2, 2, checkerboard.get()),
new SkErodeImageFilter(2, 2, checkerboard.get()),
new SkOffsetImageFilter(SkIntToScalar(-16), SkIntToScalar(32)),
+ new SkResizeImageFilter(RESIZE_FACTOR_X, RESIZE_FACTOR_Y, SkPaint::kNone_FilterLevel),
};
SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64));
@@ -113,8 +118,11 @@ protected:
paint.setAntiAlias(true);
canvas->save();
canvas->clipRect(bounds);
- if (i == 5) {
+ if (5 == i) {
canvas->translate(SkIntToScalar(16), SkIntToScalar(-32));
+ } else if (6 == i) {
+ canvas->scale(SkScalarInvert(RESIZE_FACTOR_X),
+ SkScalarInvert(RESIZE_FACTOR_Y));
}
canvas->drawCircle(r.centerX(), r.centerY(),
SkScalarDiv(r.width()*2, SkIntToScalar(5)), paint);
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | gm/imagefiltersscaled.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698