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

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

Issue 2087673002: Remove CreateGpuMemoryBufferFromClientId and plumbing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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
« no previous file with comments | « cc/test/test_gpu_memory_buffer_manager.h ('k') | components/exo/buffer.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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 buffers_[last_gpu_memory_buffer_id_] = result.get(); 207 buffers_[last_gpu_memory_buffer_id_] = result.get();
208 return result; 208 return result;
209 } 209 }
210 210
211 gfx::GpuMemoryBuffer* 211 gfx::GpuMemoryBuffer*
212 TestGpuMemoryBufferManager::GpuMemoryBufferFromClientBuffer( 212 TestGpuMemoryBufferManager::GpuMemoryBufferFromClientBuffer(
213 ClientBuffer buffer) { 213 ClientBuffer buffer) {
214 return reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer); 214 return reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer);
215 } 215 }
216 216
217 std::unique_ptr<gfx::GpuMemoryBuffer>
218 TestGpuMemoryBufferManager::CreateGpuMemoryBufferFromClientId(
219 int client_id,
220 const gfx::GpuMemoryBufferId& gpu_memory_buffer_id) {
221 // Check that the client and id are valid to ensure that the ResourceProvider
222 // is doing appropriate validation.
223 auto client_it = clients_.find(client_id);
224 DCHECK(client_it != clients_.end());
225 auto buffer_it = client_it->second->buffers_.find(gpu_memory_buffer_id.id);
226 DCHECK(buffer_it != client_it->second->buffers_.end());
227
228 gfx::GpuMemoryBuffer* found = buffer_it->second;
229
230 last_gpu_memory_buffer_id_ += 1;
231 std::unique_ptr<gfx::GpuMemoryBuffer> result(
232 new GpuMemoryBufferFromClient(this, last_gpu_memory_buffer_id_, found));
233 buffers_[last_gpu_memory_buffer_id_] = result.get();
234 return result;
235 }
236
237 void TestGpuMemoryBufferManager::SetDestructionSyncToken( 217 void TestGpuMemoryBufferManager::SetDestructionSyncToken(
238 gfx::GpuMemoryBuffer* buffer, 218 gfx::GpuMemoryBuffer* buffer,
239 const gpu::SyncToken& sync_token) {} 219 const gpu::SyncToken& sync_token) {}
240 220
241 } // namespace cc 221 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_gpu_memory_buffer_manager.h ('k') | components/exo/buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698