| 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" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 using GpuMemoryBufferId = int32; | 27 using GpuMemoryBufferId = int32; |
| 28 | 28 |
| 29 struct GFX_EXPORT GpuMemoryBufferHandle { | 29 struct GFX_EXPORT GpuMemoryBufferHandle { |
| 30 GpuMemoryBufferHandle(); | 30 GpuMemoryBufferHandle(); |
| 31 bool is_null() const { return type == EMPTY_BUFFER; } | 31 bool is_null() const { return type == EMPTY_BUFFER; } |
| 32 GpuMemoryBufferType type; | 32 GpuMemoryBufferType type; |
| 33 GpuMemoryBufferId id; | 33 GpuMemoryBufferId id; |
| 34 base::SharedMemoryHandle handle; | 34 base::SharedMemoryHandle handle; |
| 35 #if defined(USE_OZONE) |
| 36 NativePixmapHandle native_pixmap_handle; |
| 37 #endif |
| 35 }; | 38 }; |
| 36 | 39 |
| 37 base::trace_event::MemoryAllocatorDumpGuid GFX_EXPORT | 40 base::trace_event::MemoryAllocatorDumpGuid GFX_EXPORT |
| 38 GetGpuMemoryBufferGUIDForTracing(uint64 tracing_process_id, | 41 GetGpuMemoryBufferGUIDForTracing(uint64 tracing_process_id, |
| 39 GpuMemoryBufferId buffer_id); | 42 GpuMemoryBufferId buffer_id); |
| 40 | 43 |
| 41 // This interface typically correspond to a type of shared memory that is also | 44 // This interface typically correspond to a type of shared memory that is also |
| 42 // shared with the GPU. A GPU memory buffer can be written to directly by | 45 // shared with the GPU. A GPU memory buffer can be written to directly by |
| 43 // regular CPU code, but can also be read by the GPU. | 46 // regular CPU code, but can also be read by the GPU. |
| 44 class GFX_EXPORT GpuMemoryBuffer { | 47 class GFX_EXPORT GpuMemoryBuffer { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 72 // Returns a platform specific handle for this buffer. | 75 // Returns a platform specific handle for this buffer. |
| 73 virtual GpuMemoryBufferHandle GetHandle() const = 0; | 76 virtual GpuMemoryBufferHandle GetHandle() const = 0; |
| 74 | 77 |
| 75 // Type-checking downcast routine. | 78 // Type-checking downcast routine. |
| 76 virtual ClientBuffer AsClientBuffer() = 0; | 79 virtual ClientBuffer AsClientBuffer() = 0; |
| 77 }; | 80 }; |
| 78 | 81 |
| 79 } // namespace gfx | 82 } // namespace gfx |
| 80 | 83 |
| 81 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ | 84 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ |
| OLD | NEW |