| 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 <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  Loading... | 
|  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_ | 
| OLD | NEW |