Chromium Code Reviews| Index: ui/ozone/platform/drm/gpu/drm_device_manager.h |
| diff --git a/ui/ozone/platform/drm/gpu/drm_device_manager.h b/ui/ozone/platform/drm/gpu/drm_device_manager.h |
| index 4d0a97ba43472508802c669f1e127815170ee139..9cf4fe29e137eeceb459cfeb0de662d6d004e37a 100644 |
| --- a/ui/ozone/platform/drm/gpu/drm_device_manager.h |
| +++ b/ui/ozone/platform/drm/gpu/drm_device_manager.h |
| @@ -6,23 +6,38 @@ |
| #define UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_MANAGER_H_ |
| #include <map> |
| +#include <vector> |
| #include "base/memory/ref_counted.h" |
| +#include "base/memory/scoped_ptr.h" |
| #include "base/synchronization/lock.h" |
| #include "ui/gfx/native_widget_types.h" |
| #include "ui/ozone/ozone_export.h" |
| +namespace base { |
| +class FilePath; |
| +struct FileDescriptor; |
| +class SingleThreadTaskRunner; |
| +} |
| + |
| namespace ui { |
| class DrmDevice; |
| +class DrmDeviceGenerator; |
| // Tracks the mapping between widgets and the DRM devices used to allocate |
| // buffers for the window represented by the widget. |
| class OZONE_EXPORT DrmDeviceManager { |
| public: |
| - DrmDeviceManager(const scoped_refptr<DrmDevice>& primary_device); |
| + DrmDeviceManager(scoped_ptr<DrmDeviceGenerator> drm_device_generator); |
| ~DrmDeviceManager(); |
| + bool AddDrmDevice(const base::FilePath& path, const base::FileDescriptor& fd); |
| + void RemoveDrmDevice(const base::FilePath& path); |
| + |
| + void InitializeIOTaskRunner( |
| + const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); |
| + |
| // Updates the device associated with |widget|. |
| void UpdateDrmDevice(gfx::AcceleratedWidget widget, |
| const scoped_refptr<DrmDevice>& device); |
| @@ -34,7 +49,15 @@ class OZONE_EXPORT DrmDeviceManager { |
| // returns |primary_device_|. |
| scoped_refptr<DrmDevice> GetDrmDevice(gfx::AcceleratedWidget widget); |
| + std::vector<scoped_refptr<DrmDevice>> GetDrmDevices(); |
| + |
| private: |
| + scoped_ptr<DrmDeviceGenerator> drm_device_generator_; |
| + |
| + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| + |
| + std::vector<scoped_refptr<DrmDevice>> devices_; |
|
alexst (slow to review)
2015/04/22 18:27:56
typedef DrmDeviceVector?
dnicoara
2015/04/22 18:41:30
It is only used in a handful of places and doesn't
|
| + |
| std::map<gfx::AcceleratedWidget, scoped_refptr<DrmDevice>> drm_device_map_; |
| // This device represents the primary graphics device and is used when: |