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

Unified Diff: gm/resizeimagefilter.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/matriximagefilter.cpp ('k') | gyp/effects.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/resizeimagefilter.cpp
diff --git a/gm/resizeimagefilter.cpp b/gm/resizeimagefilter.cpp
index 02bbaff689bf2aa62bbf096c847695114810b1d2..3f4f1fae65e24007aacdd31525cd07dcc3472899 100644
--- a/gm/resizeimagefilter.cpp
+++ b/gm/resizeimagefilter.cpp
@@ -9,7 +9,7 @@
#include "SkBitmapDevice.h"
#include "SkBitmapSource.h"
#include "SkColor.h"
-#include "SkResizeImageFilter.h"
+#include "SkMatrixImageFilter.h"
#include "SkRefCnt.h"
namespace skiagm {
@@ -38,11 +38,11 @@ protected:
canvas->translate(rect.x(), rect.y());
canvas->scale(deviceScaleX, deviceScaleY);
canvas->translate(-rect.x(), -rect.y());
+ SkMatrix matrix;
+ matrix.setScale(SkScalarInvert(deviceScaleX),
+ SkScalarInvert(deviceScaleY));
SkAutoTUnref<SkImageFilter> imageFilter(
- SkResizeImageFilter::Create(SkScalarInvert(deviceScaleX),
- SkScalarInvert(deviceScaleY),
- filterLevel,
- input));
+ SkMatrixImageFilter::Create(matrix, filterLevel, input));
SkPaint filteredPaint;
filteredPaint.setImageFilter(imageFilter.get());
canvas->saveLayer(&rect, &filteredPaint);
« no previous file with comments | « gm/matriximagefilter.cpp ('k') | gyp/effects.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698