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

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

Issue 895853003: Update from https://crrev.com/314320 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « gpu/command_buffer/client/share_group.cc ('k') | gpu/command_buffer/cmd_buffer_functions.txt » ('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 (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
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
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/share_group.cc ('k') | gpu/command_buffer/cmd_buffer_functions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698