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_FACTORY_H_ | 5 #ifndef UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_FACTORY_H_ |
6 #define UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_FACTORY_H_ | 6 #define UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_FACTORY_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 ClientNativePixmapFactory { | 26 class OZONE_EXPORT ClientNativePixmapFactory { |
27 public: | 27 public: |
28 static ClientNativePixmapFactory* GetInstance(); | 28 static ClientNativePixmapFactory* GetInstance(); |
29 static void SetInstance(ClientNativePixmapFactory* instance); | 29 static void SetInstance(ClientNativePixmapFactory* instance); |
30 | 30 |
31 static scoped_ptr<ClientNativePixmapFactory> Create(); | 31 static scoped_ptr<ClientNativePixmapFactory> Create( |
32 const base::FileDescriptor& virtual_device); | |
32 | 33 |
33 virtual ~ClientNativePixmapFactory(); | 34 virtual ~ClientNativePixmapFactory(); |
34 | 35 |
35 struct Configuration { | 36 struct Configuration { |
36 gfx::BufferFormat format; | 37 gfx::BufferFormat format; |
37 gfx::BufferUsage usage; | 38 gfx::BufferUsage 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> ImportNativePixmap( | 46 virtual scoped_ptr<ClientNativePixmap> ImportNativePixmap( |
46 const base::FileDescriptor& handle, | 47 const base::FileDescriptor& handle, |
47 const gfx::Size& size, | 48 const gfx::Size& size, |
48 gfx::BufferFormat format, | 49 gfx::BufferFormat format, |
49 gfx::BufferUsage usage) = 0; | 50 gfx::BufferUsage usage) = 0; |
50 | 51 |
51 protected: | 52 protected: |
52 ClientNativePixmapFactory(); | 53 ClientNativePixmapFactory(); |
53 | 54 |
55 virtual void Initialize(const base::FileDescriptor& virtual_device) = 0; | |
reveman
2015/08/13 18:05:28
if this can't fail, why not pass the fd to the cto
dshwang
2015/08/14 12:40:03
Replace it with SetVgemFD()
| |
56 | |
54 private: | 57 private: |
55 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactory); | 58 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactory); |
56 }; | 59 }; |
57 | 60 |
58 } // namespace ui | 61 } // namespace ui |
59 | 62 |
60 #endif // UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_FACTORY_H_ | 63 #endif // UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_FACTORY_H_ |
OLD | NEW |