diff options
Diffstat (limited to 'cc/region.h')
-rw-r--r-- | cc/region.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cc/region.h b/cc/region.h index 00e2bd1..badd33c 100644 --- a/cc/region.h +++ b/cc/region.h @@ -11,6 +11,7 @@ #include "cc/cc_export.h" #include "third_party/skia/include/core/SkRegion.h" #include "ui/gfx/rect.h" +#include "ui/gfx/skia_util.h" namespace cc { @@ -42,12 +43,12 @@ class CC_EXPORT Region { void Intersect(gfx::Rect rect); void Intersect(const Region& region); - bool Equals(const Region& other) const { return skregion_ == other.skregion_; } + bool Equals(const Region& other) const { + return skregion_ == other.skregion_; + } gfx::Rect bounds() const { - SkIRect r = skregion_.getBounds(); - // TODO(danakj) Use method from ui/gfx/skia_utils.h when it exists. - return gfx::Rect(r.x(), r.y(), r.width(), r.height()); + return gfx::SkIRectToRect(skregion_.getBounds()); } std::string ToString() const; @@ -58,14 +59,13 @@ class CC_EXPORT Region { ~Iterator(); gfx::Rect rect() const { - SkIRect r = it_.rect(); - // TODO(danakj) Use method from ui/gfx/skia_utils.h when it exists. - return gfx::Rect(r.x(), r.y(), r.width(), r.height()); + return gfx::SkIRectToRect(it_.rect()); } void next() { it_.next(); } + bool has_rect() const { return !it_.done(); } |