diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-09 16:52:00 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-09 16:52:00 +0000 |
commit | 8eb52a9ae0407aa717113d48b540b1abdb0616e8 (patch) | |
tree | 358644668ef2e16d94c86d04b56bb7c1e8673c4e /views/window | |
parent | 470ed45abe7452e9f72122e0273cc0506114860a (diff) | |
download | chromium_src-8eb52a9ae0407aa717113d48b540b1abdb0616e8.zip chromium_src-8eb52a9ae0407aa717113d48b540b1abdb0616e8.tar.gz chromium_src-8eb52a9ae0407aa717113d48b540b1abdb0616e8.tar.bz2 |
This will help minimize the area we paint various views, including BrowserView in cros. Before the default when a child's preferred view size changed was to propagate it up and
paint everything from the rootview down. This will limit the area to the parts that actually changed size.
I expect we may find things that aren't being painted because they were assuming the behavior of Layout(). We should fix this as necessary.
Also, a subsequent change will minimize our calls to SchedulePaint(). We frequently do it when we don't need to.
BUG=None
TEST=ViewTest.SetBoundsPaint
Review URL: http://codereview.chromium.org/6531032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77481 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/window')
-rw-r--r-- | views/window/client_view.cc | 2 | ||||
-rw-r--r-- | views/window/client_view.h | 11 | ||||
-rw-r--r-- | views/window/non_client_view.cc | 10 | ||||
-rw-r--r-- | views/window/non_client_view.h | 6 |
4 files changed, 15 insertions, 14 deletions
diff --git a/views/window/client_view.cc b/views/window/client_view.cc index 5d964de..6ec3f90 100644 --- a/views/window/client_view.cc +++ b/views/window/client_view.cc @@ -63,7 +63,7 @@ void ClientView::ViewHierarchyChanged(bool is_add, View* parent, View* child) { } } -void ClientView::OnBoundsChanged() { +void ClientView::OnBoundsChanged(const gfx::Rect& previous_bounds) { // Overridden to do nothing. The NonClientView manually calls Layout on the // ClientView when it is itself laid out, see comment in // NonClientView::Layout. diff --git a/views/window/client_view.h b/views/window/client_view.h index 405ec4e..b50eafa 100644 --- a/views/window/client_view.h +++ b/views/window/client_view.h @@ -55,14 +55,15 @@ class ClientView : public View { virtual int NonClientHitTest(const gfx::Point& point); // Overridden from View: - virtual gfx::Size GetPreferredSize(); - virtual void Layout(); + virtual gfx::Size GetPreferredSize() OVERRIDE; + virtual void Layout() OVERRIDE; protected: // Overridden from View: - virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); - virtual void OnBoundsChanged(); - virtual AccessibilityTypes::Role GetAccessibleRole(); + virtual void ViewHierarchyChanged( + bool is_add, View* parent, View* child) OVERRIDE; + virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; + virtual AccessibilityTypes::Role GetAccessibleRole() OVERRIDE; // Accessors for private data members. Window* window() const { return window_; } diff --git a/views/window/non_client_view.cc b/views/window/non_client_view.cc index f297c45..ec82685 100644 --- a/views/window/non_client_view.cc +++ b/views/window/non_client_view.cc @@ -196,11 +196,6 @@ bool NonClientFrameView::HitTest(const gfx::Point& l) const { return !GetWindow()->client_view()->bounds().Contains(l); } -void NonClientFrameView::OnBoundsChanged() { - // Overridden to do nothing. The NonClientView manually calls Layout on the - // FrameView when it is itself laid out, see comment in NonClientView::Layout. -} - //////////////////////////////////////////////////////////////////////////////// // NonClientFrameView, protected: @@ -261,4 +256,9 @@ AccessibilityTypes::Role NonClientFrameView::GetAccessibleRole() { return AccessibilityTypes::ROLE_WINDOW; } +void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) { + // Overridden to do nothing. The NonClientView manually calls Layout on the + // FrameView when it is itself laid out, see comment in NonClientView::Layout. +} + } // namespace views diff --git a/views/window/non_client_view.h b/views/window/non_client_view.h index d45c30e..38fc0b1 100644 --- a/views/window/non_client_view.h +++ b/views/window/non_client_view.h @@ -69,11 +69,11 @@ class NonClientFrameView : public View { virtual void ResetWindowControls() = 0; // Overridden from View: - virtual bool HitTest(const gfx::Point& l) const; - virtual AccessibilityTypes::Role GetAccessibleRole(); + virtual bool HitTest(const gfx::Point& l) const OVERRIDE; + virtual AccessibilityTypes::Role GetAccessibleRole() OVERRIDE; protected: - virtual void OnBoundsChanged(); + virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; NonClientFrameView() : paint_as_active_(false) {} |