diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-29 19:22:19 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-29 19:22:19 +0000 |
commit | e6e41d2f4f03a1dbb669c92c1e5152fd3e04e12b (patch) | |
tree | e74cad87eb8a9529154a6239e7d89e2d20be788a /ash/shell_unittest.cc | |
parent | 42cbf6082756c2a03ef4c13ac334045d8b574bc2 (diff) | |
download | chromium_src-e6e41d2f4f03a1dbb669c92c1e5152fd3e04e12b.zip chromium_src-e6e41d2f4f03a1dbb669c92c1e5152fd3e04e12b.tar.gz chromium_src-e6e41d2f4f03a1dbb669c92c1e5152fd3e04e12b.tar.bz2 |
ash: Clean up system background layer.
This adds a SystemBackgroundController class that's
responsible for a ui::Layer that's stacked underneath all
other layers.
I'm also adding an --ash-copy-host-background-at-boot flag
that can be set to instruct the controller to copy the host
window's content into the system background layer at
startup; otherwise, we display the same background color
used by Chrome OS's boot splash screen.
I suspect that there's a small performance hit from copying
(I've seen the XGetImage() take between 25 and 170 ms
depending on hardware), although it seems to be hidden in
the noise of our total boot times. Regardless, I figure
that we should only turn this on right now for systems that
need it (to hide an even-longer delay where the compositor
is drawing but the login background images hasn't been
loaded).
In any case, once the login background is visible, the
system background layer is reset to display the black
background that's needed for fullscreen animations that
manipulate the desktop background (for the workspace or
power button).
BUG=152309
Review URL: https://chromiumcodereview.appspot.com/11273059
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164704 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell_unittest.cc')
-rw-r--r-- | ash/shell_unittest.cc | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc index 1d0811b..0502741 100644 --- a/ash/shell_unittest.cc +++ b/ash/shell_unittest.cc @@ -55,8 +55,6 @@ void ExpectAllContainers() { EXPECT_TRUE(Shell::GetContainer( root_window, internal::kShellWindowId_DesktopBackgroundContainer)); EXPECT_TRUE(Shell::GetContainer( - root_window, internal::kShellWindowId_SystemBackgroundContainer)); - EXPECT_TRUE(Shell::GetContainer( root_window, internal::kShellWindowId_DefaultContainer)); EXPECT_TRUE(Shell::GetContainer( root_window, internal::kShellWindowId_AlwaysOnTopContainer)); @@ -354,45 +352,6 @@ std::vector<aura::Window*> BuildPathToRoot(aura::Window* window) { } // namespace -// The SystemBackgroundContainer needs to be behind the -// DesktopBackgroundContainer, otherwise workspace animations don't line up. -TEST_F(ShellTest, SystemBackgroundBehindDesktopBackground) { - aura::RootWindow* root_window = Shell::GetPrimaryRootWindow(); - aura::Window* desktop = Shell::GetContainer( - root_window, internal::kShellWindowId_DesktopBackgroundContainer); - ASSERT_TRUE(desktop != NULL); - aura::Window* system_bg = Shell::GetContainer( - root_window, internal::kShellWindowId_SystemBackgroundContainer); - ASSERT_TRUE(system_bg != NULL); - - std::vector<aura::Window*> desktop_parents(BuildPathToRoot(desktop)); - std::vector<aura::Window*> system_bg_parents(BuildPathToRoot(system_bg)); - - for (size_t i = 0; i < system_bg_parents.size(); ++i) { - std::vector<aura::Window*>::iterator desktop_i = - std::find(desktop_parents.begin(), desktop_parents.end(), - system_bg_parents[i]); - if (desktop_i != desktop_parents.end()) { - // Found the common parent. - ASSERT_NE(0u, i); - ASSERT_TRUE(desktop_i != desktop_parents.begin()); - aura::Window* common_parent = system_bg_parents[i]; - int system_child = static_cast<int>(std::find( - common_parent->children().begin(), - common_parent->children().end(), system_bg_parents[i - 1]) - - common_parent->children().begin()); - int desktop_child = static_cast<int>(std::find( - common_parent->children().begin(), - common_parent->children().end(), *(desktop_i - 1)) - - common_parent->children().begin()); - EXPECT_LT(system_child, desktop_child); - return; - } - } - EXPECT_TRUE(false) << - "system background and desktop background need to have a common parent"; -} - // Various assertions around IsAutoHideMenuHideChecked() and // ToggleAutoHideMenu(). TEST_F(ShellTest, ToggleAutoHide) { |