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

Unified Diff: gm/imagefiltersclipped.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 | « no previous file | 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 84e63b8f0d5b5931304ef0d70520646d6dfbf61b..4187ba02aa3d00e008f8a2b9972ab534bea6f88b 100644
--- a/gm/imagefiltersclipped.cpp
+++ b/gm/imagefiltersclipped.cpp
@@ -16,7 +16,7 @@
#include "SkOffsetImageFilter.h"
#include "SkPerlinNoiseShader.h"
#include "SkRectShaderImageFilter.h"
-#include "SkResizeImageFilter.h"
+#include "SkMatrixImageFilter.h"
#include "SkScalar.h"
#define RESIZE_FACTOR_X SkIntToScalar(2)
@@ -91,6 +91,8 @@ protected:
SkAutoTUnref<SkImageFilter> checkerboard(SkBitmapSource::Create(fCheckerboard));
SkAutoTUnref<SkShader> noise(SkPerlinNoiseShader::CreateFractalNoise(
SkDoubleToScalar(0.1), SkDoubleToScalar(0.05), 1, 0));
+ SkMatrix resizeMatrix;
+ resizeMatrix.setScale(RESIZE_FACTOR_X, RESIZE_FACTOR_Y);
SkImageFilter* filters[] = {
SkBlurImageFilter::Create(SkIntToScalar(12), SkIntToScalar(12)),
@@ -104,7 +106,7 @@ protected:
SkDilateImageFilter::Create(2, 2, checkerboard.get()),
SkErodeImageFilter::Create(2, 2, checkerboard.get()),
SkOffsetImageFilter::Create(SkIntToScalar(-16), SkIntToScalar(32)),
- SkResizeImageFilter::Create(RESIZE_FACTOR_X, RESIZE_FACTOR_Y, SkPaint::kNone_FilterLevel),
+ SkMatrixImageFilter::Create(resizeMatrix, SkPaint::kNone_FilterLevel),
SkRectShaderImageFilter::Create(noise),
};
« no previous file with comments | « no previous file | gm/imagefiltersscaled.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698