Index: cc/region.h |
diff --git a/cc/region.h b/cc/region.h |
index 00e2bd1ddc031690d8210c9a8aa51653b8961599..5ecf9d8d006c8aaa6f5b72ab368f1b423726607d 100644 |
--- a/cc/region.h |
+++ b/cc/region.h |
@@ -10,6 +10,7 @@ |
#include "base/logging.h" |
#include "cc/cc_export.h" |
#include "third_party/skia/include/core/SkRegion.h" |
+#include "ui/gfx/skia_util.h" |
danakj
2012/11/11 18:57:02
sort order
tfarina
2012/11/11 19:58:15
Done.
|
#include "ui/gfx/rect.h" |
namespace cc { |
@@ -42,12 +43,10 @@ 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; |
danakj
2012/11/11 18:57:02
Why moved?
tfarina
2012/11/11 19:43:25
For two reasons:
- To be consistent with the abov
danakj
2012/11/11 19:45:45
Ya, I'd rather keep simple methods like that in th
tfarina
2012/11/11 19:58:15
Done.
|
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 +57,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(); |
} |