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

Unified Diff: gm/imagefiltersscaled.cpp

Issue 211103006: Implement a generic matrix transform image filter. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Rename the GM too Created 6 years, 9 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 5dca30b822af86f67252c920d5954592c60d7f37..0e7af56e0988050f839980b4e006bb41df6ee700 100644
--- a/gm/imagefiltersscaled.cpp
+++ b/gm/imagefiltersscaled.cpp
@@ -17,7 +17,7 @@
#include "SkOffsetImageFilter.h"
#include "SkPerlinNoiseShader.h"
#include "SkRectShaderImageFilter.h"
-#include "SkResizeImageFilter.h"
+#include "SkMatrixImageFilter.h"
#include "SkScalar.h"
#define RESIZE_FACTOR SkIntToScalar(4)
@@ -100,6 +100,8 @@ protected:
SkScalar kd = SkIntToScalar(2);
SkScalar surfaceScale = SkIntToScalar(1);
SkColor white(0xFFFFFFFF);
+ SkMatrix resizeMatrix;
+ resizeMatrix.setScale(RESIZE_FACTOR, RESIZE_FACTOR);
SkImageFilter* filters[] = {
SkBlurImageFilter::Create(SkIntToScalar(4), SkIntToScalar(4)),
@@ -113,7 +115,7 @@ protected:
SkDilateImageFilter::Create(1, 1, checkerboard.get()),
SkErodeImageFilter::Create(1, 1, checkerboard.get()),
SkOffsetImageFilter::Create(SkIntToScalar(32), 0),
- SkResizeImageFilter::Create(RESIZE_FACTOR, RESIZE_FACTOR, SkPaint::kNone_FilterLevel),
+ SkMatrixImageFilter::Create(resizeMatrix, SkPaint::kNone_FilterLevel),
SkRectShaderImageFilter::Create(noise),
SkLightingImageFilter::CreatePointLitDiffuse(pointLocation, white, surfaceScale, kd),
SkLightingImageFilter::CreateSpotLitDiffuse(spotLocation, spotTarget, spotExponent,
« 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