Commit a384b41d authored by sadrul's avatar sadrul Committed by Commit bot

aura: Allow platform to choose how it retrieves ICCProfile.

In mus, the client should get the ICCProfile from the mus server,
instead of from the native platform. So get the ICCProfile from
a virtual function so that the platform can override it.

BUG=647510

Review-Url: https://codereview.chromium.org/2345283002
Cr-Commit-Position: refs/heads/master@{#419410}
parent 43e6a6d0
...@@ -69,11 +69,8 @@ void WindowTreeHost::InitCompositor() { ...@@ -69,11 +69,8 @@ void WindowTreeHost::InitCompositor() {
compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()),
GetBounds().size()); GetBounds().size());
compositor_->SetRootLayer(window()->layer()); compositor_->SetRootLayer(window()->layer());
// TODO(hubbe): Get the color space from the *current* monitor and
// update it when window is moved or color space configuration changes.
compositor_->SetDisplayColorSpace( compositor_->SetDisplayColorSpace(
gfx::ICCProfile::FromBestMonitor().GetColorSpace()); GetICCProfileForCurrentDisplay().GetColorSpace());
} }
void WindowTreeHost::AddObserver(WindowTreeHostObserver* observer) { void WindowTreeHost::AddObserver(WindowTreeHostObserver* observer) {
...@@ -313,6 +310,12 @@ void WindowTreeHost::OnHostLostWindowCapture() { ...@@ -313,6 +310,12 @@ void WindowTreeHost::OnHostLostWindowCapture() {
capture_window->ReleaseCapture(); 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::EventProcessor* WindowTreeHost::GetEventProcessor() { ui::EventProcessor* WindowTreeHost::GetEventProcessor() {
return event_processor(); return event_processor();
} }
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "ui/gfx/native_widget_types.h" #include "ui/gfx/native_widget_types.h"
namespace gfx { namespace gfx {
class ICCProfile;
class Insets; class Insets;
class Point; class Point;
class Rect; class Rect;
...@@ -214,6 +215,8 @@ class AURA_EXPORT WindowTreeHost : public ui::internal::InputMethodDelegate, ...@@ -214,6 +215,8 @@ class AURA_EXPORT WindowTreeHost : public ui::internal::InputMethodDelegate,
// Hides the WindowTreeHost. // Hides the WindowTreeHost.
virtual void HideImpl() = 0; virtual void HideImpl() = 0;
virtual gfx::ICCProfile GetICCProfileForCurrentDisplay();
// Overridden from ui::EventSource: // Overridden from ui::EventSource:
ui::EventProcessor* GetEventProcessor() override; ui::EventProcessor* GetEventProcessor() override;
......
...@@ -94,4 +94,9 @@ void WindowTreeHostMus::OnCloseRequest() { ...@@ -94,4 +94,9 @@ void WindowTreeHostMus::OnCloseRequest() {
OnHostCloseRequested(); OnHostCloseRequested();
} }
gfx::ICCProfile WindowTreeHostMus::GetICCProfileForCurrentDisplay() {
// TODO: This should read the profile from mus. crbug.com/647510
return gfx::ICCProfile();
}
} // namespace views } // namespace views
...@@ -40,6 +40,7 @@ class VIEWS_MUS_EXPORT WindowTreeHostMus : public aura::WindowTreeHostPlatform { ...@@ -40,6 +40,7 @@ class VIEWS_MUS_EXPORT WindowTreeHostMus : public aura::WindowTreeHostPlatform {
void OnClosed() override; void OnClosed() override;
void OnActivationChanged(bool active) override; void OnActivationChanged(bool active) override;
void OnCloseRequest() override; void OnCloseRequest() override;
gfx::ICCProfile GetICCProfileForCurrentDisplay() override;
NativeWidgetMus* native_widget_; NativeWidgetMus* native_widget_;
std::unique_ptr<InputMethodMus> input_method_; std::unique_ptr<InputMethodMus> input_method_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment