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 // A class to Manage a growing transfer buffer. | 5 // A class to Manage a growing transfer buffer. |
6 | 6 |
7 #include "../client/transfer_buffer.h" | 7 #include "gpu/command_buffer/client/transfer_buffer.h" |
8 #include "../client/cmd_buffer_helper.h" | 8 #include "gpu/command_buffer/client/cmd_buffer_helper.h" |
9 | 9 |
10 namespace gpu { | 10 namespace gpu { |
11 | 11 |
12 AlignedRingBuffer::~AlignedRingBuffer() { | 12 AlignedRingBuffer::~AlignedRingBuffer() { |
13 } | 13 } |
14 | 14 |
15 TransferBuffer::TransferBuffer( | 15 TransferBuffer::TransferBuffer( |
16 CommandBufferHelper* helper) | 16 CommandBufferHelper* helper) |
17 : helper_(helper), | 17 : helper_(helper), |
18 result_size_(0), | 18 result_size_(0), |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 Release(); | 218 Release(); |
219 // NOTE: we allocate buffers of size 0 so that HaveBuffer will be true, so | 219 // NOTE: we allocate buffers of size 0 so that HaveBuffer will be true, so |
220 // that address will return a pointer just like malloc, and so that GetShmId | 220 // that address will return a pointer just like malloc, and so that GetShmId |
221 // will be valid. That has the side effect that we'll insert a token on free. | 221 // will be valid. That has the side effect that we'll insert a token on free. |
222 // We could add code skip the token for a zero size buffer but it doesn't seem | 222 // We could add code skip the token for a zero size buffer but it doesn't seem |
223 // worth the complication. | 223 // worth the complication. |
224 buffer_ = transfer_buffer_->AllocUpTo(new_size, &size_); | 224 buffer_ = transfer_buffer_->AllocUpTo(new_size, &size_); |
225 } | 225 } |
226 | 226 |
227 } // namespace gpu | 227 } // namespace gpu |
OLD | NEW |