OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_OZONE_PUBLIC_NATIVE_PIXMAP_MANAGER_H_ | |
6 #define UI_OZONE_PUBLIC_NATIVE_PIXMAP_MANAGER_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "ui/ozone/ozone_export.h" | |
11 #include "ui/ozone/public/native_pixmap.h" | |
12 #include "ui/ozone/public/surface_factory_ozone.h" | |
13 | |
14 namespace base { | |
15 | |
16 struct FileDescriptor; | |
17 | |
18 } // namespace base | |
19 | |
20 namespace ui { | |
21 | |
22 // The Ozone interface allows external implementations to hook into Chromium to | |
23 // provide a native pixmap for non-GPU processes. | |
24 class OZONE_EXPORT NativePixmapManager { | |
25 public: | |
26 static NativePixmapManager* GetInstance(); | |
27 static void SetInstance(NativePixmapManager* instance); | |
28 | |
29 static scoped_ptr<NativePixmapManager> Create(); | |
30 | |
31 virtual ~NativePixmapManager(); | |
32 | |
33 struct Configuration { | |
34 SurfaceFactoryOzone::BufferFormat format; | |
35 SurfaceFactoryOzone::BufferUsage usage; | |
36 }; | |
37 | |
38 // Gets supported format/usage configurations. | |
39 virtual std::vector<Configuration> GetSupportedNativePixmapConfigurations() | |
40 const = 0; | |
41 | |
42 // TODO(dshwang): implement it. crbug.com/475633 | |
43 // Import the native pixmap from |handle| to be used in non-GPU processes. | |
44 virtual scoped_refptr<NativePixmap> ImportNativePixmap( | |
45 base::FileDescriptor handle, | |
reveman
2015/07/28 18:07:57
nit: const base::FileDescriptor& handle
| |
46 gfx::Size size, | |
reveman
2015/07/28 18:07:57
nit: const gfx::Size& size
| |
47 SurfaceFactoryOzone::BufferFormat format, | |
48 SurfaceFactoryOzone::BufferUsage usage) = 0; | |
49 | |
50 protected: | |
51 NativePixmapManager(); | |
52 | |
53 private: | |
54 DISALLOW_COPY_AND_ASSIGN(NativePixmapManager); | |
55 }; | |
56 | |
57 } // namespace ui | |
58 | |
59 #endif // UI_OZONE_PUBLIC_NATIVE_PIXMAP_MANAGER_H_ | |
OLD | NEW |