chromeos: removes BootSplashScreen
With the switch to ozone it's no longer used. BUG=642540 TEST=none Change-Id: Icc36593304b0055912626d035ba4842f1c11f67b Reviewed-on: https://chromium-review.googlesource.com/627060 Reviewed-by: Dan Erat <derat@chromium.org> Commit-Queue: Scott Violet <sky@chromium.org> Cr-Commit-Position: refs/heads/master@{#496688}
This commit is contained in:
@ -629,8 +629,6 @@ component("ash") {
|
||||
"wm/always_on_top_controller.h",
|
||||
"wm/ash_focus_rules.cc",
|
||||
"wm/ash_focus_rules.h",
|
||||
"wm/boot_splash_screen_chromeos.cc",
|
||||
"wm/boot_splash_screen_chromeos.h",
|
||||
"wm/container_finder.cc",
|
||||
"wm/container_finder.h",
|
||||
"wm/cursor_manager_chromeos.cc",
|
||||
|
@ -10,20 +10,6 @@
|
||||
namespace ash {
|
||||
namespace switches {
|
||||
|
||||
// Enables an animated transition from the boot splash screen (Chrome logo on a
|
||||
// white background) to the login screen. Implies
|
||||
// |kAshCopyHostBackgroundAtBoot| and doesn't make much sense if used in
|
||||
// conjunction with |kDisableBootAnimation| (since the transition begins at the
|
||||
// same time as the white/grayscale login screen animation).
|
||||
const char kAshAnimateFromBootSplashScreen[] =
|
||||
"ash-animate-from-boot-splash-screen";
|
||||
|
||||
// Copies the host window's content to the system background layer at startup.
|
||||
// Can make boot slightly slower, but also hides an even-longer awkward period
|
||||
// where we display a white background if the login wallpaper takes a long time
|
||||
// to load.
|
||||
const char kAshCopyHostBackgroundAtBoot[] = "ash-copy-host-background-at-boot";
|
||||
|
||||
// Enable keyboard shortcuts useful for debugging.
|
||||
const char kAshDebugShortcuts[] = "ash-debug-shortcuts";
|
||||
|
||||
|
@ -16,8 +16,6 @@ namespace switches {
|
||||
|
||||
// Please keep alphabetized.
|
||||
// TODO(sky): fix order!
|
||||
ASH_EXPORT extern const char kAshAnimateFromBootSplashScreen[];
|
||||
ASH_EXPORT extern const char kAshCopyHostBackgroundAtBoot[];
|
||||
ASH_EXPORT extern const char kAshDebugShortcuts[];
|
||||
ASH_EXPORT extern const char kAshDeveloperShortcuts[];
|
||||
ASH_EXPORT extern const char kAshDisableSmoothScreenRotation[];
|
||||
|
@ -36,7 +36,6 @@
|
||||
#include "ash/wallpaper/wallpaper_delegate.h"
|
||||
#include "ash/wallpaper/wallpaper_widget_controller.h"
|
||||
#include "ash/wm/always_on_top_controller.h"
|
||||
#include "ash/wm/boot_splash_screen_chromeos.h"
|
||||
#include "ash/wm/container_finder.h"
|
||||
#include "ash/wm/fullscreen_window_finder.h"
|
||||
#include "ash/wm/lock_action_handler_layout_manager.h"
|
||||
@ -89,12 +88,6 @@
|
||||
namespace ash {
|
||||
namespace {
|
||||
|
||||
// Duration for the animation that hides the boot splash screen, in
|
||||
// milliseconds. This should be short enough in relation to
|
||||
// wm/window_animation.cc's brightness/grayscale fade animation that the login
|
||||
// wallpaper image animation isn't hidden by the splash screen animation.
|
||||
const int kBootSplashScreenHideDurationMs = 500;
|
||||
|
||||
bool IsWindowAboveContainer(aura::Window* window,
|
||||
aura::Window* blocking_container) {
|
||||
std::vector<aura::Window*> target_path;
|
||||
@ -468,21 +461,9 @@ void RootWindowController::SetAnimatingWallpaperWidgetController(
|
||||
animating_wallpaper_widget_controller_.reset(controller);
|
||||
}
|
||||
|
||||
void RootWindowController::OnInitialWallpaperAnimationStarted() {
|
||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kAshAnimateFromBootSplashScreen) &&
|
||||
boot_splash_screen_.get()) {
|
||||
// Make the splash screen fade out so it doesn't obscure the wallpaper's
|
||||
// brightness/grayscale animation.
|
||||
boot_splash_screen_->StartHideAnimation(
|
||||
base::TimeDelta::FromMilliseconds(kBootSplashScreenHideDurationMs));
|
||||
}
|
||||
}
|
||||
|
||||
void RootWindowController::OnWallpaperAnimationFinished(views::Widget* widget) {
|
||||
// Make sure the wallpaper is visible.
|
||||
system_wallpaper_->SetColor(SK_ColorBLACK);
|
||||
boot_splash_screen_.reset();
|
||||
Shell::Get()->wallpaper_delegate()->OnWallpaperAnimationFinished();
|
||||
// Only removes old component when wallpaper animation finished. If we
|
||||
// remove the old one before the new wallpaper is done fading in there will
|
||||
@ -1000,15 +981,6 @@ void RootWindowController::CreateSystemWallpaper(
|
||||
color = kChromeOsBootColor;
|
||||
system_wallpaper_.reset(
|
||||
new SystemWallpaperController(GetRootWindow(), color));
|
||||
|
||||
// Make a copy of the system's boot splash screen so we can composite it
|
||||
// onscreen until the wallpaper is ready.
|
||||
if (is_boot_splash_screen &&
|
||||
(base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kAshCopyHostBackgroundAtBoot) ||
|
||||
base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kAshAnimateFromBootSplashScreen)))
|
||||
boot_splash_screen_.reset(new BootSplashScreen(GetHost()));
|
||||
}
|
||||
|
||||
void RootWindowController::EnableTouchHudProjection() {
|
||||
|
@ -50,7 +50,6 @@ class AlwaysOnTopController;
|
||||
class AnimatingWallpaperWidgetController;
|
||||
class AshTouchExplorationManager;
|
||||
class AshWindowTreeHost;
|
||||
class BootSplashScreen;
|
||||
enum class LoginStatus;
|
||||
class PanelLayoutManager;
|
||||
class Shelf;
|
||||
@ -202,11 +201,6 @@ class ASH_EXPORT RootWindowController : public ShellObserver {
|
||||
void SetAnimatingWallpaperWidgetController(
|
||||
AnimatingWallpaperWidgetController* controller);
|
||||
|
||||
// Called when the brightness/grayscale animation from white to the login
|
||||
// wallpaper image has started. Starts |boot_splash_screen_|'s hiding
|
||||
// animation (if the screen is non-NULL).
|
||||
void OnInitialWallpaperAnimationStarted();
|
||||
|
||||
// Called when the wallpaper animation is finished. Updates
|
||||
// |system_wallpaper_| to be black and drops |boot_splash_screen_| and moves
|
||||
// the wallpaper controller into the root window controller. |widget| holds
|
||||
@ -331,7 +325,6 @@ class ASH_EXPORT RootWindowController : public ShellObserver {
|
||||
|
||||
std::unique_ptr<SystemWallpaperController> system_wallpaper_;
|
||||
|
||||
std::unique_ptr<BootSplashScreen> boot_splash_screen_;
|
||||
// Responsible for initializing TouchExplorationController when spoken
|
||||
// feedback is on.
|
||||
std::unique_ptr<AshTouchExplorationManager> touch_exploration_manager_;
|
||||
|
@ -20,11 +20,9 @@ class ShowWallpaperAnimationObserver : public ui::ImplicitAnimationObserver,
|
||||
public views::WidgetObserver {
|
||||
public:
|
||||
ShowWallpaperAnimationObserver(RootWindowController* root_window_controller,
|
||||
views::Widget* wallpaper_widget,
|
||||
bool is_initial_animation)
|
||||
views::Widget* wallpaper_widget)
|
||||
: root_window_controller_(root_window_controller),
|
||||
wallpaper_widget_(wallpaper_widget),
|
||||
is_initial_animation_(is_initial_animation) {
|
||||
wallpaper_widget_(wallpaper_widget) {
|
||||
DCHECK(wallpaper_widget_);
|
||||
wallpaper_widget_->AddObserver(this);
|
||||
}
|
||||
@ -37,11 +35,6 @@ class ShowWallpaperAnimationObserver : public ui::ImplicitAnimationObserver,
|
||||
|
||||
private:
|
||||
// Overridden from ui::ImplicitAnimationObserver:
|
||||
void OnImplicitAnimationsScheduled() override {
|
||||
if (is_initial_animation_)
|
||||
root_window_controller_->OnInitialWallpaperAnimationStarted();
|
||||
}
|
||||
|
||||
void OnImplicitAnimationsCompleted() override {
|
||||
root_window_controller_->OnWallpaperAnimationFinished(wallpaper_widget_);
|
||||
delete this;
|
||||
@ -53,9 +46,6 @@ class ShowWallpaperAnimationObserver : public ui::ImplicitAnimationObserver,
|
||||
RootWindowController* root_window_controller_;
|
||||
views::Widget* wallpaper_widget_;
|
||||
|
||||
// Is this object observing the initial brightness/grayscale animation?
|
||||
const bool is_initial_animation_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ShowWallpaperAnimationObserver);
|
||||
};
|
||||
|
||||
@ -127,9 +117,9 @@ void WallpaperWidgetController::StartAnimating(
|
||||
if (widget_) {
|
||||
ui::ScopedLayerAnimationSettings settings(
|
||||
widget_->GetLayer()->GetAnimator());
|
||||
settings.AddObserver(new ShowWallpaperAnimationObserver(
|
||||
root_window_controller, widget_,
|
||||
Shell::Get()->wallpaper_delegate()->ShouldShowInitialAnimation()));
|
||||
// ShowWallpaperAnimationObserver deletes itself when animation is done.
|
||||
settings.AddObserver(
|
||||
new ShowWallpaperAnimationObserver(root_window_controller, widget_));
|
||||
// When |widget_| shows, AnimateShowWindowCommon() is called to do the
|
||||
// animation. Sets transition duration to 0 to avoid animating to the
|
||||
// show animation's initial values.
|
||||
|
@ -1,69 +0,0 @@
|
||||
// Copyright 2013 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "ash/wm/boot_splash_screen_chromeos.h"
|
||||
|
||||
#include "third_party/skia/include/core/SkBitmap.h"
|
||||
#include "ui/aura/window.h"
|
||||
#include "ui/aura/window_tree_host.h"
|
||||
#include "ui/compositor/layer.h"
|
||||
#include "ui/compositor/layer_type.h"
|
||||
#include "ui/compositor/paint_recorder.h"
|
||||
#include "ui/compositor/scoped_layer_animation_settings.h"
|
||||
#include "ui/gfx/canvas.h"
|
||||
|
||||
namespace ash {
|
||||
|
||||
// ui::LayerDelegate that copies the aura host window's content to a ui::Layer.
|
||||
class BootSplashScreen::CopyHostContentLayerDelegate
|
||||
: public ui::LayerDelegate {
|
||||
public:
|
||||
explicit CopyHostContentLayerDelegate(aura::WindowTreeHost* host)
|
||||
{
|
||||
}
|
||||
|
||||
~CopyHostContentLayerDelegate() override {}
|
||||
|
||||
// ui::LayerDelegate overrides:
|
||||
void OnPaintLayer(const ui::PaintContext& context) override {
|
||||
// It'd be safer to copy the area to a canvas in the constructor and then
|
||||
// copy from that canvas to this one here, but this appears to work (i.e. we
|
||||
// only call this before we draw our first frame) and it saves us an extra
|
||||
// copy.
|
||||
// TODO(derat): Instead of copying the data, use GLX_EXT_texture_from_pixmap
|
||||
// to create a zero-copy texture (when possible):
|
||||
// https://codereview.chromium.org/10543125
|
||||
// TODO(spang): Figure out what to do here.
|
||||
NOTIMPLEMENTED();
|
||||
}
|
||||
|
||||
void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) override {}
|
||||
|
||||
void OnDeviceScaleFactorChanged(float device_scale_factor) override {}
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(CopyHostContentLayerDelegate);
|
||||
};
|
||||
|
||||
BootSplashScreen::BootSplashScreen(aura::WindowTreeHost* host)
|
||||
: layer_delegate_(new CopyHostContentLayerDelegate(host)),
|
||||
layer_(new ui::Layer(ui::LAYER_TEXTURED)) {
|
||||
layer_->set_delegate(layer_delegate_.get());
|
||||
|
||||
ui::Layer* root_layer = host->window()->layer();
|
||||
layer_->SetBounds(gfx::Rect(host->window()->bounds().size()));
|
||||
root_layer->Add(layer_.get());
|
||||
root_layer->StackAtTop(layer_.get());
|
||||
}
|
||||
|
||||
BootSplashScreen::~BootSplashScreen() {}
|
||||
|
||||
void BootSplashScreen::StartHideAnimation(base::TimeDelta duration) {
|
||||
ui::ScopedLayerAnimationSettings settings(layer_->GetAnimator());
|
||||
settings.SetTransitionDuration(duration);
|
||||
settings.SetPreemptionStrategy(ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS);
|
||||
layer_->SetOpacity(0.0f);
|
||||
}
|
||||
|
||||
} // namespace ash
|
@ -1,50 +0,0 @@
|
||||
// Copyright 2013 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef ASH_WM_BOOT_SPLASH_SCREEN_CHROMEOS_H_
|
||||
#define ASH_WM_BOOT_SPLASH_SCREEN_CHROMEOS_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/time/time.h"
|
||||
|
||||
namespace aura {
|
||||
class WindowTreeHost;
|
||||
}
|
||||
|
||||
namespace ui {
|
||||
class Layer;
|
||||
}
|
||||
|
||||
namespace ash {
|
||||
|
||||
// BootSplashScreen manages a ui::Layer, stacked at the top of the root layer's
|
||||
// children, that displays a copy of the initial contents of the host window.
|
||||
// This allows us to continue displaying the Chrome OS boot splash screen (which
|
||||
// is displayed before Ash starts) after the compositor has taken over so we can
|
||||
// animate the transition between the splash screen and the login screen.
|
||||
class BootSplashScreen {
|
||||
public:
|
||||
explicit BootSplashScreen(aura::WindowTreeHost* host);
|
||||
~BootSplashScreen();
|
||||
|
||||
// Begins animating |layer_|'s opacity to 0 over |duration|.
|
||||
void StartHideAnimation(base::TimeDelta duration);
|
||||
|
||||
private:
|
||||
class CopyHostContentLayerDelegate;
|
||||
|
||||
// Copies the host window's content to |layer_|.
|
||||
std::unique_ptr<CopyHostContentLayerDelegate> layer_delegate_;
|
||||
|
||||
std::unique_ptr<ui::Layer> layer_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(BootSplashScreen);
|
||||
};
|
||||
|
||||
} // namespace ash
|
||||
|
||||
#endif // ASH_WM_BOOT_SPLASH_SCREEN_CHROMEOS_H_
|
Reference in New Issue
Block a user