OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_GPU_MEMORY_BUFFER_H_ | 5 #ifndef UI_GFX_GPU_MEMORY_BUFFER_H_ |
6 #define UI_GFX_GPU_MEMORY_BUFFER_H_ | 6 #define UI_GFX_GPU_MEMORY_BUFFER_H_ |
7 | 7 |
8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "ui/gfx/gfx_export.h" | 10 #include "ui/gfx/gfx_export.h" |
(...skipping 14 matching lines...) Expand all Loading... | |
25 using GpuMemoryBufferId = int32; | 25 using GpuMemoryBufferId = int32; |
26 | 26 |
27 struct GFX_EXPORT GpuMemoryBufferHandle { | 27 struct GFX_EXPORT GpuMemoryBufferHandle { |
28 GpuMemoryBufferHandle(); | 28 GpuMemoryBufferHandle(); |
29 bool is_null() const { return type == EMPTY_BUFFER; } | 29 bool is_null() const { return type == EMPTY_BUFFER; } |
30 GpuMemoryBufferType type; | 30 GpuMemoryBufferType type; |
31 GpuMemoryBufferId id; | 31 GpuMemoryBufferId id; |
32 base::SharedMemoryHandle handle; | 32 base::SharedMemoryHandle handle; |
33 #if defined(OS_MACOSX) | 33 #if defined(OS_MACOSX) |
34 uint32 io_surface_id; | 34 uint32 io_surface_id; |
35 #elif defined(USE_OZONE) | |
36 base::SharedMemoryHandle device_handle; | |
reveman
2015/05/11 16:40:56
Please use |handle| instead.
dshwang
2015/05/14 12:25:47
|handle| is used for prime fd, and |device_handle|
reveman
2015/05/14 13:22:03
Is the device_handle different for each buffer? If
dshwang
2015/05/14 14:58:15
|device_handle| is kind of singleton. I'll make (C
| |
35 #endif | 37 #endif |
36 }; | 38 }; |
37 | 39 |
38 // This interface typically correspond to a type of shared memory that is also | 40 // This interface typically correspond to a type of shared memory that is also |
39 // shared with the GPU. A GPU memory buffer can be written to directly by | 41 // shared with the GPU. A GPU memory buffer can be written to directly by |
40 // regular CPU code, but can also be read by the GPU. | 42 // regular CPU code, but can also be read by the GPU. |
41 class GFX_EXPORT GpuMemoryBuffer { | 43 class GFX_EXPORT GpuMemoryBuffer { |
42 public: | 44 public: |
43 // The format needs to be taken into account when mapping a buffer into the | 45 // The format needs to be taken into account when mapping a buffer into the |
44 // client's address space. | 46 // client's address space. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 // Returns a platform specific handle for this buffer. | 89 // Returns a platform specific handle for this buffer. |
88 virtual GpuMemoryBufferHandle GetHandle() const = 0; | 90 virtual GpuMemoryBufferHandle GetHandle() const = 0; |
89 | 91 |
90 // Type-checking downcast routine. | 92 // Type-checking downcast routine. |
91 virtual ClientBuffer AsClientBuffer() = 0; | 93 virtual ClientBuffer AsClientBuffer() = 0; |
92 }; | 94 }; |
93 | 95 |
94 } // namespace gfx | 96 } // namespace gfx |
95 | 97 |
96 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ | 98 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ |
OLD | NEW |