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

Unified Diff: gm/imagefiltersscaled.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 | « gm/imagefiltersclipped.cpp ('k') | gm/imageresizetiled.cpp » ('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 28b3c9f1712ea040f16b421374bb1cda687beba1..6ccaece7efe86f31c6d59f9d8fc34d2968301cf8 100644
--- a/gm/imagefiltersscaled.cpp
+++ b/gm/imagefiltersscaled.cpp
@@ -14,8 +14,11 @@
#include "SkGradientShader.h"
#include "SkMorphologyImageFilter.h"
#include "SkOffsetImageFilter.h"
+#include "SkResizeImageFilter.h"
#include "SkScalar.h"
+#define RESIZE_FACTOR SkIntToScalar(4)
+
namespace skiagm {
class ImageFiltersScaledGM : public GM {
@@ -30,7 +33,7 @@ protected:
}
virtual SkISize onISize() {
- return make_isize(860, 500);
+ return make_isize(1020, 500);
}
void make_checkerboard() {
@@ -96,6 +99,7 @@ protected:
new SkDilateImageFilter(1, 1, checkerboard.get()),
new SkErodeImageFilter(1, 1, checkerboard.get()),
new SkOffsetImageFilter(SkIntToScalar(32), 0),
+ new SkResizeImageFilter(RESIZE_FACTOR, RESIZE_FACTOR, SkPaint::kNone_FilterLevel),
};
SkVector scales[] = {
@@ -122,6 +126,9 @@ protected:
canvas->scale(scales[j].fX, scales[j].fY);
if (5 == i) {
canvas->translate(SkIntToScalar(-32), 0);
+ } else if (6 == i) {
+ canvas->scale(SkScalarInvert(RESIZE_FACTOR),
+ SkScalarInvert(RESIZE_FACTOR));
}
canvas->drawCircle(r.centerX(), r.centerY(),
SkScalarDiv(r.width()*2, SkIntToScalar(5)), paint);
« no previous file with comments | « gm/imagefiltersclipped.cpp ('k') | gm/imageresizetiled.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698