| 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 the gpu has been |
| 100 // established. |
| 101 virtual void OnGpuChannelEstablished( |
| 102 scoped_refptr<gpu::GpuChannelHost> gpu_channel) = 0; |
| 103 |
| 95 // Overrides factory for testing. Default (NULL) value indicates regular | 104 // Overrides factory for testing. Default (NULL) value indicates regular |
| 96 // (non-test) environment. | 105 // (non-test) environment. |
| 97 static void set_factory_for_testing(PlatformDisplayFactory* factory) { | 106 static void set_factory_for_testing(PlatformDisplayFactory* factory) { |
| 98 PlatformDisplay::factory_ = factory; | 107 PlatformDisplay::factory_ = factory; |
| 99 } | 108 } |
| 100 | 109 |
| 101 private: | 110 private: |
| 102 // Static factory instance (always NULL for non-test). | 111 // Static factory instance (always NULL for non-test). |
| 103 static PlatformDisplayFactory* factory_; | 112 static PlatformDisplayFactory* factory_; |
| 104 }; | 113 }; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 124 void SetCursorById(int32_t cursor) override; | 133 void SetCursorById(int32_t cursor) override; |
| 125 float GetDeviceScaleFactor() override; | 134 float GetDeviceScaleFactor() override; |
| 126 display::Display::Rotation GetRotation() override; | 135 display::Display::Rotation GetRotation() override; |
| 127 void UpdateTextInputState(const ui::TextInputState& state) override; | 136 void UpdateTextInputState(const ui::TextInputState& state) override; |
| 128 void SetImeVisibility(bool visible) override; | 137 void SetImeVisibility(bool visible) override; |
| 129 bool IsFramePending() const override; | 138 bool IsFramePending() const override; |
| 130 void RequestCopyOfOutput( | 139 void RequestCopyOfOutput( |
| 131 std::unique_ptr<cc::CopyOutputRequest> output_request) override; | 140 std::unique_ptr<cc::CopyOutputRequest> output_request) override; |
| 132 gfx::Rect GetBounds() const override; | 141 gfx::Rect GetBounds() const override; |
| 133 bool IsPrimaryDisplay() const override; | 142 bool IsPrimaryDisplay() const override; |
| 143 void OnGpuChannelEstablished( |
| 144 scoped_refptr<gpu::GpuChannelHost> gpu_channel) override; |
| 134 | 145 |
| 135 private: | 146 private: |
| 136 void UpdateMetrics(const gfx::Rect& bounds, float device_scale_factor); | 147 void UpdateMetrics(const gfx::Rect& bounds, float device_scale_factor); |
| 137 | 148 |
| 138 // Update the root_location of located events to be relative to the origin | 149 // 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) | 150 // 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 | 151 // and the location of the event is (100, 200) then the root_location will be |
| 141 // updated to be (1900, 200). | 152 // updated to be (1900, 200). |
| 142 void UpdateEventRootLocation(ui::LocatedEvent* event); | 153 void UpdateEventRootLocation(ui::LocatedEvent* event); |
| 143 | 154 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 174 std::unique_ptr<ui::PlatformWindow> platform_window_; | 185 std::unique_ptr<ui::PlatformWindow> platform_window_; |
| 175 | 186 |
| 176 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay); | 187 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay); |
| 177 }; | 188 }; |
| 178 | 189 |
| 179 } // namespace ws | 190 } // namespace ws |
| 180 | 191 |
| 181 } // namespace ui | 192 } // namespace ui |
| 182 | 193 |
| 183 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ | 194 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ |
| OLD | NEW |