| 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 23 matching lines...) Expand all Loading... |
| 34 int32 primary_id; | 34 int32 primary_id; |
| 35 int32 secondary_id; | 35 int32 secondary_id; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 struct GFX_EXPORT GpuMemoryBufferHandle { | 38 struct GFX_EXPORT GpuMemoryBufferHandle { |
| 39 GpuMemoryBufferHandle(); | 39 GpuMemoryBufferHandle(); |
| 40 bool is_null() const { return type == EMPTY_BUFFER; } | 40 bool is_null() const { return type == EMPTY_BUFFER; } |
| 41 GpuMemoryBufferType type; | 41 GpuMemoryBufferType type; |
| 42 base::SharedMemoryHandle handle; | 42 base::SharedMemoryHandle handle; |
| 43 GpuMemoryBufferId global_id; | 43 GpuMemoryBufferId global_id; |
| 44 #if defined(OS_MACOSX) | |
| 45 uint32 io_surface_id; | |
| 46 #endif | |
| 47 #if defined(USE_X11) | 44 #if defined(USE_X11) |
| 48 XID pixmap; | 45 XID pixmap; |
| 49 #endif | 46 #endif |
| 50 }; | 47 }; |
| 51 | 48 |
| 52 // This interface typically correspond to a type of shared memory that is also | 49 // This interface typically correspond to a type of shared memory that is also |
| 53 // shared with the GPU. A GPU memory buffer can be written to directly by | 50 // shared with the GPU. A GPU memory buffer can be written to directly by |
| 54 // regular CPU code, but can also be read by the GPU. | 51 // regular CPU code, but can also be read by the GPU. |
| 55 class GFX_EXPORT GpuMemoryBuffer { | 52 class GFX_EXPORT GpuMemoryBuffer { |
| 56 public: | 53 public: |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // Returns a platform specific handle for this buffer. | 93 // Returns a platform specific handle for this buffer. |
| 97 virtual GpuMemoryBufferHandle GetHandle() const = 0; | 94 virtual GpuMemoryBufferHandle GetHandle() const = 0; |
| 98 | 95 |
| 99 // Type-checking downcast routine. | 96 // Type-checking downcast routine. |
| 100 virtual ClientBuffer AsClientBuffer() = 0; | 97 virtual ClientBuffer AsClientBuffer() = 0; |
| 101 }; | 98 }; |
| 102 | 99 |
| 103 } // namespace gfx | 100 } // namespace gfx |
| 104 | 101 |
| 105 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ | 102 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ |
| OLD | NEW |