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 "gpu/command_buffer/client/transfer_buffer.h" | 7 #include "gpu/command_buffer/client/transfer_buffer.h" |
8 | 8 |
9 #include "base/bits.h" | 9 #include "base/bits.h" |
10 #include "base/debug/trace_event.h" | |
11 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/trace_event/trace_event.h" |
12 #include "gpu/command_buffer/client/cmd_buffer_helper.h" | 12 #include "gpu/command_buffer/client/cmd_buffer_helper.h" |
13 | 13 |
14 namespace gpu { | 14 namespace gpu { |
15 | 15 |
16 TransferBuffer::TransferBuffer( | 16 TransferBuffer::TransferBuffer( |
17 CommandBufferHelper* helper) | 17 CommandBufferHelper* helper) |
18 : helper_(helper), | 18 : helper_(helper), |
19 result_size_(0), | 19 result_size_(0), |
20 default_buffer_size_(0), | 20 default_buffer_size_(0), |
21 min_buffer_size_(0), | 21 min_buffer_size_(0), |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 Release(); | 192 Release(); |
193 // NOTE: we allocate buffers of size 0 so that HaveBuffer will be true, so | 193 // NOTE: we allocate buffers of size 0 so that HaveBuffer will be true, so |
194 // that address will return a pointer just like malloc, and so that GetShmId | 194 // that address will return a pointer just like malloc, and so that GetShmId |
195 // will be valid. That has the side effect that we'll insert a token on free. | 195 // will be valid. That has the side effect that we'll insert a token on free. |
196 // We could add code skip the token for a zero size buffer but it doesn't seem | 196 // We could add code skip the token for a zero size buffer but it doesn't seem |
197 // worth the complication. | 197 // worth the complication. |
198 buffer_ = transfer_buffer_->AllocUpTo(new_size, &size_); | 198 buffer_ = transfer_buffer_->AllocUpTo(new_size, &size_); |
199 } | 199 } |
200 | 200 |
201 } // namespace gpu | 201 } // namespace gpu |
OLD | NEW |