aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkRegion.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-01-09 11:31:53 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-09 16:54:52 +0000
commita766ca9af12e1175cfb01f4b516802da9197ba78 (patch)
tree738b9fa0c40ce361a45c6b2d49353f9b9431219d /src/core/SkRegion.cpp
parent99578d24c0abd5b0e4fa2fc40b44fbec0c2bd627 (diff)
use 64bit math to compute is a rect is empty
Will work next to try to make isEmpty() private Bug: skia:7470 Bug:799715 Change-Id: I7b43028ecd86dca68e0c67225712516d2f2f88a2 Reviewed-on: https://skia-review.googlesource.com/92620 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/core/SkRegion.cpp')
-rw-r--r--src/core/SkRegion.cpp11
1 files changed, 3 insertions, 8 deletions
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();