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

Unified Diff: include/core/SkImageFilter.h

Issue 1390913005: add applyFilter() to SkImage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase to new effect factories, use stroke to show image bounds 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
Index: include/core/SkImageFilter.h
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index 30265e4fddaca4b05a12130658b4e4054e374336..326ae5bdaf2c99b02f308b69c6e2f6ceba1e8fea 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -95,20 +95,32 @@ public:
class Proxy {
public:
- Proxy(SkBaseDevice* device) : fDevice(device) { }
+ virtual ~Proxy() {}
- SkBaseDevice* createDevice(int width, int height);
+ virtual SkBaseDevice* createDevice(int width, int height) = 0;
+
+ // Returns true if the proxy handled the filter itself. If this returns
+ // false then the filter's code will be called.
+ virtual bool filterImage(const SkImageFilter*, const SkBitmap& src,
+ const SkImageFilter::Context&,
+ SkBitmap* result, SkIPoint* offset) = 0;
+ };
+
+ class DeviceProxy : public Proxy {
+ public:
+ DeviceProxy(SkBaseDevice* device) : fDevice(device) {}
+
+ SkBaseDevice* createDevice(int width, int height) override;
// Returns true if the proxy handled the filter itself. If this returns
// false then the filter's code will be called.
bool filterImage(const SkImageFilter*, const SkBitmap& src, const SkImageFilter::Context&,
- SkBitmap* result, SkIPoint* offset);
+ SkBitmap* result, SkIPoint* offset) override;
private:
SkBaseDevice* fDevice;
};
-
/**
* Request a new (result) image to be created from the src image.
* If the src has no pixels (isNull()) then the request just wants to
« no previous file with comments | « include/core/SkImage.h ('k') | src/core/SkCanvas.cpp » ('j') | src/image/SkImage_Gpu.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698