Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: ui/gfx/native_pixmap_handle.h

Issue 2272153002: Add ClientNativePixmap multi-planar support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@client-native-pixmap-dmabug-multiple-planes
Patch Set: ifdef USE_OZONE for unused variables. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gfx/mojo/struct_traits_unittest.cc ('k') | ui/gfx/native_pixmap_handle.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_
OLDNEW
« no previous file with comments | « ui/gfx/mojo/struct_traits_unittest.cc ('k') | ui/gfx/native_pixmap_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698