aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-06-09 08:18:39 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-09 08:18:40 -0700
commit2c55d7b7f3c2c834085d019bf6b1519b315c8aa1 (patch)
treee8b584e6f7f085132c2333e87b060e65f7f77ca8 /include
parentded9a6f794a43fc9ec7b370559ba0699c061628d (diff)
remove subclassing from ImageFilter::Proxy
Diffstat (limited to 'include')
-rw-r--r--include/core/SkBitmapDevice.h1
-rw-r--r--include/core/SkDevice.h2
-rw-r--r--include/core/SkImageFilter.h31
3 files changed, 20 insertions, 14 deletions
diff --git a/include/core/SkBitmapDevice.h b/include/core/SkBitmapDevice.h
index 5941016ce3..a2101a2dd9 100644
--- a/include/core/SkBitmapDevice.h
+++ b/include/core/SkBitmapDevice.h
@@ -129,7 +129,6 @@ private:
friend class SkDraw;
friend class SkDrawIter;
friend class SkDeviceFilteredPaint;
- friend class SkDeviceImageFilterProxy;
friend class SkSurface_Raster;
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index de43d1e8b8..3b5d38a6af 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -374,7 +374,7 @@ private:
friend class SkDraw;
friend class SkDrawIter;
friend class SkDeviceFilteredPaint;
- friend class SkDeviceImageFilterProxy;
+ friend class SkImageFilter::Proxy;
friend class SkDeferredDevice; // for newSurface
friend class SkNoPixelsBitmapDevice;
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index 55a504ced2..3508df50ce 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -12,15 +12,15 @@
#include "SkFlattenable.h"
#include "SkMatrix.h"
#include "SkRect.h"
+#include "SkSurfaceProps.h"
#include "SkTemplates.h"
+class GrFragmentProcessor;
+class GrTexture;
+class SkBaseDevice;
class SkBitmap;
class SkColorFilter;
-class SkBaseDevice;
-class SkSurfaceProps;
struct SkIPoint;
-class GrFragmentProcessor;
-class GrTexture;
/**
* Base class for image filters. If one is installed in the paint, then
@@ -75,21 +75,28 @@ public:
private:
SkMatrix fCTM;
SkIRect fClipBounds;
- Cache* fCache;
+ Cache* fCache;
};
class Proxy {
public:
- virtual ~Proxy() {};
-
- virtual SkBaseDevice* createDevice(int width, int height) = 0;
+ Proxy(SkBaseDevice* device, const SkSurfaceProps& props)
+ : fDevice(device)
+ , fProps(props.flags(), kUnknown_SkPixelGeometry)
+ {}
+
+ SkBaseDevice* createDevice(int width, int height);
// 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 Context&,
- SkBitmap* result, SkIPoint* offset) = 0;
- virtual const SkSurfaceProps* surfaceProps() const = 0;
+ bool filterImage(const SkImageFilter*, const SkBitmap& src, const SkImageFilter::Context&,
+ SkBitmap* result, SkIPoint* offset);
+ const SkSurfaceProps& surfaceProps() const { return fProps; }
+
+ private:
+ SkBaseDevice* fDevice;
+ const SkSurfaceProps fProps;
};
+
/**
* Request a new (result) image to be created from the src image.