OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "blimp/client/support/compositor/blimp_gpu_memory_buffer_manager.h" | 5 #include "blimp/client/support/compositor/blimp_gpu_memory_buffer_manager.h" |
6 | 6 |
7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 ++format_idx) { | 113 ++format_idx) { |
114 gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx); | 114 gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx); |
115 image_targets.insert(cc::BufferToTextureTargetMap::value_type( | 115 image_targets.insert(cc::BufferToTextureTargetMap::value_type( |
116 cc::BufferToTextureTargetKey(usage, format), GL_TEXTURE_2D)); | 116 cc::BufferToTextureTargetKey(usage, format), GL_TEXTURE_2D)); |
117 } | 117 } |
118 } | 118 } |
119 return image_targets; | 119 return image_targets; |
120 } | 120 } |
121 | 121 |
122 std::unique_ptr<gfx::GpuMemoryBuffer> | 122 std::unique_ptr<gfx::GpuMemoryBuffer> |
123 BlimpGpuMemoryBufferManager::AllocateGpuMemoryBuffer( | 123 BlimpGpuMemoryBufferManager::CreateGpuMemoryBuffer( |
124 const gfx::Size& size, | 124 const gfx::Size& size, |
125 gfx::BufferFormat format, | 125 gfx::BufferFormat format, |
126 gfx::BufferUsage usage, | 126 gfx::BufferUsage usage, |
127 gpu::SurfaceHandle surface_handle) { | 127 gpu::SurfaceHandle surface_handle) { |
128 DCHECK_EQ(gpu::kNullSurfaceHandle, surface_handle) | 128 DCHECK_EQ(gpu::kNullSurfaceHandle, surface_handle) |
129 << "Blimp should not be allocating scanout buffers"; | 129 << "Blimp should not be allocating scanout buffers"; |
130 std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory); | 130 std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory); |
131 const size_t buffer_size = gfx::BufferSizeForBufferFormat(size, format); | 131 const size_t buffer_size = gfx::BufferSizeForBufferFormat(size, format); |
132 if (!shared_memory->CreateAnonymous(buffer_size)) | 132 if (!shared_memory->CreateAnonymous(buffer_size)) |
133 return nullptr; | 133 return nullptr; |
(...skipping 17 matching lines...) Expand all Loading... |
151 } | 151 } |
152 | 152 |
153 void BlimpGpuMemoryBufferManager::SetDestructionSyncToken( | 153 void BlimpGpuMemoryBufferManager::SetDestructionSyncToken( |
154 gfx::GpuMemoryBuffer* buffer, | 154 gfx::GpuMemoryBuffer* buffer, |
155 const gpu::SyncToken& sync_token) { | 155 const gpu::SyncToken& sync_token) { |
156 NOTIMPLEMENTED(); | 156 NOTIMPLEMENTED(); |
157 } | 157 } |
158 | 158 |
159 } // namespace client | 159 } // namespace client |
160 } // namespace blimp | 160 } // namespace blimp |
OLD | NEW |