Index: include/core/SkImageFilter.h |
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h |
index 29f6f7b760e2b2e27f9ab2dad92d9d8e0e2b5034..be36b90499a224c66001f0c6c9903d48eb2a3dc0 100644 |
--- a/include/core/SkImageFilter.h |
+++ b/include/core/SkImageFilter.h |
@@ -23,6 +23,7 @@ class SkBaseDevice; |
class SkBitmap; |
class SkColorFilter; |
struct SkIPoint; |
+class SkSpecialImage; |
/** |
* Base class for image filters. If one is installed in the paint, then |
@@ -42,7 +43,10 @@ public: |
static Cache* Create(size_t maxBytes); |
static Cache* Get(); |
virtual bool get(const Key& key, SkBitmap* result, SkIPoint* offset) const = 0; |
+ virtual SkSpecialImage* get(const Key& key, SkIPoint* offset) const = 0; |
virtual void set(const Key& key, const SkBitmap& result, const SkIPoint& offset) = 0; |
+ virtual void set(const Key& key, SkSpecialImage* image, const SkIPoint& offset) = 0; |
+ |
virtual void purge() {} |
virtual void purgeByKeys(const Key[], int) {} |
}; |
@@ -148,6 +152,8 @@ public: |
bool filterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, |
SkBitmap* result, SkIPoint* offset) const; |
+ SkSpecialImage* filterImage(SkSpecialImage* src, const Context&, SkIPoint* offset) const; |
+ |
enum MapDirection { |
kForward_MapDirection, |
kReverse_MapDirection |
@@ -260,6 +266,11 @@ public: |
SkFilterQuality, |
SkImageFilter* input = NULL); |
+ SkSpecialImage* filterInput(int index, |
+ SkSpecialImage* src, |
+ const Context&, |
+ SkIPoint* offset) const; |
+ |
#if SK_SUPPORT_GPU |
// Helper function which invokes GPU filter processing on the |
// input at the specified "index". If the input is null, it leaves |
@@ -345,6 +356,15 @@ protected: |
virtual bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, |
SkBitmap* result, SkIPoint* offset) const; |
+ // TODO: remove this when all the image filters are converted |
+ virtual bool supportsUnifiedFiltering() const { return false; } |
+ |
+ virtual SkSpecialImage* onFilterImage(SkSpecialImage* src, const Context&, |
+ SkIPoint* offset) const { |
+ return nullptr; |
+ } |
+ |
+ |
/** |
* This function recurses into its inputs with the given clip rect (first |
* argument), calls filterBounds() with the given map direction on each, |
@@ -414,6 +434,9 @@ protected: |
bool applyCropRectDeprecated(const Context&, Proxy* proxy, const SkBitmap& src, |
SkIPoint* srcOffset, SkIRect* bounds, SkBitmap* result) const; |
+ SkSpecialImage* applyCropRect(const Context&, SkSpecialImage* src, SkIPoint* srcOffset, |
+ SkIRect* bounds) const; |
+ |
/** |
* Returns true if the filter can be expressed a single-pass |
* GrProcessor, used to process this filter on the GPU, or false if |