OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SERVICES_UI_WS_FRAME_GENERATOR_DELEGATE_H_ | 5 #ifndef SERVICES_UI_WS_FRAME_GENERATOR_DELEGATE_H_ |
6 #define SERVICES_UI_WS_FRAME_GENERATOR_DELEGATE_H_ | 6 #define SERVICES_UI_WS_FRAME_GENERATOR_DELEGATE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "services/ui/ws/viewport_metrics.h" |
9 | 10 |
10 namespace ui { | 11 namespace ui { |
11 namespace ws { | 12 namespace ws { |
12 | 13 |
13 class ServerWindow; | 14 class ServerWindow; |
14 | 15 |
15 struct ViewportMetrics { | |
16 gfx::Rect bounds; | |
17 float device_scale_factor = 0.f; | |
18 }; | |
19 | |
20 class FrameGeneratorDelegate { | 16 class FrameGeneratorDelegate { |
21 public: | 17 public: |
22 // Returns the root window of the display. | 18 // Returns the root window of the display. |
23 virtual ServerWindow* GetRootWindow() = 0; | 19 virtual ServerWindow* GetRootWindow() = 0; |
24 | 20 |
25 // Called when a compositor frame is finished drawing. | 21 // Called when a compositor frame is finished drawing. |
26 virtual void OnCompositorFrameDrawn() = 0; | 22 virtual void OnCompositorFrameDrawn() = 0; |
27 | 23 |
28 virtual bool IsInHighContrastMode() = 0; | 24 virtual bool IsInHighContrastMode() = 0; |
29 | 25 |
30 virtual const ViewportMetrics& GetViewportMetrics() = 0; | 26 virtual const ViewportMetrics& GetViewportMetrics() = 0; |
31 | 27 |
32 protected: | 28 protected: |
33 virtual ~FrameGeneratorDelegate() {} | 29 virtual ~FrameGeneratorDelegate() {} |
34 }; | 30 }; |
35 | 31 |
36 } // namespace ws | 32 } // namespace ws |
37 } // namespace ui | 33 } // namespace ui |
38 | 34 |
39 #endif // SERVICES_UI_WS_FRAME_GENERATOR_DELEGATE_H_ | 35 #endif // SERVICES_UI_WS_FRAME_GENERATOR_DELEGATE_H_ |
OLD | NEW |