| 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 "base/trace_event/memory_dump_manager.h" | 9 #include "base/trace_event/memory_dump_manager.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "ui/gfx/gfx_export.h" | 11 #include "ui/gfx/gfx_export.h" |
| 12 | 12 |
| 13 extern "C" typedef struct _ClientBuffer* ClientBuffer; | 13 extern "C" typedef struct _ClientBuffer* ClientBuffer; |
| 14 | 14 |
| 15 namespace gfx { | 15 namespace gfx { |
| 16 | 16 |
| 17 enum GpuMemoryBufferType { | 17 enum GpuMemoryBufferType { |
| 18 EMPTY_BUFFER, | 18 EMPTY_BUFFER, |
| 19 SHARED_MEMORY_BUFFER, | 19 SHARED_MEMORY_BUFFER, |
| 20 IO_SURFACE_BUFFER, | 20 IO_SURFACE_BUFFER, |
| 21 SURFACE_TEXTURE_BUFFER, | 21 SURFACE_TEXTURE_BUFFER, |
| 22 OZONE_NATIVE_BUFFER, | 22 OZONE_NATIVE_PIXMAP, |
| 23 GPU_MEMORY_BUFFER_TYPE_LAST = OZONE_NATIVE_BUFFER | 23 GPU_MEMORY_BUFFER_TYPE_LAST = OZONE_NATIVE_PIXMAP |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 using GpuMemoryBufferId = int32; | 26 using GpuMemoryBufferId = int32; |
| 27 | 27 |
| 28 struct GFX_EXPORT GpuMemoryBufferHandle { | 28 struct GFX_EXPORT GpuMemoryBufferHandle { |
| 29 GpuMemoryBufferHandle(); | 29 GpuMemoryBufferHandle(); |
| 30 bool is_null() const { return type == EMPTY_BUFFER; } | 30 bool is_null() const { return type == EMPTY_BUFFER; } |
| 31 GpuMemoryBufferType type; | 31 GpuMemoryBufferType type; |
| 32 GpuMemoryBufferId id; | 32 GpuMemoryBufferId id; |
| 33 base::SharedMemoryHandle handle; | 33 base::SharedMemoryHandle handle; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // Returns a platform specific handle for this buffer. | 96 // Returns a platform specific handle for this buffer. |
| 97 virtual GpuMemoryBufferHandle GetHandle() const = 0; | 97 virtual GpuMemoryBufferHandle GetHandle() const = 0; |
| 98 | 98 |
| 99 // Type-checking downcast routine. | 99 // Type-checking downcast routine. |
| 100 virtual ClientBuffer AsClientBuffer() = 0; | 100 virtual ClientBuffer AsClientBuffer() = 0; |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 } // namespace gfx | 103 } // namespace gfx |
| 104 | 104 |
| 105 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ | 105 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ |
| OLD | NEW |