| 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 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 struct GFX_EXPORT GpuMemoryBufferHandle { | 42 struct GFX_EXPORT GpuMemoryBufferHandle { |
| 43 GpuMemoryBufferHandle(); | 43 GpuMemoryBufferHandle(); |
| 44 GpuMemoryBufferHandle(const GpuMemoryBufferHandle& other); | 44 GpuMemoryBufferHandle(const GpuMemoryBufferHandle& other); |
| 45 ~GpuMemoryBufferHandle(); | 45 ~GpuMemoryBufferHandle(); |
| 46 bool is_null() const { return type == EMPTY_BUFFER; } | 46 bool is_null() const { return type == EMPTY_BUFFER; } |
| 47 GpuMemoryBufferType type; | 47 GpuMemoryBufferType type; |
| 48 GpuMemoryBufferId id; | 48 GpuMemoryBufferId id; |
| 49 base::SharedMemoryHandle handle; | 49 base::SharedMemoryHandle handle; |
| 50 uint32_t offset; | 50 uint32_t offset; |
| 51 int32_t stride; | 51 uint32_t stride; |
| 52 #if defined(USE_OZONE) | 52 #if defined(USE_OZONE) |
| 53 NativePixmapHandle native_pixmap_handle; | 53 NativePixmapHandle native_pixmap_handle; |
| 54 #elif defined(OS_MACOSX) && !defined(OS_IOS) | 54 #elif defined(OS_MACOSX) && !defined(OS_IOS) |
| 55 ScopedRefCountedIOSurfaceMachPort mach_port; | 55 ScopedRefCountedIOSurfaceMachPort mach_port; |
| 56 #endif | 56 #endif |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 base::trace_event::MemoryAllocatorDumpGuid GFX_EXPORT | 59 base::trace_event::MemoryAllocatorDumpGuid GFX_EXPORT |
| 60 GetGpuMemoryBufferGUIDForTracing(uint64_t tracing_process_id, | 60 GetGpuMemoryBufferGUIDForTracing(uint64_t tracing_process_id, |
| 61 GpuMemoryBufferId buffer_id); | 61 GpuMemoryBufferId buffer_id); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 82 virtual void Unmap() = 0; | 82 virtual void Unmap() = 0; |
| 83 | 83 |
| 84 // Returns the size for the buffer. | 84 // Returns the size for the buffer. |
| 85 virtual Size GetSize() const = 0; | 85 virtual Size GetSize() const = 0; |
| 86 | 86 |
| 87 // Returns the format for the buffer. | 87 // Returns the format for the buffer. |
| 88 virtual BufferFormat GetFormat() const = 0; | 88 virtual BufferFormat GetFormat() const = 0; |
| 89 | 89 |
| 90 // Fills the stride in bytes for each plane of the buffer. The stride of | 90 // Fills the stride in bytes for each plane of the buffer. The stride of |
| 91 // plane K is stored at index K-1 of the |stride| array. | 91 // plane K is stored at index K-1 of the |stride| array. |
| 92 virtual int stride(size_t plane) const = 0; | 92 virtual uint32_t stride(size_t plane) const = 0; |
| 93 | 93 |
| 94 // Set the color space in which this buffer should be interpreted when used | 94 // Set the color space in which this buffer should be interpreted when used |
| 95 // for scanout. Note that this will not impact texturing from the buffer. | 95 // for scanout. Note that this will not impact texturing from the buffer. |
| 96 virtual void SetColorSpaceForScanout(const gfx::ColorSpace& color_space); | 96 virtual void SetColorSpaceForScanout(const gfx::ColorSpace& color_space); |
| 97 | 97 |
| 98 // Returns a unique identifier associated with buffer. | 98 // Returns a unique identifier associated with buffer. |
| 99 virtual GpuMemoryBufferId GetId() const = 0; | 99 virtual GpuMemoryBufferId GetId() const = 0; |
| 100 | 100 |
| 101 // Returns a platform specific handle for this buffer. | 101 // Returns a platform specific handle for this buffer. |
| 102 virtual GpuMemoryBufferHandle GetHandle() const = 0; | 102 virtual GpuMemoryBufferHandle GetHandle() const = 0; |
| 103 | 103 |
| 104 // Type-checking downcast routine. | 104 // Type-checking downcast routine. |
| 105 virtual ClientBuffer AsClientBuffer() = 0; | 105 virtual ClientBuffer AsClientBuffer() = 0; |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 } // namespace gfx | 108 } // namespace gfx |
| 109 | 109 |
| 110 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ | 110 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ |
| OLD | NEW |