| Index: components/mus/ws/platform_display.h
|
| diff --git a/components/mus/ws/platform_display.h b/components/mus/ws/platform_display.h
|
| index 632516161b881a471507156d86d950f464feb9ef..32e82cb02452bd1de057dadaa9e9865711dbfdda 100644
|
| --- a/components/mus/ws/platform_display.h
|
| +++ b/components/mus/ws/platform_display.h
|
| @@ -58,6 +58,11 @@ class EventDispatcher;
|
| class PlatformDisplayFactory;
|
| class ServerWindow;
|
|
|
| +struct ViewportMetrics {
|
| + gfx::Size size_in_pixels;
|
| + float device_scale_factor = 0.f;
|
| +};
|
| +
|
| // PlatformDisplay is used to connect the root ServerWindow to a display.
|
| class PlatformDisplay {
|
| public:
|
| @@ -83,7 +88,7 @@ class PlatformDisplay {
|
|
|
| virtual mojom::Rotation GetRotation() = 0;
|
|
|
| - virtual const mojom::ViewportMetrics& GetViewportMetrics() = 0;
|
| + virtual float GetDeviceScaleFactor() = 0;
|
|
|
| virtual void UpdateTextInputState(const ui::TextInputState& state) = 0;
|
| virtual void SetImeVisibility(bool visible) = 0;
|
| @@ -122,7 +127,7 @@ class DefaultPlatformDisplay : public PlatformDisplay,
|
| void SetCapture() override;
|
| void ReleaseCapture() override;
|
| void SetCursorById(int32_t cursor) override;
|
| - const mojom::ViewportMetrics& GetViewportMetrics() override;
|
| + float GetDeviceScaleFactor() override;
|
| mojom::Rotation GetRotation() override;
|
| void UpdateTextInputState(const ui::TextInputState& state) override;
|
| void SetImeVisibility(bool visible) override;
|
| @@ -142,7 +147,7 @@ class DefaultPlatformDisplay : public PlatformDisplay,
|
| // for the display. TODO(fsamuel): Idle time processing should happen here
|
| // if there is budget for it.
|
| void DidDraw(cc::SurfaceDrawStatus status);
|
| - void UpdateMetrics(const gfx::Size& size, float device_pixel_ratio);
|
| + void UpdateMetrics(const gfx::Size& size, float device_scale_factor);
|
| std::unique_ptr<cc::CompositorFrame> GenerateCompositorFrame();
|
|
|
| // ui::PlatformWindowDelegate:
|
| @@ -154,7 +159,7 @@ class DefaultPlatformDisplay : public PlatformDisplay,
|
| void OnWindowStateChanged(ui::PlatformWindowState new_state) override;
|
| void OnLostCapture() override;
|
| void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget,
|
| - float device_pixel_ratio) override;
|
| + float device_scale_factor) override;
|
| void OnAcceleratedWidgetDestroyed() override;
|
| void OnActivationChanged(bool active) override;
|
|
|
| @@ -162,7 +167,7 @@ class DefaultPlatformDisplay : public PlatformDisplay,
|
| scoped_refptr<SurfacesState> surfaces_state_;
|
| PlatformDisplayDelegate* delegate_;
|
|
|
| - mojom::ViewportMetrics metrics_;
|
| + ViewportMetrics metrics_;
|
| gfx::Rect dirty_rect_;
|
| base::Timer draw_timer_;
|
| bool frame_pending_;
|
|
|