diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkAAClip.cpp | 29 | ||||
-rw-r--r-- | src/core/SkAAClip.h | 4 | ||||
-rw-r--r-- | src/core/SkRasterClip.cpp | 5 | ||||
-rw-r--r-- | src/core/SkRasterClip.h | 12 |
4 files changed, 3 insertions, 47 deletions
diff --git a/src/core/SkAAClip.cpp b/src/core/SkAAClip.cpp index 54a6dcd795..14152f8317 100644 --- a/src/core/SkAAClip.cpp +++ b/src/core/SkAAClip.cpp @@ -684,35 +684,6 @@ bool SkAAClip::setRect(const SkIRect& bounds) { #endif } -bool SkAAClip::isRect() const { - if (this->isEmpty()) { - return false; - } - - const RunHead* head = fRunHead; - if (head->fRowCount != 1) { - return false; - } - const YOffset* yoff = head->yoffsets(); - if (yoff->fY != fBounds.fBottom - 1) { - return false; - } - SkASSERT(0 == yoff->fOffset); - - const uint8_t* row = head->data(); - int width = fBounds.width(); - do { - if (row[1] != 0xFF) { - return false; - } - int n = row[0]; - SkASSERT(n <= width); - width -= n; - row += 2; - } while (width > 0); - return true; -} - bool SkAAClip::setRect(const SkRect& r, bool doAA) { if (r.isEmpty()) { return this->setEmpty(); diff --git a/src/core/SkAAClip.h b/src/core/SkAAClip.h index c36a3e98ce..f2cde62dbc 100644 --- a/src/core/SkAAClip.h +++ b/src/core/SkAAClip.h @@ -29,10 +29,6 @@ public: bool isEmpty() const { return NULL == fRunHead; } const SkIRect& getBounds() const { return fBounds; } - // Returns true iff the clip is not empty, and is just a hard-edged rect (no partial alpha). - // If true, getBounds() can be used in place of this clip. - bool isRect() const; - bool setEmpty(); bool setRect(const SkIRect&); bool setRect(const SkRect&, bool doAA = true); diff --git a/src/core/SkRasterClip.cpp b/src/core/SkRasterClip.cpp index d1615a3445..664211f64f 100644 --- a/src/core/SkRasterClip.cpp +++ b/src/core/SkRasterClip.cpp @@ -222,10 +222,7 @@ void SkRasterClip::convertToAA() { SkASSERT(fIsBW); fAA.setRegion(fBW); fIsBW = false; - - // since we are being explicitly asked to convert-to-aa, we pass false so we don't "optimize" - // ourselves back to BW. - (void)this->updateCacheAndReturnNonEmpty(false); + (void)this->updateCacheAndReturnNonEmpty(); } #ifdef SK_DEBUG diff --git a/src/core/SkRasterClip.h b/src/core/SkRasterClip.h index 29a925f2a2..0c2723314c 100644 --- a/src/core/SkRasterClip.h +++ b/src/core/SkRasterClip.h @@ -89,19 +89,11 @@ private: } bool computeIsRect() const { - return fIsBW ? fBW.isRect() : fAA.isRect(); + return fIsBW ? fBW.isRect() : false; } - bool updateCacheAndReturnNonEmpty(bool detectAARect = true) { + bool updateCacheAndReturnNonEmpty() { fIsEmpty = this->computeIsEmpty(); - - // detect that our computed AA is really just a (hard-edged) rect - if (detectAARect && !fIsEmpty && !fIsBW && fAA.isRect()) { - fBW.setRect(fAA.getBounds()); - fAA.setEmpty(); // don't need this guy anymore - fIsBW = true; - } - fIsRect = this->computeIsRect(); return !fIsEmpty; } |