| 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_DRI_DRI_GPU_PLATFORM_SUPPORT_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_GPU_PLATFORM_SUPPORT_H_ |
| 6 #define UI_OZONE_PLATFORM_DRI_DRI_GPU_PLATFORM_SUPPORT_H_ | 6 #define UI_OZONE_PLATFORM_DRI_DRI_GPU_PLATFORM_SUPPORT_H_ |
| 7 | 7 |
| 8 #include <map> |
| 9 |
| 8 #include "base/containers/scoped_ptr_hash_map.h" | 10 #include "base/containers/scoped_ptr_hash_map.h" |
| 9 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
| 11 #include "ipc/message_filter.h" | 13 #include "ipc/message_filter.h" |
| 12 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
| 13 #include "ui/ozone/public/gpu_platform_support.h" | 15 #include "ui/ozone/public/gpu_platform_support.h" |
| 14 | 16 |
| 15 class SkBitmap; | 17 class SkBitmap; |
| 16 | 18 |
| 17 namespace base { | 19 namespace base { |
| 20 class FileDescriptor; |
| 18 class FilePath; | 21 class FilePath; |
| 19 class SingleThreadTaskRunner; | 22 class SingleThreadTaskRunner; |
| 20 } | 23 } |
| 21 | 24 |
| 22 namespace gfx { | 25 namespace gfx { |
| 23 class Point; | 26 class Point; |
| 24 class Rect; | 27 class Rect; |
| 25 } | 28 } |
| 26 | 29 |
| 27 namespace ui { | 30 namespace ui { |
| 28 | 31 |
| 29 class DriSurfaceFactory; | 32 class DriSurfaceFactory; |
| 30 class DriWindowDelegate; | 33 class DriWindowDelegate; |
| 31 class DriWindowDelegateManager; | 34 class DriWindowDelegateManager; |
| 32 class DriWrapper; | 35 class DriWrapper; |
| 36 class DriWrapperGenerator; |
| 33 class DrmDeviceManager; | 37 class DrmDeviceManager; |
| 34 class NativeDisplayDelegateDri; | 38 class NativeDisplayDelegateDri; |
| 35 class ScreenManager; | 39 class ScreenManager; |
| 36 | 40 |
| 37 struct DisplayMode_Params; | 41 struct DisplayMode_Params; |
| 38 struct DisplaySnapshot_Params; | 42 struct DisplaySnapshot_Params; |
| 39 | 43 |
| 40 class DriGpuPlatformSupport : public GpuPlatformSupport { | 44 class DriGpuPlatformSupport : public GpuPlatformSupport { |
| 41 public: | 45 public: |
| 42 DriGpuPlatformSupport(const scoped_refptr<DriWrapper>& drm, | 46 DriGpuPlatformSupport(const scoped_refptr<DriWrapper>& drm, |
| 43 DrmDeviceManager* drm_device_manager, | 47 DrmDeviceManager* drm_device_manager, |
| 44 DriWindowDelegateManager* window_manager, | 48 DriWindowDelegateManager* window_manager, |
| 45 ScreenManager* screen_manager, | 49 ScreenManager* screen_manager, |
| 46 scoped_ptr<NativeDisplayDelegateDri> ndd); | 50 scoped_ptr<NativeDisplayDelegateDri> ndd, |
| 51 scoped_ptr<DriWrapperGenerator> wrapper_generator); |
| 47 ~DriGpuPlatformSupport() override; | 52 ~DriGpuPlatformSupport() override; |
| 48 | 53 |
| 49 void AddHandler(scoped_ptr<GpuPlatformSupport> handler); | 54 void AddHandler(scoped_ptr<GpuPlatformSupport> handler); |
| 50 | 55 |
| 51 // GpuPlatformSupport: | 56 // GpuPlatformSupport: |
| 52 void OnChannelEstablished(IPC::Sender* sender) override; | 57 void OnChannelEstablished(IPC::Sender* sender) override; |
| 53 void RelinquishGpuResources(const base::Closure& callback) override; | 58 void RelinquishGpuResources(const base::Closure& callback) override; |
| 54 IPC::MessageFilter* GetMessageFilter() override; | 59 IPC::MessageFilter* GetMessageFilter() override; |
| 55 | 60 |
| 56 // IPC::Listener: | 61 // IPC::Listener: |
| (...skipping 12 matching lines...) Expand all Loading... |
| 69 | 74 |
| 70 // Display related IPC handlers. | 75 // Display related IPC handlers. |
| 71 void OnForceDPMSOn(); | 76 void OnForceDPMSOn(); |
| 72 void OnRefreshNativeDisplays(); | 77 void OnRefreshNativeDisplays(); |
| 73 void OnConfigureNativeDisplay(int64_t id, | 78 void OnConfigureNativeDisplay(int64_t id, |
| 74 const DisplayMode_Params& mode, | 79 const DisplayMode_Params& mode, |
| 75 const gfx::Point& origin); | 80 const gfx::Point& origin); |
| 76 void OnDisableNativeDisplay(int64_t id); | 81 void OnDisableNativeDisplay(int64_t id); |
| 77 void OnTakeDisplayControl(); | 82 void OnTakeDisplayControl(); |
| 78 void OnRelinquishDisplayControl(); | 83 void OnRelinquishDisplayControl(); |
| 79 void OnAddGraphicsDevice(const base::FilePath& path); | 84 void OnAddGraphicsDevice(const base::FilePath& path, |
| 85 const base::FileDescriptor& fd); |
| 80 void OnRemoveGraphicsDevice(const base::FilePath& path); | 86 void OnRemoveGraphicsDevice(const base::FilePath& path); |
| 81 | 87 |
| 82 void SetIOTaskRunner( | 88 void SetIOTaskRunner( |
| 83 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner); | 89 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner); |
| 84 | 90 |
| 85 IPC::Sender* sender_; // Not owned. | 91 IPC::Sender* sender_; // Not owned. |
| 86 scoped_refptr<DriWrapper> drm_; | |
| 87 DrmDeviceManager* drm_device_manager_; // Not owned. | 92 DrmDeviceManager* drm_device_manager_; // Not owned. |
| 88 DriWindowDelegateManager* window_manager_; // Not owned. | 93 DriWindowDelegateManager* window_manager_; // Not owned. |
| 89 ScreenManager* screen_manager_; // Not owned. | 94 ScreenManager* screen_manager_; // Not owned. |
| 90 | 95 |
| 96 std::map<base::FilePath, scoped_refptr<DriWrapper>> wrappers_; |
| 91 scoped_ptr<NativeDisplayDelegateDri> ndd_; | 97 scoped_ptr<NativeDisplayDelegateDri> ndd_; |
| 98 scoped_ptr<DriWrapperGenerator> wrapper_generator_; |
| 92 ScopedVector<GpuPlatformSupport> handlers_; | 99 ScopedVector<GpuPlatformSupport> handlers_; |
| 93 scoped_refptr<IPC::MessageFilter> filter_; | 100 scoped_refptr<IPC::MessageFilter> filter_; |
| 94 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 101 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| 95 }; | 102 }; |
| 96 | 103 |
| 97 } // namespace ui | 104 } // namespace ui |
| 98 | 105 |
| 99 #endif // UI_OZONE_PLATFORM_DRI_DRI_GPU_PLATFORM_SUPPORT_H_ | 106 #endif // UI_OZONE_PLATFORM_DRI_DRI_GPU_PLATFORM_SUPPORT_H_ |
| OLD | NEW |