| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 class PlatformDisplay { | 58 class PlatformDisplay { |
| 59 public: | 59 public: |
| 60 virtual ~PlatformDisplay() {} | 60 virtual ~PlatformDisplay() {} |
| 61 | 61 |
| 62 static PlatformDisplay* Create(const PlatformDisplayInitParams& init_params); | 62 static PlatformDisplay* Create(const PlatformDisplayInitParams& init_params); |
| 63 | 63 |
| 64 virtual int64_t GetId() const = 0; | 64 virtual int64_t GetId() const = 0; |
| 65 | 65 |
| 66 virtual void Init(PlatformDisplayDelegate* delegate) = 0; | 66 virtual void Init(PlatformDisplayDelegate* delegate) = 0; |
| 67 | 67 |
| 68 // Schedules a paint for the specified region in the coordinates of |window|. | |
| 69 virtual void SchedulePaint(const ServerWindow* window, | |
| 70 const gfx::Rect& bounds) = 0; | |
| 71 | |
| 72 virtual void SetViewportSize(const gfx::Size& size) = 0; | 68 virtual void SetViewportSize(const gfx::Size& size) = 0; |
| 73 | 69 |
| 74 virtual void SetTitle(const base::string16& title) = 0; | 70 virtual void SetTitle(const base::string16& title) = 0; |
| 75 | 71 |
| 76 virtual void SetCapture() = 0; | 72 virtual void SetCapture() = 0; |
| 77 | 73 |
| 78 virtual void ReleaseCapture() = 0; | 74 virtual void ReleaseCapture() = 0; |
| 79 | 75 |
| 80 virtual void SetCursorById(mojom::Cursor cursor) = 0; | 76 virtual void SetCursorById(mojom::Cursor cursor) = 0; |
| 81 | 77 |
| 82 virtual void UpdateTextInputState(const ui::TextInputState& state) = 0; | 78 virtual void UpdateTextInputState(const ui::TextInputState& state) = 0; |
| 83 virtual void SetImeVisibility(bool visible) = 0; | 79 virtual void SetImeVisibility(bool visible) = 0; |
| 84 | 80 |
| 85 // Returns true if a compositor frame has been submitted but not drawn yet. | |
| 86 virtual bool IsFramePending() const = 0; | |
| 87 | |
| 88 virtual gfx::Rect GetBounds() const = 0; | 81 virtual gfx::Rect GetBounds() const = 0; |
| 89 | 82 |
| 90 // Updates the viewport metrics for the display, returning true if any | 83 // Updates the viewport metrics for the display, returning true if any |
| 91 // metrics have changed. | 84 // metrics have changed. |
| 92 virtual bool UpdateViewportMetrics( | 85 virtual bool UpdateViewportMetrics( |
| 93 const display::ViewportMetrics& metrics) = 0; | 86 const display::ViewportMetrics& metrics) = 0; |
| 94 | 87 |
| 95 virtual const display::ViewportMetrics& GetViewportMetrics() const = 0; | 88 virtual const display::ViewportMetrics& GetViewportMetrics() const = 0; |
| 96 | 89 |
| 97 virtual bool IsPrimaryDisplay() const = 0; | 90 virtual bool IsPrimaryDisplay() const = 0; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 117 class DefaultPlatformDisplay : public PlatformDisplay, | 110 class DefaultPlatformDisplay : public PlatformDisplay, |
| 118 public ui::PlatformWindowDelegate, | 111 public ui::PlatformWindowDelegate, |
| 119 private FrameGeneratorDelegate { | 112 private FrameGeneratorDelegate { |
| 120 public: | 113 public: |
| 121 explicit DefaultPlatformDisplay(const PlatformDisplayInitParams& init_params); | 114 explicit DefaultPlatformDisplay(const PlatformDisplayInitParams& init_params); |
| 122 ~DefaultPlatformDisplay() override; | 115 ~DefaultPlatformDisplay() override; |
| 123 | 116 |
| 124 // PlatformDisplay: | 117 // PlatformDisplay: |
| 125 void Init(PlatformDisplayDelegate* delegate) override; | 118 void Init(PlatformDisplayDelegate* delegate) override; |
| 126 int64_t GetId() const override; | 119 int64_t GetId() const override; |
| 127 void SchedulePaint(const ServerWindow* window, | |
| 128 const gfx::Rect& bounds) override; | |
| 129 void SetViewportSize(const gfx::Size& size) override; | 120 void SetViewportSize(const gfx::Size& size) override; |
| 130 void SetTitle(const base::string16& title) override; | 121 void SetTitle(const base::string16& title) override; |
| 131 void SetCapture() override; | 122 void SetCapture() override; |
| 132 void ReleaseCapture() override; | 123 void ReleaseCapture() override; |
| 133 void SetCursorById(mojom::Cursor cursor) override; | 124 void SetCursorById(mojom::Cursor cursor) override; |
| 134 void UpdateTextInputState(const ui::TextInputState& state) override; | 125 void UpdateTextInputState(const ui::TextInputState& state) override; |
| 135 void SetImeVisibility(bool visible) override; | 126 void SetImeVisibility(bool visible) override; |
| 136 bool IsFramePending() const override; | |
| 137 gfx::Rect GetBounds() const override; | 127 gfx::Rect GetBounds() const override; |
| 138 bool UpdateViewportMetrics(const display::ViewportMetrics& metrics) override; | 128 bool UpdateViewportMetrics(const display::ViewportMetrics& metrics) override; |
| 139 const display::ViewportMetrics& GetViewportMetrics() const override; | 129 const display::ViewportMetrics& GetViewportMetrics() const override; |
| 140 bool IsPrimaryDisplay() const override; | 130 bool IsPrimaryDisplay() const override; |
| 141 void OnGpuChannelEstablished( | 131 void OnGpuChannelEstablished( |
| 142 scoped_refptr<gpu::GpuChannelHost> gpu_channel) override; | 132 scoped_refptr<gpu::GpuChannelHost> gpu_channel) override; |
| 143 | 133 |
| 144 private: | 134 private: |
| 145 // Update the root_location of located events to be relative to the origin | 135 // Update the root_location of located events to be relative to the origin |
| 146 // of this display. For example, if the origin of this display is (1800, 0) | 136 // of this display. For example, if the origin of this display is (1800, 0) |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 std::unique_ptr<ui::PlatformWindow> platform_window_; | 168 std::unique_ptr<ui::PlatformWindow> platform_window_; |
| 179 | 169 |
| 180 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay); | 170 DISALLOW_COPY_AND_ASSIGN(DefaultPlatformDisplay); |
| 181 }; | 171 }; |
| 182 | 172 |
| 183 } // namespace ws | 173 } // namespace ws |
| 184 | 174 |
| 185 } // namespace ui | 175 } // namespace ui |
| 186 | 176 |
| 187 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ | 177 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_H_ |
| OLD | NEW |