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