Chromium Code Reviews| 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 COMPONENTS_MUS_WS_PLATFORM_DISPLAY_H_ | 5 #ifndef COMPONENTS_MUS_WS_PLATFORM_DISPLAY_H_ |
| 6 #define COMPONENTS_MUS_WS_PLATFORM_DISPLAY_H_ | 6 #define COMPONENTS_MUS_WS_PLATFORM_DISPLAY_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 } // namespace ui | 46 } // namespace ui |
| 47 | 47 |
| 48 namespace mus { | 48 namespace mus { |
| 49 | 49 |
| 50 class GpuState; | 50 class GpuState; |
| 51 class SurfacesState; | 51 class SurfacesState; |
| 52 class DisplayCompositor; | 52 class DisplayCompositor; |
| 53 | 53 |
| 54 namespace ws { | 54 namespace ws { |
| 55 | 55 |
| 56 namespace test { | |
| 57 class PlatformDisplayTest; | |
| 58 } | |
| 59 | |
| 56 class EventDispatcher; | 60 class EventDispatcher; |
| 57 class PlatformDisplayFactory; | 61 class PlatformDisplayFactory; |
| 58 class ServerWindow; | 62 class ServerWindow; |
| 59 | 63 |
| 60 struct ViewportMetrics { | 64 struct ViewportMetrics { |
| 61 gfx::Size size_in_pixels; | 65 gfx::Size size_in_pixels; |
| 62 float device_scale_factor = 0.f; | 66 float device_scale_factor = 0.f; |
| 63 }; | 67 }; |
| 64 | 68 |
| 65 // PlatformDisplay is used to connect the root ServerWindow to a display. | 69 // PlatformDisplay is used to connect the root ServerWindow to a display. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 void SetCursorById(int32_t cursor) override; | 134 void SetCursorById(int32_t cursor) override; |
| 131 float GetDeviceScaleFactor() override; | 135 float GetDeviceScaleFactor() override; |
| 132 mojom::Rotation GetRotation() override; | 136 mojom::Rotation GetRotation() override; |
| 133 void UpdateTextInputState(const ui::TextInputState& state) override; | 137 void UpdateTextInputState(const ui::TextInputState& state) override; |
| 134 void SetImeVisibility(bool visible) override; | 138 void SetImeVisibility(bool visible) override; |
| 135 bool IsFramePending() const override; | 139 bool IsFramePending() const override; |
| 136 void RequestCopyOfOutput( | 140 void RequestCopyOfOutput( |
| 137 std::unique_ptr<cc::CopyOutputRequest> output_request) override; | 141 std::unique_ptr<cc::CopyOutputRequest> output_request) override; |
| 138 int64_t GetDisplayId() const override; | 142 int64_t GetDisplayId() const override; |
| 139 | 143 |
| 144 void set_delegate_for_testing(PlatformDisplayDelegate* delegate) { | |
| 145 delegate_ = delegate; | |
| 146 } | |
| 147 | |
| 140 private: | 148 private: |
| 149 friend class mus::ws::test::PlatformDisplayTest; | |
|
sky
2016/06/27 15:17:08
If you're going to friend this, then don't bother
mfomitchev
2016/06/30 22:06:03
Done.
| |
| 150 | |
| 141 void WantToDraw(); | 151 void WantToDraw(); |
| 142 | 152 |
| 143 // This method initiates a top level redraw of the display. | 153 // This method initiates a top level redraw of the display. |
| 144 // TODO(fsamuel): This should use vblank as a signal rather than a timer | 154 // TODO(fsamuel): This should use vblank as a signal rather than a timer |
| 145 // http://crbug.com/533042 | 155 // http://crbug.com/533042 |
| 146 void Draw(); | 156 void Draw(); |
| 147 | 157 |
| 148 // This is called after cc::Display has completed generating a new frame | 158 // This is called after cc::Display has completed generating a new frame |
| 149 // for the display. TODO(fsamuel): Idle time processing should happen here | 159 // for the display. TODO(fsamuel): Idle time processing should happen here |
| 150 // if there is budget for it. | 160 // if there is budget for it. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 186 base::WeakPtrFactory<DefaultPlatformDisplay> weak_factory_; | 196 base::WeakPtrFactory<DefaultPlatformDisplay> weak_factory_; |
| 187 | 197 |
| 188 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay); | 198 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay); |
| 189 }; | 199 }; |
| 190 | 200 |
| 191 } // namespace ws | 201 } // namespace ws |
| 192 | 202 |
| 193 } // namespace mus | 203 } // namespace mus |
| 194 | 204 |
| 195 #endif // COMPONENTS_MUS_WS_PLATFORM_DISPLAY_H_ | 205 #endif // COMPONENTS_MUS_WS_PLATFORM_DISPLAY_H_ |
| OLD | NEW |