| 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" |
| 11 | 11 |
| 12 #if defined(USE_X11) | 12 #if defined(USE_X11) |
| 13 #include "ui/gfx/x/x11_types.h" | 13 #include "ui/gfx/x/x11_types.h" |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 extern "C" typedef struct _ClientBuffer* ClientBuffer; | 16 extern "C" typedef struct _ClientBuffer* ClientBuffer; |
| 17 | 17 |
| 18 namespace gfx { | 18 namespace gfx { |
| 19 | 19 |
| 20 enum GpuMemoryBufferType { | 20 enum GpuMemoryBufferType { |
| 21 EMPTY_BUFFER, | 21 EMPTY_BUFFER, |
| 22 SHARED_MEMORY_BUFFER, | 22 SHARED_MEMORY_BUFFER, |
| 23 IO_SURFACE_BUFFER, | 23 IO_SURFACE_BUFFER, |
| 24 ANDROID_NATIVE_BUFFER, | |
| 25 SURFACE_TEXTURE_BUFFER, | 24 SURFACE_TEXTURE_BUFFER, |
| 26 X11_PIXMAP_BUFFER, | 25 X11_PIXMAP_BUFFER, |
| 27 OZONE_NATIVE_BUFFER, | 26 OZONE_NATIVE_BUFFER, |
| 28 GPU_MEMORY_BUFFER_TYPE_LAST = OZONE_NATIVE_BUFFER | 27 GPU_MEMORY_BUFFER_TYPE_LAST = OZONE_NATIVE_BUFFER |
| 29 }; | 28 }; |
| 30 | 29 |
| 31 struct GpuMemoryBufferId { | 30 struct GpuMemoryBufferId { |
| 32 GpuMemoryBufferId() : primary_id(0), secondary_id(0) {} | 31 GpuMemoryBufferId() : primary_id(0), secondary_id(0) {} |
| 33 GpuMemoryBufferId(int32 primary_id, int32 secondary_id) | 32 GpuMemoryBufferId(int32 primary_id, int32 secondary_id) |
| 34 : primary_id(primary_id), secondary_id(secondary_id) {} | 33 : primary_id(primary_id), secondary_id(secondary_id) {} |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // Returns a platform specific handle for this buffer. | 86 // Returns a platform specific handle for this buffer. |
| 88 virtual GpuMemoryBufferHandle GetHandle() const = 0; | 87 virtual GpuMemoryBufferHandle GetHandle() const = 0; |
| 89 | 88 |
| 90 // Type-checking downcast routine. | 89 // Type-checking downcast routine. |
| 91 virtual ClientBuffer AsClientBuffer() = 0; | 90 virtual ClientBuffer AsClientBuffer() = 0; |
| 92 }; | 91 }; |
| 93 | 92 |
| 94 } // namespace gfx | 93 } // namespace gfx |
| 95 | 94 |
| 96 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ | 95 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ |
| OLD | NEW |