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

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

Issue 2763143002: Remove FrameGenerator::root_window_ (Closed)
Patch Set: Addressed comments 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
« no previous file with comments | « services/ui/ws/platform_display_default.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 43253557736862421cfe066d25cde62fde2cf1ca..09d5e317f13f48f8dcd9ea513ffab80979d3b0d3 100644
--- a/services/ui/ws/platform_display_default.cc
+++ b/services/ui/ws/platform_display_default.cc
@@ -37,8 +37,7 @@ PlatformDisplayDefault::PlatformDisplayDefault(
image_cursors_(new ImageCursors),
#endif
metrics_(metrics),
- widget_(gfx::kNullAcceleratedWidget),
- init_device_scale_factor_(metrics.device_scale_factor) {
+ widget_(gfx::kNullAcceleratedWidget) {
}
PlatformDisplayDefault::~PlatformDisplayDefault() {
@@ -141,8 +140,10 @@ bool PlatformDisplayDefault::UpdateViewportMetrics(
}
metrics_ = metrics;
- if (frame_generator_)
+ if (frame_generator_) {
frame_generator_->SetDeviceScaleFactor(metrics_.device_scale_factor);
+ frame_generator_->OnWindowSizeChanged(metrics_.bounds_in_pixels.size());
+ }
return true;
}
@@ -265,8 +266,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));
+ frame_generator_->OnWindowSizeChanged(root_window_->bounds().size());
+ frame_generator_->SetDeviceScaleFactor(metrics_.device_scale_factor);
}
void PlatformDisplayDefault::OnAcceleratedWidgetDestroyed() {
« no previous file with comments | « 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