aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-02-23 22:39:18 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-02-23 22:39:18 +0000
commit7d7ca79c3e6e6be7b7849b0d9a7fe26effb89c38 (patch)
tree969719eac27d43e12078dbf7f13a70959d242469
parentdca7acb2fe2df8db7b1e665f9e49677cb96e9c9c (diff)
add fClipStack optional field to SkDraw (it is always set by canvas)
git-svn-id: http://skia.googlecode.com/svn/trunk@844 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--include/core/SkCanvas.h6
-rw-r--r--include/core/SkDraw.h4
-rw-r--r--src/core/SkCanvas.cpp5
3 files changed, 14 insertions, 1 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index c19fd2f463..1e153078c7 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -727,6 +727,12 @@ public:
*/
const SkRegion& getTotalClip() const;
+ /**
+ * Return the current clipstack. This mirrors the result in getTotalClip()
+ * but is represented as a stack of geometric clips + region-ops.
+ */
+ const SkClipStack& getTotalClipStack() const;
+
void setExternalMatrix(const SkMatrix* = NULL);
///////////////////////////////////////////////////////////////////////////
diff --git a/include/core/SkDraw.h b/include/core/SkDraw.h
index 2c0fa491c3..1c4a621378 100644
--- a/include/core/SkDraw.h
+++ b/include/core/SkDraw.h
@@ -26,6 +26,7 @@
#include "SkAutoKern.h"
class SkBounder;
+class SkClipStack;
class SkDevice;
class SkPath;
class SkRegion;
@@ -59,7 +60,7 @@ public:
const SkColor colors[], SkXfermode* xmode,
const uint16_t indices[], int ptCount,
const SkPaint& paint) const;
-
+
void drawPath(const SkPath& src, const SkPaint& paint) const {
this->drawPath(src, paint, NULL, false);
}
@@ -84,6 +85,7 @@ public:
const SkMatrix* fMatrix; // required
const SkRegion* fClip; // required
+ const SkClipStack* fClipStack; // optional
SkDevice* fDevice; // optional
SkBounder* fBounder; // optional
SkDrawProcs* fProcs; // optional
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 639c0d414b..a96d2eff4c 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -230,6 +230,7 @@ public:
fCanvas = canvas;
canvas->updateDeviceCMCache();
+ fClipStack = &canvas->getTotalClipStack();
fBounder = canvas->getBounder();
fCurrLayer = canvas->fMCRec->fTopLayer;
fSkipEmptyClips = skipEmptyClips;
@@ -1149,6 +1150,10 @@ const SkRegion& SkCanvas::getTotalClip() const {
return *fMCRec->fRegion;
}
+const SkClipStack& SkCanvas::getTotalClipStack() const {
+ return fClipStack;
+}
+
void SkCanvas::setExternalMatrix(const SkMatrix* matrix) {
if (NULL == matrix || matrix->isIdentity()) {
if (fUseExternalMatrix) {