OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |