| 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 UI_OZONE_PLATFORM_DRM_GPU_SCREEN_MANAGER_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_SCREEN_MANAGER_H_ |
| 6 #define UI_OZONE_PLATFORM_DRM_GPU_SCREEN_MANAGER_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_SCREEN_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/containers/scoped_ptr_hash_map.h" | 10 #include "base/containers/scoped_ptr_hash_map.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 bool DisableDisplayController(const scoped_refptr<DrmDevice>& drm, | 58 bool DisableDisplayController(const scoped_refptr<DrmDevice>& drm, |
| 59 uint32_t crtc); | 59 uint32_t crtc); |
| 60 | 60 |
| 61 // Returns a reference to the display controller configured to display within | 61 // Returns a reference to the display controller configured to display within |
| 62 // |bounds|. If the caller caches the controller it must also register as an | 62 // |bounds|. If the caller caches the controller it must also register as an |
| 63 // observer to be notified when the controller goes out of scope. | 63 // observer to be notified when the controller goes out of scope. |
| 64 HardwareDisplayController* GetDisplayController(const gfx::Rect& bounds); | 64 HardwareDisplayController* GetDisplayController(const gfx::Rect& bounds); |
| 65 | 65 |
| 66 // Adds a window for |widget|. Note: |widget| should not be associated with a | 66 // Adds a window for |widget|. Note: |widget| should not be associated with a |
| 67 // window when calling this function. | 67 // window when calling this function. |
| 68 void AddWindow(gfx::AcceleratedWidget widget, scoped_ptr<DrmWindow> window); | 68 void AddWindow(gfx::AcceleratedWidget widget, |
| 69 std::unique_ptr<DrmWindow> window); |
| 69 | 70 |
| 70 // Removes the window for |widget|. Note: |widget| must have a window | 71 // Removes the window for |widget|. Note: |widget| must have a window |
| 71 // associated with it when calling this function. | 72 // associated with it when calling this function. |
| 72 scoped_ptr<DrmWindow> RemoveWindow(gfx::AcceleratedWidget widget); | 73 std::unique_ptr<DrmWindow> RemoveWindow(gfx::AcceleratedWidget widget); |
| 73 | 74 |
| 74 // Returns the window associated with |widget|. Note: This function should be | 75 // Returns the window associated with |widget|. Note: This function should be |
| 75 // called only if a valid window has been associated with |widget|. | 76 // called only if a valid window has been associated with |widget|. |
| 76 DrmWindow* GetWindow(gfx::AcceleratedWidget widget); | 77 DrmWindow* GetWindow(gfx::AcceleratedWidget widget); |
| 77 | 78 |
| 78 // Updates the mapping between display controllers and windows such that a | 79 // Updates the mapping between display controllers and windows such that a |
| 79 // controller will be associated with at most one window. | 80 // controller will be associated with at most one window. |
| 80 void UpdateControllerToWindowMapping(); | 81 void UpdateControllerToWindowMapping(); |
| 81 | 82 |
| 82 private: | 83 private: |
| 83 typedef std::vector<scoped_ptr<HardwareDisplayController>> | 84 typedef std::vector<std::unique_ptr<HardwareDisplayController>> |
| 84 HardwareDisplayControllers; | 85 HardwareDisplayControllers; |
| 85 typedef base::ScopedPtrHashMap<gfx::AcceleratedWidget, scoped_ptr<DrmWindow>> | 86 typedef base::ScopedPtrHashMap<gfx::AcceleratedWidget, |
| 87 std::unique_ptr<DrmWindow>> |
| 86 WidgetToWindowMap; | 88 WidgetToWindowMap; |
| 87 | 89 |
| 88 // Returns an iterator into |controllers_| for the controller identified by | 90 // Returns an iterator into |controllers_| for the controller identified by |
| 89 // (|crtc|, |connector|). | 91 // (|crtc|, |connector|). |
| 90 HardwareDisplayControllers::iterator FindDisplayController( | 92 HardwareDisplayControllers::iterator FindDisplayController( |
| 91 const scoped_refptr<DrmDevice>& drm, | 93 const scoped_refptr<DrmDevice>& drm, |
| 92 uint32_t crtc); | 94 uint32_t crtc); |
| 93 | 95 |
| 94 bool ActualConfigureDisplayController(const scoped_refptr<DrmDevice>& drm, | 96 bool ActualConfigureDisplayController(const scoped_refptr<DrmDevice>& drm, |
| 95 uint32_t crtc, | 97 uint32_t crtc, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 HardwareDisplayControllers controllers_; | 132 HardwareDisplayControllers controllers_; |
| 131 | 133 |
| 132 WidgetToWindowMap window_map_; | 134 WidgetToWindowMap window_map_; |
| 133 | 135 |
| 134 DISALLOW_COPY_AND_ASSIGN(ScreenManager); | 136 DISALLOW_COPY_AND_ASSIGN(ScreenManager); |
| 135 }; | 137 }; |
| 136 | 138 |
| 137 } // namespace ui | 139 } // namespace ui |
| 138 | 140 |
| 139 #endif // UI_OZONE_PLATFORM_DRM_GPU_SCREEN_MANAGER_H_ | 141 #endif // UI_OZONE_PLATFORM_DRM_GPU_SCREEN_MANAGER_H_ |
| OLD | NEW |