| 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 <unordered_map> |
| 11 |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
| 13 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 14 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
| 15 #include "ui/ozone/platform/drm/gpu/hardware_display_controller.h" | 16 #include "ui/ozone/platform/drm/gpu/hardware_display_controller.h" |
| 16 | 17 |
| 17 typedef struct _drmModeModeInfo drmModeModeInfo; | 18 typedef struct _drmModeModeInfo drmModeModeInfo; |
| 18 | 19 |
| 19 namespace gfx { | 20 namespace gfx { |
| 20 class Point; | 21 class Point; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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<std::unique_ptr<HardwareDisplayController>> | 84 using HardwareDisplayControllers = |
| 84 HardwareDisplayControllers; | 85 std::vector<std::unique_ptr<HardwareDisplayController>>; |
| 85 typedef base::ScopedPtrHashMap<gfx::AcceleratedWidget, | 86 using WidgetToWindowMap = |
| 86 std::unique_ptr<DrmWindow>> | 87 std::unordered_map<gfx::AcceleratedWidget, std::unique_ptr<DrmWindow>>; |
| 87 WidgetToWindowMap; | |
| 88 | 88 |
| 89 // Returns an iterator into |controllers_| for the controller identified by | 89 // Returns an iterator into |controllers_| for the controller identified by |
| 90 // (|crtc|, |connector|). | 90 // (|crtc|, |connector|). |
| 91 HardwareDisplayControllers::iterator FindDisplayController( | 91 HardwareDisplayControllers::iterator FindDisplayController( |
| 92 const scoped_refptr<DrmDevice>& drm, | 92 const scoped_refptr<DrmDevice>& drm, |
| 93 uint32_t crtc); | 93 uint32_t crtc); |
| 94 | 94 |
| 95 bool ActualConfigureDisplayController(const scoped_refptr<DrmDevice>& drm, | 95 bool ActualConfigureDisplayController(const scoped_refptr<DrmDevice>& drm, |
| 96 uint32_t crtc, | 96 uint32_t crtc, |
| 97 uint32_t connector, | 97 uint32_t connector, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 HardwareDisplayControllers controllers_; | 131 HardwareDisplayControllers controllers_; |
| 132 | 132 |
| 133 WidgetToWindowMap window_map_; | 133 WidgetToWindowMap window_map_; |
| 134 | 134 |
| 135 DISALLOW_COPY_AND_ASSIGN(ScreenManager); | 135 DISALLOW_COPY_AND_ASSIGN(ScreenManager); |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 } // namespace ui | 138 } // namespace ui |
| 139 | 139 |
| 140 #endif // UI_OZONE_PLATFORM_DRM_GPU_SCREEN_MANAGER_H_ | 140 #endif // UI_OZONE_PLATFORM_DRM_GPU_SCREEN_MANAGER_H_ |
| OLD | NEW |