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

Unified Diff: gpu/command_buffer/client/buffer_tracker.cc

Issue 116863003: gpu: Reuse transfer buffers more aggresively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Unset texture and texture_ref after deleting 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
« no previous file with comments | « gpu/command_buffer/client/buffer_tracker.h ('k') | gpu/command_buffer/client/buffer_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/buffer_tracker.cc
diff --git a/gpu/command_buffer/client/buffer_tracker.cc b/gpu/command_buffer/client/buffer_tracker.cc
index 18cedb975d059664d421d5e65f11a982a39a474b..5887e52a71c458acbf998521e2a13299b1e46ac5 100644
--- a/gpu/command_buffer/client/buffer_tracker.cc
+++ b/gpu/command_buffer/client/buffer_tracker.cc
@@ -60,8 +60,30 @@ void BufferTracker::FreePendingToken(Buffer* buffer, int32 token) {
buffer->shm_id_ = 0;
buffer->shm_offset_ = 0;
buffer->address_ = NULL;
+ buffer->last_usage_token_ = 0;
+ buffer->last_async_upload_token_ = 0;
}
+void BufferTracker::Unmanage(Buffer* buffer) {
+ buffer->size_ = 0;
+ buffer->shm_id_ = 0;
+ buffer->shm_offset_ = 0;
+ buffer->address_ = NULL;
+ buffer->last_usage_token_ = 0;
+ buffer->last_async_upload_token_ = 0;
+}
+
+void BufferTracker::Free(Buffer* buffer) {
+ if (buffer->address_)
+ mapped_memory_->Free(buffer->address_);
+
+ buffer->size_ = 0;
+ buffer->shm_id_ = 0;
+ buffer->shm_offset_ = 0;
+ buffer->address_ = NULL;
+ buffer->last_usage_token_ = 0;
+ buffer->last_async_upload_token_ = 0;
+}
} // namespace gles2
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/client/buffer_tracker.h ('k') | gpu/command_buffer/client/buffer_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698