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
This commit is contained in:
reed@google.com 2011-02-23 22:39:18 +00:00
parent dca7acb2fe
commit 7d7ca79c3e
3 changed files with 14 additions and 1 deletions

View File

@ -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);
///////////////////////////////////////////////////////////////////////////

View File

@ -26,6 +26,7 @@
#include "SkAutoKern.h"
class SkBounder;
class SkClipStack;
class SkDevice;
class SkPath;
class SkRegion;
@ -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

View File

@ -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) {