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

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: [WIP] Review comments follow-up Created 6 years, 11 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: 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..5b0f8bafa7e53b0a669cfabbe2b4e337950af978 100644
--- a/gpu/command_buffer/client/buffer_tracker.cc
+++ b/gpu/command_buffer/client/buffer_tracker.cc
@@ -60,8 +60,29 @@ void BufferTracker::FreePendingToken(Buffer* buffer, int32 token) {
buffer->shm_id_ = 0;
buffer->shm_offset_ = 0;
buffer->address_ = NULL;
+ buffer->last_usage_token_ = 0;
}
+void BufferTracker::FreePendingSerial(Buffer* buffer, uint32 serial) {
+ if (buffer->address_)
+ mapped_memory_->FreePendingSerial(buffer->address_, serial);
+ buffer->size_ = 0;
+ buffer->shm_id_ = 0;
+ buffer->shm_offset_ = 0;
+ buffer->address_ = NULL;
+ buffer->last_usage_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;
+}
} // namespace gles2
} // namespace gpu

Powered by Google App Engine
This is Rietveld 408576698