OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PLATFORM_DISPLAY_H_ | 5 #ifndef SERVICES_UI_WS_PLATFORM_DISPLAY_H_ |
6 #define SERVICES_UI_WS_PLATFORM_DISPLAY_H_ | 6 #define SERVICES_UI_WS_PLATFORM_DISPLAY_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 15 matching lines...) Expand all Loading... | |
26 #include "ui/platform_window/platform_window_delegate.h" | 26 #include "ui/platform_window/platform_window_delegate.h" |
27 | 27 |
28 namespace cc { | 28 namespace cc { |
29 class CopyOutputRequest; | 29 class CopyOutputRequest; |
30 } // namespace cc | 30 } // namespace cc |
31 | 31 |
32 namespace gfx { | 32 namespace gfx { |
33 class Rect; | 33 class Rect; |
34 } | 34 } |
35 | 35 |
36 namespace gpu { | |
37 class GpuChannelHost; | |
38 } | |
39 | |
36 namespace ui { | 40 namespace ui { |
37 class CursorLoader; | 41 class CursorLoader; |
38 class PlatformWindow; | 42 class PlatformWindow; |
39 struct TextInputState; | 43 struct TextInputState; |
40 } // namespace ui | 44 } // namespace ui |
41 | 45 |
42 namespace ui { | 46 namespace ui { |
43 | 47 |
44 class FrameGenerator; | 48 class FrameGenerator; |
45 | 49 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 // Returns true if a compositor frame has been submitted but not drawn yet. | 89 // Returns true if a compositor frame has been submitted but not drawn yet. |
86 virtual bool IsFramePending() const = 0; | 90 virtual bool IsFramePending() const = 0; |
87 | 91 |
88 virtual void RequestCopyOfOutput( | 92 virtual void RequestCopyOfOutput( |
89 std::unique_ptr<cc::CopyOutputRequest> output_request) = 0; | 93 std::unique_ptr<cc::CopyOutputRequest> output_request) = 0; |
90 | 94 |
91 virtual gfx::Rect GetBounds() const = 0; | 95 virtual gfx::Rect GetBounds() const = 0; |
92 | 96 |
93 virtual bool IsPrimaryDisplay() const = 0; | 97 virtual bool IsPrimaryDisplay() const = 0; |
94 | 98 |
99 // Notifies the PlatformDisplay that a connection to gpu has been established. | |
sky
2016/08/26 16:46:30
'gpu' -> 'the gpu'
sadrul
2016/08/26 17:23:50
Done.
| |
100 virtual void OnGpuChannelEstablished( | |
101 scoped_refptr<gpu::GpuChannelHost> gpu_channel) = 0; | |
102 | |
95 // Overrides factory for testing. Default (NULL) value indicates regular | 103 // Overrides factory for testing. Default (NULL) value indicates regular |
96 // (non-test) environment. | 104 // (non-test) environment. |
97 static void set_factory_for_testing(PlatformDisplayFactory* factory) { | 105 static void set_factory_for_testing(PlatformDisplayFactory* factory) { |
98 PlatformDisplay::factory_ = factory; | 106 PlatformDisplay::factory_ = factory; |
99 } | 107 } |
100 | 108 |
101 private: | 109 private: |
102 // Static factory instance (always NULL for non-test). | 110 // Static factory instance (always NULL for non-test). |
103 static PlatformDisplayFactory* factory_; | 111 static PlatformDisplayFactory* factory_; |
104 }; | 112 }; |
(...skipping 19 matching lines...) Expand all Loading... | |
124 void SetCursorById(int32_t cursor) override; | 132 void SetCursorById(int32_t cursor) override; |
125 float GetDeviceScaleFactor() override; | 133 float GetDeviceScaleFactor() override; |
126 display::Display::Rotation GetRotation() override; | 134 display::Display::Rotation GetRotation() override; |
127 void UpdateTextInputState(const ui::TextInputState& state) override; | 135 void UpdateTextInputState(const ui::TextInputState& state) override; |
128 void SetImeVisibility(bool visible) override; | 136 void SetImeVisibility(bool visible) override; |
129 bool IsFramePending() const override; | 137 bool IsFramePending() const override; |
130 void RequestCopyOfOutput( | 138 void RequestCopyOfOutput( |
131 std::unique_ptr<cc::CopyOutputRequest> output_request) override; | 139 std::unique_ptr<cc::CopyOutputRequest> output_request) override; |
132 gfx::Rect GetBounds() const override; | 140 gfx::Rect GetBounds() const override; |
133 bool IsPrimaryDisplay() const override; | 141 bool IsPrimaryDisplay() const override; |
142 void OnGpuChannelEstablished( | |
143 scoped_refptr<gpu::GpuChannelHost> gpu_channel) override; | |
134 | 144 |
135 private: | 145 private: |
136 void UpdateMetrics(const gfx::Rect& bounds, float device_scale_factor); | 146 void UpdateMetrics(const gfx::Rect& bounds, float device_scale_factor); |
137 | 147 |
138 // Update the root_location of located events to be relative to the origin | 148 // Update the root_location of located events to be relative to the origin |
139 // of this display. For example, if the origin of this display is (1800, 0) | 149 // of this display. For example, if the origin of this display is (1800, 0) |
140 // and the location of the event is (100, 200) then the root_location will be | 150 // and the location of the event is (100, 200) then the root_location will be |
141 // updated to be (1900, 200). | 151 // updated to be (1900, 200). |
142 void UpdateEventRootLocation(ui::LocatedEvent* event); | 152 void UpdateEventRootLocation(ui::LocatedEvent* event); |
143 | 153 |
(...skipping 30 matching lines...) Expand all Loading... | |
174 std::unique_ptr<ui::PlatformWindow> platform_window_; | 184 std::unique_ptr<ui::PlatformWindow> platform_window_; |
175 | 185 |
176 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay); | 186 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay); |
177 }; | 187 }; |
178 | 188 |
179 } // namespace ws | 189 } // namespace ws |
180 | 190 |
181 } // namespace ui | 191 } // namespace ui |
182 | 192 |
183 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ | 193 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ |
OLD | NEW |