diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-17 17:19:50 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-17 17:19:50 +0000 |
commit | 3d19a5357ffa400a6c276619b81f75b5e06fa973 (patch) | |
tree | 655c5ac776ead235fff4e4ada7db8503826c14a6 /views/view.cc | |
parent | a9e735b5978a5346c1c33ab6e292824aed03fb63 (diff) | |
download | chromium_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 'views/view.cc')
-rw-r--r-- | views/view.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/views/view.cc b/views/view.cc index 10132d3..f0af615 100644 --- a/views/view.cc +++ b/views/view.cc @@ -1195,9 +1195,14 @@ void View::PaintToTexture(const gfx::Rect& dirty_region) { // Forward to all children as a descendant may be dirty and have a texture. for (int i = child_count() - 1; i >= 0; --i) { View* child_view = GetChildViewAt(i); - gfx::Rect child_dirty_rect(child_view->bounds().Intersect(dirty_region)); + + gfx::Rect child_dirty_rect = dirty_region; + child_dirty_rect.Offset(-child_view->GetMirroredX(), -child_view->y()); + child_view->GetTransform().TransformRectReverse(&child_dirty_rect); + child_dirty_rect = gfx::Rect(gfx::Point(), child_view->size()).Intersect( + child_dirty_rect); + if (!child_dirty_rect.IsEmpty()) { - child_dirty_rect.Offset(-child_view->x(), -child_view->y()); GetChildViewAt(i)->PaintToTexture(child_dirty_rect); } } |