diff options
author | jbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-27 21:30:24 +0000 |
---|---|---|
committer | jbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-27 21:30:24 +0000 |
commit | 2195e4e606bd6f80f2c1752192462ce2ef4c3f46 (patch) | |
tree | 893208583dc9391ad93afcdecab1b63d1730adf6 /ui/views | |
parent | 58c6a291307837c43e36fb4850755fc103df735d (diff) | |
download | chromium_src-2195e4e606bd6f80f2c1752192462ce2ef4c3f46.zip chromium_src-2195e4e606bd6f80f2c1752192462ce2ef4c3f46.tar.gz chromium_src-2195e4e606bd6f80f2c1752192462ce2ef4c3f46.tar.bz2 |
Don't set DesktopNativeWidgetAura's window transparent if not necessary.
If it's not using the native frame (e.g. on XP), the window doesn't need to be transparent, which saves a clear before painting its contents.
BUG=
R=ben@chromium.org
Review URL: https://codereview.chromium.org/24941002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225781 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views')
-rw-r--r-- | ui/views/widget/desktop_aura/desktop_native_widget_aura.cc | 8 | ||||
-rw-r--r-- | ui/views/widget/desktop_aura/desktop_native_widget_aura.h | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc index 7dd3dfe..698a342 100644 --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc @@ -283,7 +283,6 @@ void DesktopNativeWidgetAura::InitNativeWidget( window_->SetProperty(aura::client::kAnimationsDisabledKey, true); } window_->SetType(GetAuraWindowTypeForWidgetType(params.type)); - window_->SetTransparent(true); window_->Init(params.layer_type); corewm::SetShadowType(window_, corewm::SHADOW_TYPE_NONE); #if defined(OS_LINUX) // TODO(scottmg): http://crbug.com/180071 @@ -297,6 +296,8 @@ void DesktopNativeWidgetAura::InitNativeWidget( root_window_.reset( desktop_root_window_host_->Init(window_, params)); + UpdateWindowTransparency(); + content_window_container_ = new aura::Window(NULL); content_window_container_->Init(ui::LAYER_NOT_DRAWN); content_window_container_->Show(); @@ -353,6 +354,7 @@ bool DesktopNativeWidgetAura::ShouldUseNativeFrame() const { void DesktopNativeWidgetAura::FrameTypeChanged() { desktop_root_window_host_->FrameTypeChanged(); + UpdateWindowTransparency(); } Widget* DesktopNativeWidgetAura::GetWidget() { @@ -975,4 +977,8 @@ ui::EventHandler* DesktopNativeWidgetAura::GetEventHandler() { return this; } +void DesktopNativeWidgetAura::UpdateWindowTransparency() { + window_->SetTransparent(ShouldUseNativeFrame()); +} + } // namespace views diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.h b/ui/views/widget/desktop_aura/desktop_native_widget_aura.h index b644e7c..c1c97a0 100644 --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.h +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.h @@ -218,6 +218,10 @@ class VIEWS_EXPORT DesktopNativeWidgetAura const aura::RootWindow* root) OVERRIDE; private: + // To save a clear on platforms where the window is never transparent, the + // window is only set as transparent when the glass frame is in use. + void UpdateWindowTransparency(); + // See class documentation for Widget in widget.h for a note about ownership. Widget::InitParams::Ownership ownership_; |