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

Unified Diff: ui/aura/window_tree_host.cc

Issue 2950183002: color: Use ICCProfile from display::Display instead of FromBestMonitor (Closed)
Patch Set: Use forced color profile in display::Display ctor Created 3 years, 6 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 | « ui/aura/window_tree_host.h ('k') | ui/compositor/compositor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f8a651927fdcf644588eda8c4c5a65e758d4c991 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_->SetDisplayColorSpace(display.color_space());
}
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()),
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();
}
« no previous file with comments | « ui/aura/window_tree_host.h ('k') | ui/compositor/compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698