| 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_DISPLAY_MANAGER_H_ | 5 #ifndef COMPONENTS_MUS_WS_DISPLAY_MANAGER_H_ |
| 6 #define COMPONENTS_MUS_WS_DISPLAY_MANAGER_H_ | 6 #define COMPONENTS_MUS_WS_DISPLAY_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 namespace gles2 { | 26 namespace gles2 { |
| 27 class GpuState; | 27 class GpuState; |
| 28 } // namespace gles2 | 28 } // namespace gles2 |
| 29 | 29 |
| 30 namespace mojo { | 30 namespace mojo { |
| 31 class ApplicationImpl; | 31 class ApplicationImpl; |
| 32 } // namespace mojo | 32 } // namespace mojo |
| 33 | 33 |
| 34 namespace ui { | 34 namespace ui { |
| 35 class CursorLoader; |
| 35 class PlatformWindow; | 36 class PlatformWindow; |
| 36 struct TextInputState; | 37 struct TextInputState; |
| 37 } // namespace ui | 38 } // namespace ui |
| 38 | 39 |
| 39 namespace mus { | 40 namespace mus { |
| 40 | 41 |
| 41 class GpuState; | 42 class GpuState; |
| 42 class SurfacesState; | 43 class SurfacesState; |
| 43 class TopLevelDisplayClient; | 44 class TopLevelDisplayClient; |
| 44 | 45 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 61 virtual void Init(DisplayManagerDelegate* delegate) = 0; | 62 virtual void Init(DisplayManagerDelegate* delegate) = 0; |
| 62 | 63 |
| 63 // Schedules a paint for the specified region in the coordinates of |window|. | 64 // Schedules a paint for the specified region in the coordinates of |window|. |
| 64 virtual void SchedulePaint(const ServerWindow* window, | 65 virtual void SchedulePaint(const ServerWindow* window, |
| 65 const gfx::Rect& bounds) = 0; | 66 const gfx::Rect& bounds) = 0; |
| 66 | 67 |
| 67 virtual void SetViewportSize(const gfx::Size& size) = 0; | 68 virtual void SetViewportSize(const gfx::Size& size) = 0; |
| 68 | 69 |
| 69 virtual void SetTitle(const base::string16& title) = 0; | 70 virtual void SetTitle(const base::string16& title) = 0; |
| 70 | 71 |
| 72 virtual void SetCursorById(int32_t cursor) = 0; |
| 73 |
| 71 virtual const mojom::ViewportMetrics& GetViewportMetrics() = 0; | 74 virtual const mojom::ViewportMetrics& GetViewportMetrics() = 0; |
| 72 | 75 |
| 73 virtual void UpdateTextInputState(const ui::TextInputState& state) = 0; | 76 virtual void UpdateTextInputState(const ui::TextInputState& state) = 0; |
| 74 virtual void SetImeVisibility(bool visible) = 0; | 77 virtual void SetImeVisibility(bool visible) = 0; |
| 75 | 78 |
| 76 // Returns true if a compositor frame has been submitted but not drawn yet. | 79 // Returns true if a compositor frame has been submitted but not drawn yet. |
| 77 virtual bool IsFramePending() const = 0; | 80 virtual bool IsFramePending() const = 0; |
| 78 | 81 |
| 79 // Overrides factory for testing. Default (NULL) value indicates regular | 82 // Overrides factory for testing. Default (NULL) value indicates regular |
| 80 // (non-test) environment. | 83 // (non-test) environment. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 96 const scoped_refptr<GpuState>& gpu_state, | 99 const scoped_refptr<GpuState>& gpu_state, |
| 97 const scoped_refptr<SurfacesState>& surfaces_state); | 100 const scoped_refptr<SurfacesState>& surfaces_state); |
| 98 ~DefaultDisplayManager() override; | 101 ~DefaultDisplayManager() override; |
| 99 | 102 |
| 100 // DisplayManager: | 103 // DisplayManager: |
| 101 void Init(DisplayManagerDelegate* delegate) override; | 104 void Init(DisplayManagerDelegate* delegate) override; |
| 102 void SchedulePaint(const ServerWindow* window, | 105 void SchedulePaint(const ServerWindow* window, |
| 103 const gfx::Rect& bounds) override; | 106 const gfx::Rect& bounds) override; |
| 104 void SetViewportSize(const gfx::Size& size) override; | 107 void SetViewportSize(const gfx::Size& size) override; |
| 105 void SetTitle(const base::string16& title) override; | 108 void SetTitle(const base::string16& title) override; |
| 109 void SetCursorById(int32_t cursor) override; |
| 106 const mojom::ViewportMetrics& GetViewportMetrics() override; | 110 const mojom::ViewportMetrics& GetViewportMetrics() override; |
| 107 void UpdateTextInputState(const ui::TextInputState& state) override; | 111 void UpdateTextInputState(const ui::TextInputState& state) override; |
| 108 void SetImeVisibility(bool visible) override; | 112 void SetImeVisibility(bool visible) override; |
| 109 bool IsFramePending() const override; | 113 bool IsFramePending() const override; |
| 110 | 114 |
| 111 private: | 115 private: |
| 112 void WantToDraw(); | 116 void WantToDraw(); |
| 113 | 117 |
| 114 // This method initiates a top level redraw of the display. | 118 // This method initiates a top level redraw of the display. |
| 115 // TODO(fsamuel): This should use vblank as a signal rather than a timer | 119 // TODO(fsamuel): This should use vblank as a signal rather than a timer |
| (...skipping 26 matching lines...) Expand all Loading... |
| 142 DisplayManagerDelegate* delegate_; | 146 DisplayManagerDelegate* delegate_; |
| 143 | 147 |
| 144 mojom::ViewportMetrics metrics_; | 148 mojom::ViewportMetrics metrics_; |
| 145 gfx::Rect dirty_rect_; | 149 gfx::Rect dirty_rect_; |
| 146 base::Timer draw_timer_; | 150 base::Timer draw_timer_; |
| 147 bool frame_pending_; | 151 bool frame_pending_; |
| 148 | 152 |
| 149 scoped_ptr<TopLevelDisplayClient> top_level_display_client_; | 153 scoped_ptr<TopLevelDisplayClient> top_level_display_client_; |
| 150 scoped_ptr<ui::PlatformWindow> platform_window_; | 154 scoped_ptr<ui::PlatformWindow> platform_window_; |
| 151 | 155 |
| 156 #if !defined(OS_ANDROID) |
| 157 scoped_ptr<ui::CursorLoader> cursor_loader_; |
| 158 #endif |
| 159 |
| 152 base::WeakPtrFactory<DefaultDisplayManager> weak_factory_; | 160 base::WeakPtrFactory<DefaultDisplayManager> weak_factory_; |
| 153 | 161 |
| 154 DISALLOW_COPY_AND_ASSIGN(DefaultDisplayManager); | 162 DISALLOW_COPY_AND_ASSIGN(DefaultDisplayManager); |
| 155 }; | 163 }; |
| 156 | 164 |
| 157 } // namespace ws | 165 } // namespace ws |
| 158 | 166 |
| 159 } // namespace mus | 167 } // namespace mus |
| 160 | 168 |
| 161 #endif // COMPONENTS_MUS_WS_DISPLAY_MANAGER_H_ | 169 #endif // COMPONENTS_MUS_WS_DISPLAY_MANAGER_H_ |
| OLD | NEW |