aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkDevice.h
diff options
context:
space:
mode:
authorGravatar twiz@google.com <twiz@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-10 23:10:26 +0000
committerGravatar twiz@google.com <twiz@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-10 23:10:26 +0000
commit246bd0f2718fb17f18bd3fd4bc5e99fdd0560a82 (patch)
tree9bc04fc6de1b9e732072f24585222420a855d249 /include/core/SkDevice.h
parent4a6ae8b64271c1f4bb89877872109ffd0f84aa23 (diff)
git-svn-id: http://skia.googlecode.com/svn/trunk@1292 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkDevice.h')
-rw-r--r--include/core/SkDevice.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index d9a4fde4c2..46bcf1a105 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -155,6 +155,31 @@ public:
virtual void setMatrixClip(const SkMatrix&, const SkRegion&,
const SkClipStack&);
+ /**
+ * Observer interface for listening to the calls to
+ * SkDevice::setMatrixClip(...). Users of SkDevice instances should
+ * implement matrixClipChanged(...) to receive notifications.
+ */
+ class SkMatrixClipObserver : public SkRefCnt {
+ public:
+ virtual void matrixClipChanged(const SkMatrix&, const SkRegion&,
+ const SkClipStack&) = 0;
+ };
+
+ /** Assign the clip observer. Note that an extra reference is added to the
+ * observer, and removed at SkDevice construction, or re-assignment of a
+ * different observer.
+ */
+ void setMatrixClipObserver(SkMatrixClipObserver* observer);
+
+ /** Return the device's associated SkMatrixClipObserver, or NULL.
+ * If non-null is returned, the reference count of the object is not
+ * modified.
+ */
+ SkMatrixClipObserver* getMatrixClipObserver() const {
+ return fMatrixClipObserver;
+ }
+
/** Called when this device gains focus (i.e becomes the current device
for drawing).
*/
@@ -281,6 +306,8 @@ private:
SkIPoint fOrigin;
SkMetaData* fMetaData;
+ SkMatrixClipObserver* fMatrixClipObserver;
+
SkDeviceFactory* fCachedDeviceFactory;
};