Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9244)

Unified Diff: cc/region.cc

Issue 11410025: ui: Add SkIRectToRect() function to convert from SkIRect type to gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/region.h ('k') | ui/gfx/skia_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/region.cc
diff --git a/cc/region.cc b/cc/region.cc
index a33965c95119d7ecccc4376fded58fc51d1be2cd..3cd9b5d98e5bc5161b67aa0b19ffa7858ffec7b1 100644
--- a/cc/region.cc
+++ b/cc/region.cc
@@ -6,12 +6,6 @@
namespace cc {
-// TODO(danakj) Use method from ui/gfx/skia_utils.h when it exists.
-static inline SkIRect ToSkIRect(gfx::Rect rect)
-{
- return SkIRect::MakeXYWH(rect.x(), rect.y(), rect.width(), rect.height());
-}
-
Region::Region() {
}
@@ -20,14 +14,14 @@ Region::Region(const Region& region)
}
Region::Region(gfx::Rect rect)
- : skregion_(ToSkIRect(rect)) {
+ : skregion_(gfx::RectToSkIRect(rect)) {
}
Region::~Region() {
}
const Region& Region::operator=(gfx::Rect rect) {
- skregion_ = SkRegion(ToSkIRect(rect));
+ skregion_ = SkRegion(gfx::RectToSkIRect(rect));
return *this;
}
@@ -55,7 +49,7 @@ bool Region::Contains(gfx::Point point) const {
bool Region::Contains(gfx::Rect rect) const {
if (rect.IsEmpty())
return true;
- return skregion_.contains(ToSkIRect(rect));
+ return skregion_.contains(gfx::RectToSkIRect(rect));
}
bool Region::Contains(const Region& region) const {
@@ -65,7 +59,7 @@ bool Region::Contains(const Region& region) const {
}
bool Region::Intersects(gfx::Rect rect) const {
- return skregion_.intersects(ToSkIRect(rect));
+ return skregion_.intersects(gfx::RectToSkIRect(rect));
}
bool Region::Intersects(const Region& region) const {
@@ -73,7 +67,7 @@ bool Region::Intersects(const Region& region) const {
}
void Region::Subtract(gfx::Rect rect) {
- skregion_.op(ToSkIRect(rect), SkRegion::kDifference_Op);
+ skregion_.op(gfx::RectToSkIRect(rect), SkRegion::kDifference_Op);
}
void Region::Subtract(const Region& region) {
@@ -81,7 +75,7 @@ void Region::Subtract(const Region& region) {
}
void Region::Union(gfx::Rect rect) {
- skregion_.op(ToSkIRect(rect), SkRegion::kUnion_Op);
+ skregion_.op(gfx::RectToSkIRect(rect), SkRegion::kUnion_Op);
}
void Region::Union(const Region& region) {
@@ -89,7 +83,7 @@ void Region::Union(const Region& region) {
}
void Region::Intersect(gfx::Rect rect) {
- skregion_.op(ToSkIRect(rect), SkRegion::kIntersect_Op);
+ skregion_.op(gfx::RectToSkIRect(rect), SkRegion::kIntersect_Op);
}
void Region::Intersect(const Region& region) {
« no previous file with comments | « cc/region.h ('k') | ui/gfx/skia_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698