Index: services/ui/ws/platform_display.h |
diff --git a/services/ui/ws/platform_display.h b/services/ui/ws/platform_display.h |
index a4cd5c88f856e9be5c971a56901c95754e4286e6..0e80d8e7ee615567fb1b3b9d4326732d42924916 100644 |
--- a/services/ui/ws/platform_display.h |
+++ b/services/ui/ws/platform_display.h |
@@ -79,10 +79,6 @@ class PlatformDisplay { |
virtual void SetCursorById(mojom::Cursor cursor) = 0; |
- virtual display::Display::Rotation GetRotation() = 0; |
- |
- virtual float GetDeviceScaleFactor() = 0; |
- |
virtual void UpdateTextInputState(const ui::TextInputState& state) = 0; |
virtual void SetImeVisibility(bool visible) = 0; |
@@ -94,6 +90,13 @@ class PlatformDisplay { |
virtual gfx::Rect GetBounds() const = 0; |
+ // Updates the viewport metrics for the display, returning true if any |
+ // metrics have changed. |
+ virtual bool UpdateViewportMetrics( |
+ const display::ViewportMetrics& metrics) = 0; |
+ |
+ virtual const display::ViewportMetrics& GetViewportMetrics() const = 0; |
+ |
virtual bool IsPrimaryDisplay() const = 0; |
// Notifies the PlatformDisplay that a connection to the gpu has been |
@@ -131,23 +134,19 @@ class DefaultPlatformDisplay : public PlatformDisplay, |
void SetCapture() override; |
void ReleaseCapture() override; |
void SetCursorById(mojom::Cursor cursor) override; |
- float GetDeviceScaleFactor() override; |
- display::Display::Rotation GetRotation() override; |
void UpdateTextInputState(const ui::TextInputState& state) override; |
void SetImeVisibility(bool visible) override; |
bool IsFramePending() const override; |
void RequestCopyOfOutput( |
std::unique_ptr<cc::CopyOutputRequest> output_request) override; |
gfx::Rect GetBounds() const override; |
+ bool UpdateViewportMetrics(const display::ViewportMetrics& metrics) override; |
+ const display::ViewportMetrics& GetViewportMetrics() const override; |
bool IsPrimaryDisplay() const override; |
void OnGpuChannelEstablished( |
scoped_refptr<gpu::GpuChannelHost> gpu_channel) override; |
private: |
- void UpdateMetrics(const gfx::Rect& bounds, |
- const gfx::Size& pixel_size, |
- float device_scale_factor); |
- |
// Update the root_location of located events to be relative to the origin |
// of this display. For example, if the origin of this display is (1800, 0) |
// and the location of the event is (100, 200) then the root_location will be |
@@ -170,7 +169,6 @@ class DefaultPlatformDisplay : public PlatformDisplay, |
// FrameGeneratorDelegate: |
ServerWindow* GetRootWindow() override; |
bool IsInHighContrastMode() override; |
- const ViewportMetrics& GetViewportMetrics() override; |
int64_t id_; |
@@ -181,7 +179,7 @@ class DefaultPlatformDisplay : public PlatformDisplay, |
PlatformDisplayDelegate* delegate_ = nullptr; |
std::unique_ptr<FrameGenerator> frame_generator_; |
- ViewportMetrics metrics_; |
+ display::ViewportMetrics metrics_; |
std::unique_ptr<ui::PlatformWindow> platform_window_; |
DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay); |