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

Side by Side Diff: cc/test/test_gpu_memory_buffer_manager.cc

Issue 2526683002: gpu: Rename AllocateGpuMemoryBuffer to CreateGpuMemoryBuffer. (Closed)
Patch Set: . Created 4 years 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
« no previous file with comments | « cc/test/test_gpu_memory_buffer_manager.h ('k') | components/display_compositor/buffer_queue.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "cc/test/test_gpu_memory_buffer_manager.h" 5 #include "cc/test/test_gpu_memory_buffer_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 return client; 146 return client;
147 } 147 }
148 148
149 void TestGpuMemoryBufferManager::OnGpuMemoryBufferDestroyed( 149 void TestGpuMemoryBufferManager::OnGpuMemoryBufferDestroyed(
150 gfx::GpuMemoryBufferId gpu_memory_buffer_id) { 150 gfx::GpuMemoryBufferId gpu_memory_buffer_id) {
151 DCHECK(buffers_.find(gpu_memory_buffer_id.id) != buffers_.end()); 151 DCHECK(buffers_.find(gpu_memory_buffer_id.id) != buffers_.end());
152 buffers_.erase(gpu_memory_buffer_id.id); 152 buffers_.erase(gpu_memory_buffer_id.id);
153 } 153 }
154 154
155 std::unique_ptr<gfx::GpuMemoryBuffer> 155 std::unique_ptr<gfx::GpuMemoryBuffer>
156 TestGpuMemoryBufferManager::AllocateGpuMemoryBuffer( 156 TestGpuMemoryBufferManager::CreateGpuMemoryBuffer(
157 const gfx::Size& size, 157 const gfx::Size& size,
158 gfx::BufferFormat format, 158 gfx::BufferFormat format,
159 gfx::BufferUsage usage, 159 gfx::BufferUsage usage,
160 gpu::SurfaceHandle surface_handle) { 160 gpu::SurfaceHandle surface_handle) {
161 std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory); 161 std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory);
162 const size_t buffer_size = gfx::BufferSizeForBufferFormat(size, format); 162 const size_t buffer_size = gfx::BufferSizeForBufferFormat(size, format);
163 if (!shared_memory->CreateAnonymous(buffer_size)) 163 if (!shared_memory->CreateAnonymous(buffer_size))
164 return nullptr; 164 return nullptr;
165 165
166 last_gpu_memory_buffer_id_ += 1; 166 last_gpu_memory_buffer_id_ += 1;
(...skipping 20 matching lines...) Expand all
187 handle.stride)); 187 handle.stride));
188 buffers_[last_gpu_memory_buffer_id_] = result.get(); 188 buffers_[last_gpu_memory_buffer_id_] = result.get();
189 return result; 189 return result;
190 } 190 }
191 191
192 void TestGpuMemoryBufferManager::SetDestructionSyncToken( 192 void TestGpuMemoryBufferManager::SetDestructionSyncToken(
193 gfx::GpuMemoryBuffer* buffer, 193 gfx::GpuMemoryBuffer* buffer,
194 const gpu::SyncToken& sync_token) {} 194 const gpu::SyncToken& sync_token) {}
195 195
196 } // namespace cc 196 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_gpu_memory_buffer_manager.h ('k') | components/display_compositor/buffer_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698