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

Unified Diff: trunk/src/gpu/command_buffer/client/fenced_allocator.cc

Issue 216673006: Revert 260177 "By keeping track of transfer buffer usage (both s..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: trunk/src/gpu/command_buffer/client/fenced_allocator.cc
===================================================================
--- trunk/src/gpu/command_buffer/client/fenced_allocator.cc (revision 260192)
+++ trunk/src/gpu/command_buffer/client/fenced_allocator.cc (working copy)
@@ -34,10 +34,8 @@
#endif
FencedAllocator::FencedAllocator(unsigned int size,
- CommandBufferHelper* helper,
- const base::Closure& poll_callback)
+ CommandBufferHelper *helper)
: helper_(helper),
- poll_callback_(poll_callback),
bytes_in_use_(0) {
Block block = { FREE, 0, RoundDown(size), kUnusedToken };
blocks_.push_back(block);
@@ -205,13 +203,10 @@
// Frees any blocks pending a token for which the token has been read.
void FencedAllocator::FreeUnused() {
- // Free any potential blocks that has its lifetime handled outside.
- poll_callback_.Run();
-
+ int32 last_token_read = helper_->last_token_read();
for (unsigned int i = 0; i < blocks_.size();) {
Block& block = blocks_[i];
- if (block.state == FREE_PENDING_TOKEN &&
- helper_->HasTokenPassed(block.token)) {
+ if (block.state == FREE_PENDING_TOKEN && block.token <= last_token_read) {
block.state = FREE;
i = CollapseFreeBlock(i);
} else {
« no previous file with comments | « trunk/src/gpu/command_buffer/client/fenced_allocator.h ('k') | trunk/src/gpu/command_buffer/client/fenced_allocator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698