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

Unified Diff: include/core/SkDevice.h

Issue 1893993002: Revert of Remove deprecated paths from image filter infrastructure. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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/core/SkImageFilter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkDevice.h
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index 2377b57dfb7482f0ec40dd781245bd77dfb05b04..c15aeccf82dc52786b6899cfcdbfabc885fe9e36 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -280,6 +280,28 @@
*/
virtual const SkBitmap& onAccessBitmap() = 0;
+ /**
+ * Override and return true for filters that the device can handle
+ * intrinsically. Doing so means that SkCanvas will pass-through this
+ * filter to drawSprite and drawDevice (and potentially filterImage).
+ * Returning false means the SkCanvas will have apply the filter itself,
+ * and just pass the resulting image to the device.
+ */
+ virtual bool canHandleImageFilter(const SkImageFilter*) { return false; }
+
+ /**
+ * Related (but not required) to canHandleImageFilter, this method returns
+ * true if the device could apply the filter to the src bitmap and return
+ * the result (and updates offset as needed).
+ * If the device does not recognize or support this filter,
+ * it just returns false and leaves result and offset unchanged.
+ */
+ virtual bool filterImage(const SkImageFilter*, const SkBitmap&,
+ const SkImageFilter::Context&,
+ SkBitmap* /*result*/, SkIPoint* /*offset*/) {
+ return false;
+ }
+
protected:
virtual sk_sp<SkSurface> makeSurface(const SkImageInfo&, const SkSurfaceProps&);
virtual bool onPeekPixels(SkPixmap*) { return false; }
« no previous file with comments | « no previous file | include/core/SkImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698