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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 IO_SURFACE_BUFFER, | 32 IO_SURFACE_BUFFER, |
33 SURFACE_TEXTURE_BUFFER, | 33 SURFACE_TEXTURE_BUFFER, |
34 OZONE_NATIVE_PIXMAP, | 34 OZONE_NATIVE_PIXMAP, |
35 GPU_MEMORY_BUFFER_TYPE_LAST = OZONE_NATIVE_PIXMAP | 35 GPU_MEMORY_BUFFER_TYPE_LAST = OZONE_NATIVE_PIXMAP |
36 }; | 36 }; |
37 | 37 |
38 using GpuMemoryBufferId = GenericSharedMemoryId; | 38 using GpuMemoryBufferId = GenericSharedMemoryId; |
39 | 39 |
40 struct GFX_EXPORT GpuMemoryBufferHandle { | 40 struct GFX_EXPORT GpuMemoryBufferHandle { |
41 GpuMemoryBufferHandle(); | 41 GpuMemoryBufferHandle(); |
| 42 GpuMemoryBufferHandle(const GpuMemoryBufferHandle& other); |
42 ~GpuMemoryBufferHandle(); | 43 ~GpuMemoryBufferHandle(); |
43 bool is_null() const { return type == EMPTY_BUFFER; } | 44 bool is_null() const { return type == EMPTY_BUFFER; } |
44 GpuMemoryBufferType type; | 45 GpuMemoryBufferType type; |
45 GpuMemoryBufferId id; | 46 GpuMemoryBufferId id; |
46 base::SharedMemoryHandle handle; | 47 base::SharedMemoryHandle handle; |
47 uint32_t offset; | 48 uint32_t offset; |
48 int32_t stride; | 49 int32_t stride; |
49 #if defined(USE_OZONE) | 50 #if defined(USE_OZONE) |
50 NativePixmapHandle native_pixmap_handle; | 51 NativePixmapHandle native_pixmap_handle; |
51 #elif defined(OS_MACOSX) && !defined(OS_IOS) | 52 #elif defined(OS_MACOSX) && !defined(OS_IOS) |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // Returns a platform specific handle for this buffer. | 102 // Returns a platform specific handle for this buffer. |
102 virtual GpuMemoryBufferHandle GetHandle() const = 0; | 103 virtual GpuMemoryBufferHandle GetHandle() const = 0; |
103 | 104 |
104 // Type-checking downcast routine. | 105 // Type-checking downcast routine. |
105 virtual ClientBuffer AsClientBuffer() = 0; | 106 virtual ClientBuffer AsClientBuffer() = 0; |
106 }; | 107 }; |
107 | 108 |
108 } // namespace gfx | 109 } // namespace gfx |
109 | 110 |
110 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ | 111 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ |
OLD | NEW |