#include "ash/wm/boot_splash_screen_chromeos.h"
#include "third_party/skia/include/core/SkBitmap.h"
-#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
+#include "ui/aura/window_tree_host.h"
#include "ui/base/x/x11_util.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_type.h"
#include "ui/gfx/canvas.h"
namespace ash {
-namespace internal {
// ui::LayerDelegate that copies the aura host window's content to a ui::Layer.
class BootSplashScreen::CopyHostContentLayerDelegate
: public ui::LayerDelegate {
public:
- explicit CopyHostContentLayerDelegate(aura::RootWindow* root_window)
- : root_window_(root_window) {
+ explicit CopyHostContentLayerDelegate(aura::WindowTreeHost* host)
+ : host_(host) {
}
virtual ~CopyHostContentLayerDelegate() {}
// 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
- ui::CopyAreaToCanvas(root_window_->host()->GetAcceleratedWidget(),
- root_window_->host()->GetBounds(), gfx::Point(), canvas);
+#if defined(USE_X11)
+ ui::CopyAreaToCanvas(host_->GetAcceleratedWidget(),
+ host_->GetBounds(), gfx::Point(), canvas);
+#else
+ // TODO(spang): Figure out what to do here.
+ NOTIMPLEMENTED();
+#endif
}
+ virtual void OnDelegatedFrameDamage(
+ const gfx::Rect& damage_rect_in_dip) OVERRIDE {}
+
virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {}
virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE {
}
private:
- aura::RootWindow* root_window_; // not owned
+ aura::WindowTreeHost* host_; // not owned
DISALLOW_COPY_AND_ASSIGN(CopyHostContentLayerDelegate);
};
-BootSplashScreen::BootSplashScreen(aura::RootWindow* root_window)
- : layer_delegate_(new CopyHostContentLayerDelegate(root_window)),
+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 = root_window->window()->layer();
- layer_->SetBounds(gfx::Rect(root_layer->bounds().size()));
+ 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());
}
layer_->SetOpacity(0.0f);
}
-} // namespace internal
} // namespace ash