OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_PUBLIC_NATIVE_PIXMAP_MANAGER_H_ | 5 #ifndef UI_OZONE_PUBLIC_NATIVE_PIXMAP_MANAGER_H_ |
6 #define UI_OZONE_PUBLIC_NATIVE_PIXMAP_MANAGER_H_ | 6 #define UI_OZONE_PUBLIC_NATIVE_PIXMAP_MANAGER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ui/ozone/ozone_export.h" | 10 #include "ui/ozone/ozone_export.h" |
11 #include "ui/ozone/public/surface_factory_ozone.h" | 11 #include "ui/ozone/public/surface_factory_ozone.h" |
12 | 12 |
| 13 namespace base { |
| 14 |
| 15 struct FileDescriptor; |
| 16 |
| 17 } // namespace base |
| 18 |
13 namespace ui { | 19 namespace ui { |
14 | 20 |
15 // The Ozone interface allows external implementations to hook into Chromium to | 21 // The Ozone interface allows external implementations to hook into Chromium to |
16 // provide the handle of a native surface for Browser and Render process. | 22 // provide the handle of a native surface for Browser and Render process. |
17 class OZONE_EXPORT NativePixmapManager { | 23 class OZONE_EXPORT NativePixmapManager { |
18 public: | 24 public: |
19 static NativePixmapManager* GetInstance(); | 25 static NativePixmapManager* GetInstance(); |
20 static void SetInstance(scoped_ptr<NativePixmapManager> instance); | 26 static void SetInstance(NativePixmapManager* instance); |
21 | 27 |
22 static scoped_ptr<NativePixmapManager> Create(); | 28 static scoped_ptr<NativePixmapManager> Create( |
| 29 const base::FileDescriptor& device_fd); |
23 | 30 |
24 virtual ~NativePixmapManager(); | 31 virtual ~NativePixmapManager(); |
25 | 32 |
26 struct Configuration { | 33 struct Configuration { |
27 SurfaceFactoryOzone::BufferFormat format; | 34 SurfaceFactoryOzone::BufferFormat format; |
28 SurfaceFactoryOzone::BufferUsage usage; | 35 SurfaceFactoryOzone::BufferUsage usage; |
29 }; | 36 }; |
30 | 37 |
31 // Gets supported format/usage configurations. | 38 // Gets supported format/usage configurations. |
32 virtual std::vector<Configuration> GetSupportedNativePixmapConfigurations() | 39 virtual std::vector<Configuration> GetSupportedNativePixmapConfigurations() |
33 const = 0; | 40 const = 0; |
34 | 41 |
35 protected: | 42 protected: |
36 NativePixmapManager(); | 43 NativePixmapManager(); |
37 | 44 |
| 45 virtual void Initialize(const base::FileDescriptor& device_fd) = 0; |
| 46 |
38 private: | 47 private: |
39 DISALLOW_COPY_AND_ASSIGN(NativePixmapManager); | 48 DISALLOW_COPY_AND_ASSIGN(NativePixmapManager); |
40 }; | 49 }; |
41 | 50 |
42 } // namespace ui | 51 } // namespace ui |
43 | 52 |
44 #endif // UI_OZONE_PUBLIC_NATIVE_PIXMAP_MANAGER_H_ | 53 #endif // UI_OZONE_PUBLIC_NATIVE_PIXMAP_MANAGER_H_ |
OLD | NEW |