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

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

Issue 2683593006: Use OS_LINUX instead of USE_OZONE in ui/gfx/ when possible (Closed)
Patch Set: Rebase Created 3 years, 9 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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <vector> 11 #include <vector>
12 12
13 #include "build/build_config.h"
13 #include "ui/gfx/gfx_export.h" 14 #include "ui/gfx/gfx_export.h"
14 15
15 #if defined(USE_OZONE) 16 #if defined(OS_LINUX)
16 #include "base/file_descriptor_posix.h" 17 #include "base/file_descriptor_posix.h"
17 #endif 18 #endif
18 19
19 namespace gfx { 20 namespace gfx {
20 21
21 // NativePixmapPlane is used to carry the plane related information for GBM 22 // NativePixmapPlane is used to carry the plane related information for GBM
22 // buffer. More fields can be added if they are plane specific. 23 // buffer. More fields can be added if they are plane specific.
23 struct GFX_EXPORT NativePixmapPlane { 24 struct GFX_EXPORT NativePixmapPlane {
24 NativePixmapPlane(); 25 NativePixmapPlane();
25 NativePixmapPlane(int stride, int offset, uint64_t size, uint64_t modifier); 26 NativePixmapPlane(int stride, int offset, uint64_t size, uint64_t modifier);
(...skipping 12 matching lines...) Expand all
38 // Chromium code. Also one per plane per entry. 39 // Chromium code. Also one per plane per entry.
39 uint64_t modifier; 40 uint64_t modifier;
40 }; 41 };
41 42
42 struct GFX_EXPORT NativePixmapHandle { 43 struct GFX_EXPORT NativePixmapHandle {
43 NativePixmapHandle(); 44 NativePixmapHandle();
44 NativePixmapHandle(const NativePixmapHandle& other); 45 NativePixmapHandle(const NativePixmapHandle& other);
45 46
46 ~NativePixmapHandle(); 47 ~NativePixmapHandle();
47 48
48 #if defined(USE_OZONE) 49 #if defined(OS_LINUX)
49 // File descriptors for the underlying memory objects (usually dmabufs). 50 // File descriptors for the underlying memory objects (usually dmabufs).
50 std::vector<base::FileDescriptor> fds; 51 std::vector<base::FileDescriptor> fds;
51 #endif 52 #endif
52 std::vector<NativePixmapPlane> planes; 53 std::vector<NativePixmapPlane> planes;
53 }; 54 };
54 55
55 #if defined(USE_OZONE) 56 #if defined(OS_LINUX)
56 // Returns an instance of |handle| which can be sent over IPC. This duplicates 57 // Returns an instance of |handle| which can be sent over IPC. This duplicates
57 // the file-handles, so that the IPC code take ownership of them, without 58 // the file-handles, so that the IPC code take ownership of them, without
58 // invalidating |handle|. 59 // invalidating |handle|.
59 NativePixmapHandle CloneHandleForIPC(const NativePixmapHandle& handle); 60 NativePixmapHandle CloneHandleForIPC(const NativePixmapHandle& handle);
60 #endif 61 #endif
61 62
62 } // namespace gfx 63 } // namespace gfx
63 64
64 #endif // UI_GFX_NATIVE_PIXMAP_HANDLE_H_ 65 #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