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_CLIENT_NATIVE_PIXMAP_MANAGER_H_ | 5 #ifndef UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_MANAGER_H_ |
6 #define UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_MANAGER_H_ | 6 #define UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_MANAGER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 namespace ui { | 22 namespace ui { |
23 | 23 |
24 // The Ozone interface allows external implementations to hook into Chromium to | 24 // The Ozone interface allows external implementations to hook into Chromium to |
25 // provide a client pixmap for non-GPU processes. | 25 // provide a client pixmap for non-GPU processes. |
26 class OZONE_EXPORT ClientNativePixmapManager { | 26 class OZONE_EXPORT ClientNativePixmapManager { |
27 public: | 27 public: |
28 static ClientNativePixmapManager* GetInstance(); | 28 static ClientNativePixmapManager* GetInstance(); |
29 static void SetInstance(ClientNativePixmapManager* instance); | 29 static void SetInstance(ClientNativePixmapManager* instance); |
30 | 30 |
31 static scoped_ptr<ClientNativePixmapManager> Create(); | 31 static scoped_ptr<ClientNativePixmapManager> Create( |
| 32 const base::FileDescriptor& virtual_device); |
32 | 33 |
33 virtual ~ClientNativePixmapManager(); | 34 virtual ~ClientNativePixmapManager(); |
34 | 35 |
35 struct Configuration { | 36 struct Configuration { |
36 NativePixmapFormat format; | 37 NativePixmapFormat format; |
37 NativePixmapUsage usage; | 38 NativePixmapUsage usage; |
38 }; | 39 }; |
39 | 40 |
40 // Gets supported format/usage configurations. | 41 // Gets supported format/usage configurations. |
41 virtual std::vector<Configuration> GetSupportedConfigurations() const = 0; | 42 virtual std::vector<Configuration> GetSupportedConfigurations() const = 0; |
42 | 43 |
43 // TODO(dshwang): implement it. crbug.com/475633 | 44 // TODO(dshwang): implement it. crbug.com/475633 |
44 // Import the native pixmap from |handle| to be used in non-GPU processes. | 45 // Import the native pixmap from |handle| to be used in non-GPU processes. |
45 virtual scoped_ptr<ClientNativePixmap> ImportClientNativePixmap( | 46 virtual scoped_ptr<ClientNativePixmap> ImportClientNativePixmap( |
46 base::FileDescriptor handle, | 47 base::FileDescriptor handle, |
47 gfx::Size size, | 48 gfx::Size size, |
48 NativePixmapFormat format, | 49 NativePixmapFormat format, |
49 NativePixmapUsage usage) = 0; | 50 NativePixmapUsage usage) = 0; |
50 | 51 |
51 protected: | 52 protected: |
52 ClientNativePixmapManager(); | 53 ClientNativePixmapManager(); |
53 | 54 |
| 55 virtual void Initialize(const base::FileDescriptor& virtual_device) = 0; |
| 56 |
54 private: | 57 private: |
55 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapManager); | 58 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapManager); |
56 }; | 59 }; |
57 | 60 |
58 } // namespace ui | 61 } // namespace ui |
59 | 62 |
60 #endif // UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_MANAGER_H_ | 63 #endif // UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_MANAGER_H_ |
OLD | NEW |