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

Side by Side Diff: gpu/command_buffer/client/client_test_helper.cc

Issue 213353005: Refactor gpu::Buffer to allow different types of backing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix pointer alignment in tests Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Tests for GLES2Implementation. 5 // Tests for GLES2Implementation.
6 6
7 #include "gpu/command_buffer/client/client_test_helper.h" 7 #include "gpu/command_buffer/client/client_test_helper.h"
8 8
9 #include "gpu/command_buffer/common/command_buffer.h" 9 #include "gpu/command_buffer/common/command_buffer.h"
10 #include "gpu/command_buffer/client/cmd_buffer_helper.h" 10 #include "gpu/command_buffer/client/cmd_buffer_helper.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 68 }
69 69
70 scoped_refptr<gpu::Buffer> MockCommandBufferBase::CreateTransferBuffer( 70 scoped_refptr<gpu::Buffer> MockCommandBufferBase::CreateTransferBuffer(
71 size_t size, 71 size_t size,
72 int32* id) { 72 int32* id) {
73 *id = GetNextFreeTransferBufferId(); 73 *id = GetNextFreeTransferBufferId();
74 if (*id >= 0) { 74 if (*id >= 0) {
75 int32 ndx = *id - kTransferBufferBaseId; 75 int32 ndx = *id - kTransferBufferBaseId;
76 scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory()); 76 scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
77 shared_memory->CreateAndMapAnonymous(size); 77 shared_memory->CreateAndMapAnonymous(size);
78 transfer_buffer_buffers_[ndx] = new gpu::Buffer(shared_memory.Pass(), size); 78 transfer_buffer_buffers_[ndx] =
79 MakeBufferFromSharedMemory(shared_memory.Pass(), size);
79 } 80 }
80 return GetTransferBuffer(*id); 81 return GetTransferBuffer(*id);
81 } 82 }
82 83
83 void MockCommandBufferBase::DestroyTransferBufferHelper(int32 id) { 84 void MockCommandBufferBase::DestroyTransferBufferHelper(int32 id) {
84 DCHECK_GE(id, kTransferBufferBaseId); 85 DCHECK_GE(id, kTransferBufferBaseId);
85 DCHECK_LT(id, kTransferBufferBaseId + kMaxTransferBuffers); 86 DCHECK_LT(id, kTransferBufferBaseId + kMaxTransferBuffers);
86 id -= kTransferBufferBaseId; 87 id -= kTransferBufferBaseId;
87 transfer_buffer_buffers_[id] = NULL; 88 transfer_buffer_buffers_[id] = NULL;
88 } 89 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 153
153 MockClientGpuControl::MockClientGpuControl() { 154 MockClientGpuControl::MockClientGpuControl() {
154 } 155 }
155 156
156 MockClientGpuControl::~MockClientGpuControl() { 157 MockClientGpuControl::~MockClientGpuControl() {
157 } 158 }
158 159
159 } // namespace gpu 160 } // namespace gpu
160 161
161 162
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.cc ('k') | gpu/command_buffer/client/mapped_memory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698