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

Unified Diff: include/core/SkImageFilter.h

Issue 1695823002: Get OffsetImageFilter really working with SkSpecialImages (Closed) Base URL: https://skia.googlesource.com/skia.git@use-special
Patch Set: update to ToT Created 4 years, 10 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 | include/effects/SkOffsetImageFilter.h » ('j') | src/core/SkImageFilter.cpp » ('J')
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 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
« no previous file with comments | « no previous file | include/effects/SkOffsetImageFilter.h » ('j') | src/core/SkImageFilter.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698