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