aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-03-03 13:54:13 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-03-03 13:54:13 +0000
commitd302f1401b3c9aea094804bad4e76de98782cfe8 (patch)
treeb46ec6c4de175842aef051d7b812785dacbd1d73 /include/core
parent1d12b1fd66e5be27fb4769ee09ce4fcd6bcc5979 (diff)
Add support for clipstack to Gr. GrClip is now a list of rects and paths with set operations to combine them. The stencil buffer is used to perform the set operations to put the clip into the stencil buffer. Building Gr's clip from Skia's clipStack is currently disabled due to the fact that Skia's clipStack is relative to the root layer not the current layer. This will be fixed in a subsequent CL.
git-svn-id: http://skia.googlecode.com/svn/trunk@878 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkCanvas.h3
-rw-r--r--include/core/SkClipStack.h10
-rw-r--r--include/core/SkDeque.h7
-rw-r--r--include/core/SkDevice.h3
-rw-r--r--include/core/SkRegion.h2
5 files changed, 22 insertions, 3 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 1e153078c7..eef3aea572 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -794,7 +794,8 @@ private:
SkDevice* fLastDeviceToGainFocus;
SkDeviceFactory* fDeviceFactory;
- void prepareForDeviceDraw(SkDevice*, const SkMatrix&, const SkRegion&);
+ void prepareForDeviceDraw(SkDevice*, const SkMatrix&, const SkRegion&,
+ const SkClipStack& clipStack);
bool fDeviceCMDirty; // cleared by updateDeviceCMCache()
void updateDeviceCMCache();
diff --git a/include/core/SkClipStack.h b/include/core/SkClipStack.h
index fb941553b3..db42e4df26 100644
--- a/include/core/SkClipStack.h
+++ b/include/core/SkClipStack.h
@@ -29,6 +29,11 @@ public:
class B2FIter {
public:
+ /**
+ * Creates an uninitialized iterator. Must be reset()
+ */
+ B2FIter();
+
B2FIter(const SkClipStack& stack);
struct Clip {
@@ -48,6 +53,11 @@ public:
*/
const Clip* next();
+ /**
+ * Restarts the iterator on a clip stack.
+ */
+ void reset(const SkClipStack& stack);
+
private:
Clip fClip;
SkDeque::F2BIter fIter;
diff --git a/include/core/SkDeque.h b/include/core/SkDeque.h
index 99c8dd46ab..92d515300a 100644
--- a/include/core/SkDeque.h
+++ b/include/core/SkDeque.h
@@ -52,9 +52,16 @@ private:
public:
class F2BIter {
public:
+ /**
+ * Creates an uninitialized iterator. Must be reset()
+ */
+ F2BIter();
+
F2BIter(const SkDeque& d);
void* next();
+ void reset(const SkDeque& d);
+
private:
SkDeque::Head* fHead;
char* fPos;
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index a7903993a4..c0d71c3f8e 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -141,7 +141,8 @@ public:
/** Called when this device gains focus (i.e becomes the current device
for drawing).
*/
- virtual void gainFocus(SkCanvas*, const SkMatrix&, const SkRegion&) {}
+ virtual void gainFocus(SkCanvas*, const SkMatrix&, const SkRegion&,
+ const SkClipStack&) {}
/** Causes any deferred drawing to the device to be completed.
*/
diff --git a/include/core/SkRegion.h b/include/core/SkRegion.h
index 8d9ff013ed..58f4f3fb3f 100644
--- a/include/core/SkRegion.h
+++ b/include/core/SkRegion.h
@@ -260,7 +260,7 @@ public:
bool rewind();
// reset the iterator, using the new region
void reset(const SkRegion&);
- bool done() { return fDone; }
+ bool done() const { return fDone; }
void next();
const SkIRect& rect() const { return fRect; }
// may return null