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

Unified Diff: include/core/SkImageFilter.h

Issue 1388823002: add LocalMatrixImageFilter Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add gm Created 5 years, 2 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 | « gyp/core.gypi ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImageFilter.h
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index 0595010c6fba0321262feca28b887ce3bf272649..398d3224b159adf865835424d3cbd31b8efc2ba9 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -227,7 +227,13 @@ public:
virtual void computeFastBounds(const SkRect&, SkRect*) const;
// Can this filter DAG compute the resulting bounds of an object-space rectangle?
- bool canComputeFastBounds() const;
+ virtual bool canComputeFastBounds() const;
+
+ /**
+ * If this filter can be represented by another filter + a localMatrix, return that filter,
+ * else return null.
+ */
+ virtual SkImageFilter* newWithLocalMatrix(const SkMatrix& localMatrix) const;
/**
* Create an SkMatrixImageFilter, which transforms its input by the given matrix.
@@ -345,8 +351,8 @@ protected:
* context's clipBounds, and returns the result in "bounds". If there is
* no intersection, returns false and leaves "bounds" unchanged.
*/
- bool applyCropRect(const Context&, const SkBitmap& src, const SkIPoint& srcOffset,
- SkIRect* bounds) const;
+ virtual bool applyCropRect(const Context&, const SkBitmap& src, const SkIPoint& srcOffset,
+ SkIRect* bounds) const;
/** Same as the above call, except that if the resulting crop rect is not
* entirely contained by the source bitmap's bounds, it creates a new
@@ -356,8 +362,8 @@ protected:
* be used by filters which are not capable of processing a smaller
* source bitmap into a larger destination.
*/
- bool applyCropRect(const Context&, Proxy* proxy, const SkBitmap& src, SkIPoint* srcOffset,
- SkIRect* bounds, SkBitmap* result) const;
+ virtual bool applyCropRect(const Context&, Proxy* proxy, const SkBitmap& src,
+ SkIPoint* srcOffset, SkIRect* bounds, SkBitmap* result) const;
/**
* Returns true if the filter can be expressed a single-pass
@@ -385,11 +391,13 @@ protected:
*/
virtual bool affectsTransparentBlack() const;
+ virtual bool usesSrcInput() const { return fUsesSrcInput; }
+
private:
friend class SkGraphics;
- static void PurgeCache();
+ friend class SkLocalMatrixImageFilter;
- bool usesSrcInput() const { return fUsesSrcInput; }
+ static void PurgeCache();
typedef SkFlattenable INHERITED;
int fInputCount;
« no previous file with comments | « gyp/core.gypi ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698