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

Unified Diff: components/mus/ws/platform_display.h

Issue 2021483002: mus: Remove ViewportMetrics from mojom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 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 | « components/mus/ws/display.cc ('k') | components/mus/ws/platform_display.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « components/mus/ws/display.cc ('k') | components/mus/ws/platform_display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698