Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: ui/gfx/gpu_memory_buffer.h

Issue 1137453002: content: Pass IOSurface references using Mach IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcastagna's review Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 12 matching lines...) Expand all
23 }; 23 };
24 24
25 using GpuMemoryBufferId = int32; 25 using GpuMemoryBufferId = int32;
26 26
27 struct GFX_EXPORT GpuMemoryBufferHandle { 27 struct GFX_EXPORT GpuMemoryBufferHandle {
28 GpuMemoryBufferHandle(); 28 GpuMemoryBufferHandle();
29 bool is_null() const { return type == EMPTY_BUFFER; } 29 bool is_null() const { return type == EMPTY_BUFFER; }
30 GpuMemoryBufferType type; 30 GpuMemoryBufferType type;
31 GpuMemoryBufferId id; 31 GpuMemoryBufferId id;
32 base::SharedMemoryHandle handle; 32 base::SharedMemoryHandle handle;
33 #if defined(OS_MACOSX)
34 uint32 io_surface_id;
35 #endif
36 }; 33 };
37 34
38 // This interface typically correspond to a type of shared memory that is also 35 // This interface typically correspond to a type of shared memory that is also
39 // shared with the GPU. A GPU memory buffer can be written to directly by 36 // shared with the GPU. A GPU memory buffer can be written to directly by
40 // regular CPU code, but can also be read by the GPU. 37 // regular CPU code, but can also be read by the GPU.
41 class GFX_EXPORT GpuMemoryBuffer { 38 class GFX_EXPORT GpuMemoryBuffer {
42 public: 39 public:
43 // The format needs to be taken into account when mapping a buffer into the 40 // The format needs to be taken into account when mapping a buffer into the
44 // client's address space. 41 // client's address space.
45 enum Format { 42 enum Format {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // Returns a platform specific handle for this buffer. 84 // Returns a platform specific handle for this buffer.
88 virtual GpuMemoryBufferHandle GetHandle() const = 0; 85 virtual GpuMemoryBufferHandle GetHandle() const = 0;
89 86
90 // Type-checking downcast routine. 87 // Type-checking downcast routine.
91 virtual ClientBuffer AsClientBuffer() = 0; 88 virtual ClientBuffer AsClientBuffer() = 0;
92 }; 89 };
93 90
94 } // namespace gfx 91 } // namespace gfx
95 92
96 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_ 93 #endif // UI_GFX_GPU_MEMORY_BUFFER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698