Chromium Code Reviews| Index: ui/aura/window_tree_host.cc |
| diff --git a/ui/aura/window_tree_host.cc b/ui/aura/window_tree_host.cc |
| index 5bf1eb1d8ca4414f261ea1a7d99b0e0b2028a4ce..c1d1c40d960fa026e39dc896149a1cb087605580 100644 |
| --- a/ui/aura/window_tree_host.cc |
| +++ b/ui/aura/window_tree_host.cc |
| @@ -37,10 +37,6 @@ namespace aura { |
| const char kWindowTreeHostForAcceleratedWidget[] = |
| "__AURA_WINDOW_TREE_HOST_ACCELERATED_WIDGET__"; |
| -float GetDeviceScaleFactorFromDisplay(Window* window) { |
| - return ui::GetScaleFactorForNativeView(window); |
| -} |
| - |
| //////////////////////////////////////////////////////////////////////////////// |
| // WindowTreeHost, public: |
| @@ -278,10 +274,12 @@ void WindowTreeHost::CreateCompositor(const cc::FrameSinkId& frame_sink_id) { |
| } |
| void WindowTreeHost::InitCompositor() { |
| - compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), |
| + display::Display display = |
| + display::Screen::GetScreen()->GetDisplayNearestWindow(window()); |
| + compositor_->SetScaleAndSize(display.device_scale_factor(), |
| GetBoundsInPixels().size()); |
| compositor_->SetRootLayer(window()->layer()); |
| - compositor_->SetDisplayColorProfile(GetICCProfileForCurrentDisplay()); |
| + compositor_->SetDisplayColorProfile(display.icc_profile()); |
| } |
| void WindowTreeHost::OnAcceleratedWidgetAvailable() { |
| @@ -306,7 +304,7 @@ void WindowTreeHost::OnHostResizedInPixels( |
| output_surface_padding_in_pixels_.height()); |
| // The compositor should have the same size as the native root window host. |
| // Get the latest scale from display because it might have been changed. |
| - compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), |
| + compositor_->SetScaleAndSize(ui::GetScaleFactorForNativeView(window()), |
|
hubbe
2017/06/21 21:49:13
What does this change do?
ccameron
2017/06/21 23:21:48
Oh, I just inlined the above GetDeviceScaleFactorF
|
| adjusted_size); |
| gfx::Size layer_size = GetBoundsInPixels().size(); |
| @@ -337,12 +335,6 @@ void WindowTreeHost::OnHostLostWindowCapture() { |
| capture_window->ReleaseCapture(); |
| } |
| -gfx::ICCProfile WindowTreeHost::GetICCProfileForCurrentDisplay() { |
| - // TODO(hubbe): Get the color space from the *current* monitor and |
| - // update it when window is moved or color space configuration changes. |
| - return gfx::ICCProfile::FromBestMonitor(); |
| -} |
| - |
| ui::EventSink* WindowTreeHost::GetEventSink() { |
| return dispatcher_.get(); |
| } |