summaryrefslogtreecommitdiffstats
path: root/ui/gfx
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-17 17:19:50 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-17 17:19:50 +0000
commit3d19a5357ffa400a6c276619b81f75b5e06fa973 (patch)
tree655c5ac776ead235fff4e4ada7db8503826c14a6 /ui/gfx
parenta9e735b5978a5346c1c33ab6e292824aed03fb63 (diff)
downloadchromium_src-3d19a5357ffa400a6c276619b81f75b5e06fa973.zip
chromium_src-3d19a5357ffa400a6c276619b81f75b5e06fa973.tar.gz
chromium_src-3d19a5357ffa400a6c276619b81f75b5e06fa973.tar.bz2
Take transforms into consideration when deciding the dirty region for child views.
BUG=none TEST=the close button of the rotated window highlights on hover. Review URL: http://codereview.chromium.org/7193025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89501 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx')
-rw-r--r--ui/gfx/transform.cc8
-rw-r--r--ui/gfx/transform.h8
2 files changed, 8 insertions, 8 deletions
diff --git a/ui/gfx/transform.cc b/ui/gfx/transform.cc
index 03e2873..bfd137a 100644
--- a/ui/gfx/transform.cc
+++ b/ui/gfx/transform.cc
@@ -70,7 +70,7 @@ bool Transform::HasChange() const {
return !matrix_.isIdentity();
}
-bool Transform::TransformPoint(gfx::Point* point) {
+bool Transform::TransformPoint(gfx::Point* point) const {
SkPoint skp;
matrix_.mapXY(SkIntToScalar(point->x()), SkIntToScalar(point->y()), &skp);
point->SetPoint(static_cast<int>(std::floor(skp.fX)),
@@ -78,7 +78,7 @@ bool Transform::TransformPoint(gfx::Point* point) {
return true;
}
-bool Transform::TransformPointReverse(gfx::Point* point) {
+bool Transform::TransformPointReverse(gfx::Point* point) const {
SkMatrix inverse;
// TODO(sad): Try to avoid trying to invert the matrix.
if (matrix_.invert(&inverse)) {
@@ -91,7 +91,7 @@ bool Transform::TransformPointReverse(gfx::Point* point) {
return false;
}
-bool Transform::TransformRect(gfx::Rect* rect) {
+bool Transform::TransformRect(gfx::Rect* rect) const {
SkRect src = gfx::RectToSkRect(*rect);
if (!matrix_.mapRect(&src))
return false;
@@ -99,7 +99,7 @@ bool Transform::TransformRect(gfx::Rect* rect) {
return true;
}
-bool Transform::TransformRectReverse(gfx::Rect* rect) {
+bool Transform::TransformRectReverse(gfx::Rect* rect) const {
SkMatrix inverse;
if (!matrix_.invert(&inverse))
return false;
diff --git a/ui/gfx/transform.h b/ui/gfx/transform.h
index 3fdfc32..aa5a675 100644
--- a/ui/gfx/transform.h
+++ b/ui/gfx/transform.h
@@ -71,19 +71,19 @@ class Transform {
// Applies the transformation on the point. Returns true if the point is
// transformed successfully.
- bool TransformPoint(gfx::Point* point);
+ bool TransformPoint(gfx::Point* point) const;
// Applies the reverse transformation on the point. Returns true if the point
// is transformed successfully.
- bool TransformPointReverse(gfx::Point* point);
+ bool TransformPointReverse(gfx::Point* point) const;
// Applies transformation on the rectangle. Returns true if the rectangle is
// transformed successfully.
- bool TransformRect(gfx::Rect* rect);
+ bool TransformRect(gfx::Rect* rect) const;
// Applies the reverse transformation on the rectangle. Returns true if the
// rectangle is transformed successfully.
- bool TransformRectReverse(gfx::Rect* rect);
+ bool TransformRectReverse(gfx::Rect* rect) const;
// Returns the underlying matrix.
const SkMatrix& matrix() const { return matrix_; }