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 12 matching lines...) Expand all Loading... |
23 }; | 23 }; |
24 | 24 |
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) | |
34 uint32 io_surface_id; | |
35 #endif | |
36 }; | 33 }; |
37 | 34 |
38 // This interface typically correspond to a type of shared memory that is also | 35 // 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 | 36 // 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. | 37 // regular CPU code, but can also be read by the GPU. |
41 class GFX_EXPORT GpuMemoryBuffer { | 38 class GFX_EXPORT GpuMemoryBuffer { |
42 public: | 39 public: |
43 // The format needs to be taken into account when mapping a buffer into the | 40 // The format needs to be taken into account when mapping a buffer into the |
44 // client's address space. | 41 // client's address space. |
45 enum Format { | 42 enum Format { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // Returns a platform specific handle for this buffer. | 88 // Returns a platform specific handle for this buffer. |
92 virtual GpuMemoryBufferHandle GetHandle() const = 0; | 89 virtual GpuMemoryBufferHandle GetHandle() const = 0; |
93 | 90 |
94 // Type-checking downcast routine. | 91 // Type-checking downcast routine. |
95 virtual ClientBuffer AsClientBuffer() = 0; | 92 virtual ClientBuffer AsClientBuffer() = 0; |
96 }; | 93 }; |
97 | 94 |
98 } // namespace gfx | 95 } // namespace gfx |
99 | 96 |
100 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ | 97 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ |
OLD | NEW |