diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkAAClip.cpp | 2 | ||||
-rw-r--r-- | src/core/SkRectPriv.h | 8 | ||||
-rw-r--r-- | src/core/SkRegion.cpp | 11 |
3 files changed, 4 insertions, 17 deletions
diff --git a/src/core/SkAAClip.cpp b/src/core/SkAAClip.cpp index c0707c5b0c..b22b8ebebb 100644 --- a/src/core/SkAAClip.cpp +++ b/src/core/SkAAClip.cpp @@ -704,7 +704,7 @@ bool SkAAClip::setEmpty() { } bool SkAAClip::setRect(const SkIRect& bounds) { - if (!SkRectPriv::PositiveDimensions(bounds)) { + if (bounds.isEmpty()) { return this->setEmpty(); } diff --git a/src/core/SkRectPriv.h b/src/core/SkRectPriv.h index 01d184dce6..8b663ab3dd 100644 --- a/src/core/SkRectPriv.h +++ b/src/core/SkRectPriv.h @@ -12,14 +12,6 @@ class SkRectPriv { public: - // Returns true iff width and height are positive. Catches inverted, empty, and overflowing - // (way too big) rects. This is used by clients that want a non-empty rect that they can also - // actually use its computed width/height. - // - static bool PositiveDimensions(const SkIRect& r) { - return r.width() > 0 && r.height() > 0; - } - static SkRect MakeLargestS32() { const int32_t ihalf = SK_MaxS32 >> 1; const SkScalar half = SkIntToScalar(ihalf); diff --git a/src/core/SkRegion.cpp b/src/core/SkRegion.cpp index ba185ae38c..8c402e9250 100644 --- a/src/core/SkRegion.cpp +++ b/src/core/SkRegion.cpp @@ -140,21 +140,16 @@ bool SkRegion::setEmpty() { return false; } -bool SkRegion::setRect(int32_t left, int32_t top, - int32_t right, int32_t bottom) { - if (left >= right || top >= bottom) { +bool SkRegion::setRect(const SkIRect& r) { + if (r.isEmpty()) { return this->setEmpty(); } this->freeRuns(); - fBounds.set(left, top, right, bottom); + fBounds = r; fRunHead = SkRegion_gRectRunHeadPtr; return true; } -bool SkRegion::setRect(const SkIRect& r) { - return this->setRect(r.fLeft, r.fTop, r.fRight, r.fBottom); -} - bool SkRegion::setRegion(const SkRegion& src) { if (this != &src) { this->freeRuns(); |