aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-09 22:30:18 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-09 22:30:18 +0000
commit3fffb2ee9fa01ae61efb2395973eb7575eda4c96 (patch)
tree22f3328eb4c6bca5cb87339d5a765630293f7aaf /include/core
parent5cd3656ed3676730b296722812f5924d06d0cc98 (diff)
Reverting r5861 (remove gainfocus and setMatixClip) due to Chrome compilation issues
git-svn-id: http://skia.googlecode.com/svn/trunk@5871 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkCanvas.h5
-rw-r--r--include/core/SkDevice.h23
2 files changed, 27 insertions, 1 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 178364cb43..0868574525 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -978,6 +978,7 @@ private:
uint32_t fMCRecStorage[32];
SkBounder* fBounder;
+ SkDevice* fLastDeviceToGainFocus;
int fSaveLayerCount; // number of successful saveLayer calls
SkMetaData* fMetaData;
@@ -988,7 +989,9 @@ private:
fSurfaceBase = sb;
}
friend class SkSurface_Base;
-
+
+ void prepareForDeviceDraw(SkDevice*, const SkMatrix&, const SkRegion&);
+
bool fDeviceCMDirty; // cleared by updateDeviceCMCache()
void updateDeviceCMCache();
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index 2ce64ee44f..f0aa8e0a02 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -187,6 +187,28 @@ protected:
*/
virtual bool filterTextFlags(const SkPaint& paint, TextFlags*);
+ /**
+ * Called with the correct matrix and clip before this device is drawn
+ * to using those settings. If your subclass overrides this, be sure to
+ * call through to the base class as well.
+ *
+ * The clipstack is another view of the clip. It records the actual
+ * geometry that went into building the region. It is present for devices
+ * that want to parse it, but is not required: the region is a complete
+ * picture of the current clip. (i.e. if you regionize all of the geometry
+ * in the clipstack, you will arrive at an equivalent region to the one
+ * passed in).
+ */
+ virtual void setMatrixClip(const SkMatrix&, const SkRegion&,
+ const SkClipStack&);
+
+ /** Called when this device gains focus (i.e becomes the current device
+ for drawing).
+ */
+ virtual void gainFocus(const SkMatrix&, const SkRegion&) {
+ SkASSERT(fAttachedToCanvas);
+ }
+
/** Clears the entire device to the specified color (including alpha).
* Ignores the clip.
*/
@@ -363,6 +385,7 @@ protected:
private:
friend class SkCanvas;
+ friend struct DeviceCM; //for setMatrixClip
friend class SkDraw;
friend class SkDrawIter;
friend class SkDeviceFilteredPaint;