Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2385)

Unified Diff: services/ui/ws/platform_display_default.cc

Issue 2763143002: Remove FrameGenerator::root_window_ (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/ui/ws/platform_display_default.cc
diff --git a/services/ui/ws/platform_display_default.cc b/services/ui/ws/platform_display_default.cc
index a126d699c0df820a8eb3ad71a2dd2ebf75ed8794..9316d97060cf3dc503dcb914aba5bf6094fe5c68 100644
--- a/services/ui/ws/platform_display_default.cc
+++ b/services/ui/ws/platform_display_default.cc
@@ -37,11 +37,12 @@ PlatformDisplayDefault::PlatformDisplayDefault(
image_cursors_(new ImageCursors),
#endif
metrics_(metrics),
- widget_(gfx::kNullAcceleratedWidget),
- init_device_scale_factor_(metrics.device_scale_factor) {
+ widget_(gfx::kNullAcceleratedWidget) {
+ root_window_->AddObserver(this);
}
PlatformDisplayDefault::~PlatformDisplayDefault() {
+ root_window_->RemoveObserver(this);
// Don't notify the delegate from the destructor.
delegate_ = nullptr;
@@ -257,8 +258,9 @@ void PlatformDisplayDefault::OnAcceleratedWidgetAvailable(
std::move(display_private),
std::move(compositor_frame_sink_client_request));
frame_generator_ = base::MakeUnique<FrameGenerator>(
- root_window_, std::move(display_client_compositor_frame_sink));
- frame_generator_->SetDeviceScaleFactor(init_device_scale_factor_);
+ std::move(display_client_compositor_frame_sink), root_window_->visible(),
+ root_window_->bounds());
+ frame_generator_->SetDeviceScaleFactor(metrics_.device_scale_factor);
}
void PlatformDisplayDefault::OnAcceleratedWidgetDestroyed() {
@@ -267,5 +269,18 @@ void PlatformDisplayDefault::OnAcceleratedWidgetDestroyed() {
void PlatformDisplayDefault::OnActivationChanged(bool active) {}
+void PlatformDisplayDefault::OnWindowBoundsChanged(
+ ServerWindow* window,
+ const gfx::Rect& old_bounds,
+ const gfx::Rect& new_bounds) {
+ if (frame_generator_)
+ frame_generator_->OnWindowBoundsChanged(new_bounds);
+}
+
+void PlatformDisplayDefault::OnWindowVisibilityChanged(ServerWindow* window) {
+ if (frame_generator_)
+ frame_generator_->OnWindowVisibilityChanged(window->visible());
+}
+
} // namespace ws
} // namespace ui
« services/ui/ws/frame_generator.cc ('K') | « services/ui/ws/platform_display_default.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698