diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-31 15:18:21 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-31 15:18:21 +0000 |
commit | 7b11289b4e4d117bbcee6d2460b057d0fcf6e437 (patch) | |
tree | 0dab0504a918dc628859c2bbef319d937440592b /src/core | |
parent | a7ffb956cb8358241f11dbb48170cbd7df191c85 (diff) |
Added dev- & canv- prefixes to Ganesh bounding boxes to indicate coordinate space
http://codereview.appspot.com/6457061/
git-svn-id: http://skia.googlecode.com/svn/trunk@4856 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkClipStack.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp index 673981b3c6..d2c2035bef 100644 --- a/src/core/SkClipStack.cpp +++ b/src/core/SkClipStack.cpp @@ -449,16 +449,16 @@ void SkClipStack::restore() { } } -void SkClipStack::getBounds(SkRect* finiteBound, +void SkClipStack::getBounds(SkRect* canvFiniteBound, BoundsType* boundType, bool* isIntersectionOfRects) const { - SkASSERT(NULL != finiteBound && NULL != boundType); + SkASSERT(NULL != canvFiniteBound && NULL != boundType); Rec* rec = (Rec*)fDeque.back(); if (NULL == rec) { // the clip is wide open - the infinite plane w/ no pixels un-writeable - finiteBound->setEmpty(); + canvFiniteBound->setEmpty(); *boundType = kInsideOut_BoundsType; if (NULL != isIntersectionOfRects) { *isIntersectionOfRects = false; @@ -466,7 +466,7 @@ void SkClipStack::getBounds(SkRect* finiteBound, return; } - *finiteBound = rec->fFiniteBound; + *canvFiniteBound = rec->fFiniteBound; *boundType = rec->fFiniteBoundType; if (NULL != isIntersectionOfRects) { *isIntersectionOfRects = rec->fIsIntersectionOfRects; @@ -673,24 +673,26 @@ void SkClipStack::getConservativeBounds(int offsetX, int offsetY, int maxWidth, int maxHeight, - SkRect* bounds, + SkRect* devBounds, bool* isIntersectionOfRects) const { - SkASSERT(NULL != bounds); + SkASSERT(NULL != devBounds); - bounds->setLTRB(0, 0, - SkIntToScalar(maxWidth), SkIntToScalar(maxHeight)); + devBounds->setLTRB(0, 0, + SkIntToScalar(maxWidth), SkIntToScalar(maxHeight)); SkRect temp; SkClipStack::BoundsType boundType; + // temp starts off in canvas space here this->getBounds(&temp, &boundType, isIntersectionOfRects); if (SkClipStack::kInsideOut_BoundsType == boundType) { return; } + // but is converted to device space here temp.offset(SkIntToScalar(offsetX), SkIntToScalar(offsetY)); - if (!bounds->intersect(temp)) { - bounds->setEmpty(); + if (!devBounds->intersect(temp)) { + devBounds->setEmpty(); } } |