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_GFX_NATIVE_PIXMAP_HANDLE_OZONE_H_ | 5 #ifndef UI_GFX_NATIVE_PIXMAP_HANDLE_H_ |
6 #define UI_GFX_NATIVE_PIXMAP_HANDLE_OZONE_H_ | 6 #define UI_GFX_NATIVE_PIXMAP_HANDLE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
| 11 #include "ui/gfx/gfx_export.h" |
| 12 |
| 13 #if defined(USE_OZONE) |
11 #include "base/file_descriptor_posix.h" | 14 #include "base/file_descriptor_posix.h" |
12 #include "ui/gfx/gfx_export.h" | 15 #endif |
13 | 16 |
14 namespace gfx { | 17 namespace gfx { |
15 | 18 |
16 // NativePixmapPlane is used to carry the plane related information for GBM | 19 // NativePixmapPlane is used to carry the plane related information for GBM |
17 // buffer. More fields can be added if they are plane specific. | 20 // buffer. More fields can be added if they are plane specific. |
18 struct GFX_EXPORT NativePixmapPlane { | 21 struct GFX_EXPORT NativePixmapPlane { |
19 NativePixmapPlane(); | 22 NativePixmapPlane(); |
20 NativePixmapPlane(int stride, int offset, uint64_t modifier); | 23 NativePixmapPlane(int stride, int offset, uint64_t modifier); |
21 NativePixmapPlane(const NativePixmapPlane& other); | 24 NativePixmapPlane(const NativePixmapPlane& other); |
22 ~NativePixmapPlane(); | 25 ~NativePixmapPlane(); |
23 | 26 |
24 // The strides and offsets in bytes to be used when accessing the buffers via | 27 // The strides and offsets in bytes to be used when accessing the buffers via |
25 // a memory mapping. One per plane per entry. | 28 // a memory mapping. One per plane per entry. |
26 int stride; | 29 int stride; |
27 int offset; | 30 int offset; |
28 // The modifier is retrieved from GBM library and passed to EGL driver. | 31 // The modifier is retrieved from GBM library and passed to EGL driver. |
29 // Generally it's platform specific, and we don't need to modify it in | 32 // Generally it's platform specific, and we don't need to modify it in |
30 // Chromium code. Also one per plane per entry. | 33 // Chromium code. Also one per plane per entry. |
31 uint64_t modifier; | 34 uint64_t modifier; |
32 }; | 35 }; |
33 | 36 |
34 struct GFX_EXPORT NativePixmapHandle { | 37 struct GFX_EXPORT NativePixmapHandle { |
35 NativePixmapHandle(); | 38 NativePixmapHandle(); |
36 NativePixmapHandle(const NativePixmapHandle& other); | 39 NativePixmapHandle(const NativePixmapHandle& other); |
37 | 40 |
38 ~NativePixmapHandle(); | 41 ~NativePixmapHandle(); |
| 42 |
| 43 #if defined(USE_OZONE) |
39 // File descriptors for the underlying memory objects (usually dmabufs). | 44 // File descriptors for the underlying memory objects (usually dmabufs). |
40 std::vector<base::FileDescriptor> fds; | 45 std::vector<base::FileDescriptor> fds; |
41 | 46 #endif |
42 std::vector<NativePixmapPlane> planes; | 47 std::vector<NativePixmapPlane> planes; |
43 }; | 48 }; |
44 | 49 |
45 } // namespace gfx | 50 } // namespace gfx |
46 | 51 |
47 #endif // UI_GFX_NATIVE_PIXMAP_HANDLE_OZONE_H_ | 52 #endif // UI_GFX_NATIVE_PIXMAP_HANDLE_H_ |
OLD | NEW |