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/files/scoped_file.h" | 10 #include "base/files/scoped_file.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 static ClientNativePixmapFactory* GetInstance(); | 27 static ClientNativePixmapFactory* GetInstance(); |
28 static void SetInstance(ClientNativePixmapFactory* instance); | 28 static void SetInstance(ClientNativePixmapFactory* instance); |
29 | 29 |
30 static scoped_ptr<ClientNativePixmapFactory> Create(); | 30 static scoped_ptr<ClientNativePixmapFactory> Create(); |
31 | 31 |
32 virtual ~ClientNativePixmapFactory(); | 32 virtual ~ClientNativePixmapFactory(); |
33 | 33 |
34 // Initialize with the given client native pixmap |device_fd|. | 34 // Initialize with the given client native pixmap |device_fd|. |
35 virtual void Initialize(base::ScopedFD device_fd) = 0; | 35 virtual void Initialize(base::ScopedFD device_fd) = 0; |
36 | 36 |
37 struct Configuration { | 37 // Returns true if format/usage configuration is supported. |
38 gfx::BufferFormat format; | 38 virtual bool IsConfigurationSupported(gfx::BufferFormat format, |
39 gfx::BufferUsage usage; | 39 gfx::BufferUsage usage) const = 0; |
40 }; | |
41 | |
42 // Gets supported format/usage configurations. | |
43 virtual std::vector<Configuration> GetSupportedConfigurations() const = 0; | |
44 | 40 |
45 // TODO(dshwang): implement it. crbug.com/475633 | 41 // TODO(dshwang): implement it. crbug.com/475633 |
46 // Import the native pixmap from |handle| to be used in non-GPU processes. | 42 // Import the native pixmap from |handle| to be used in non-GPU processes. |
47 // This function takes ownership of any file descriptors in |handle|. | 43 // This function takes ownership of any file descriptors in |handle|. |
48 virtual scoped_ptr<ClientNativePixmap> ImportFromHandle( | 44 virtual scoped_ptr<ClientNativePixmap> ImportFromHandle( |
49 const gfx::NativePixmapHandle& handle, | 45 const gfx::NativePixmapHandle& handle, |
50 const gfx::Size& size, | 46 const gfx::Size& size, |
51 gfx::BufferUsage usage) = 0; | 47 gfx::BufferUsage usage) = 0; |
52 | 48 |
53 protected: | 49 protected: |
54 ClientNativePixmapFactory(); | 50 ClientNativePixmapFactory(); |
55 | 51 |
56 private: | 52 private: |
57 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactory); | 53 DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactory); |
58 }; | 54 }; |
59 | 55 |
60 } // namespace ui | 56 } // namespace ui |
61 | 57 |
62 #endif // UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_FACTORY_H_ | 58 #endif // UI_OZONE_PUBLIC_CLIENT_NATIVE_PIXMAP_FACTORY_H_ |
OLD | NEW |