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> |
| 9 #include <stdint.h> |
| 10 |
8 #include "base/memory/shared_memory.h" | 11 #include "base/memory/shared_memory.h" |
9 #include "base/trace_event/memory_dump_manager.h" | 12 #include "base/trace_event/memory_dump_manager.h" |
10 #include "build/build_config.h" | 13 #include "build/build_config.h" |
11 #include "ui/gfx/buffer_types.h" | 14 #include "ui/gfx/buffer_types.h" |
12 #include "ui/gfx/generic_shared_memory_id.h" | 15 #include "ui/gfx/generic_shared_memory_id.h" |
13 #include "ui/gfx/geometry/rect.h" | 16 #include "ui/gfx/geometry/rect.h" |
14 #include "ui/gfx/gfx_export.h" | 17 #include "ui/gfx/gfx_export.h" |
15 | 18 |
16 #if defined(USE_OZONE) | 19 #if defined(USE_OZONE) |
17 #include "ui/gfx/native_pixmap_handle_ozone.h" | 20 #include "ui/gfx/native_pixmap_handle_ozone.h" |
(...skipping 21 matching lines...) Expand all Loading... |
39 GpuMemoryBufferId id; | 42 GpuMemoryBufferId id; |
40 base::SharedMemoryHandle handle; | 43 base::SharedMemoryHandle handle; |
41 uint32_t offset; | 44 uint32_t offset; |
42 int32_t stride; | 45 int32_t stride; |
43 #if defined(USE_OZONE) | 46 #if defined(USE_OZONE) |
44 NativePixmapHandle native_pixmap_handle; | 47 NativePixmapHandle native_pixmap_handle; |
45 #endif | 48 #endif |
46 }; | 49 }; |
47 | 50 |
48 base::trace_event::MemoryAllocatorDumpGuid GFX_EXPORT | 51 base::trace_event::MemoryAllocatorDumpGuid GFX_EXPORT |
49 GetGpuMemoryBufferGUIDForTracing(uint64 tracing_process_id, | 52 GetGpuMemoryBufferGUIDForTracing(uint64_t tracing_process_id, |
50 GpuMemoryBufferId buffer_id); | 53 GpuMemoryBufferId buffer_id); |
51 | 54 |
52 // This interface typically correspond to a type of shared memory that is also | 55 // 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 | 56 // 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. | 57 // regular CPU code, but can also be read by the GPU. |
55 class GFX_EXPORT GpuMemoryBuffer { | 58 class GFX_EXPORT GpuMemoryBuffer { |
56 public: | 59 public: |
57 virtual ~GpuMemoryBuffer() {} | 60 virtual ~GpuMemoryBuffer() {} |
58 | 61 |
59 // Maps each plane of the buffer into the client's address space so it can be | 62 // Maps each plane of the buffer into the client's address space so it can be |
(...skipping 26 matching lines...) Expand all Loading... |
86 // Returns a platform specific handle for this buffer. | 89 // Returns a platform specific handle for this buffer. |
87 virtual GpuMemoryBufferHandle GetHandle() const = 0; | 90 virtual GpuMemoryBufferHandle GetHandle() const = 0; |
88 | 91 |
89 // Type-checking downcast routine. | 92 // Type-checking downcast routine. |
90 virtual ClientBuffer AsClientBuffer() = 0; | 93 virtual ClientBuffer AsClientBuffer() = 0; |
91 }; | 94 }; |
92 | 95 |
93 } // namespace gfx | 96 } // namespace gfx |
94 | 97 |
95 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ | 98 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ |
OLD | NEW |