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

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

Issue 10876025: Free the command buffer on destruction. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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/cmd_buffer_helper.cc
diff --git a/gpu/command_buffer/client/cmd_buffer_helper.cc b/gpu/command_buffer/client/cmd_buffer_helper.cc
index aa85560dff38624a1ea0f7ed8d48863b24dbd776..3eba54fd60801900c7f7f1dcdf12bd0da4e9de93 100644
--- a/gpu/command_buffer/client/cmd_buffer_helper.cc
+++ b/gpu/command_buffer/client/cmd_buffer_helper.cc
@@ -69,20 +69,25 @@ bool CommandBufferHelper::AllocateRingBuffer() {
return true;
}
-void CommandBufferHelper::FreeRingBuffer() {
- GPU_CHECK_EQ(put_, get_offset());
+void CommandBufferHelper::FreeResources() {
if (HaveRingBuffer()) {
command_buffer_->DestroyTransferBuffer(ring_buffer_id_);
ring_buffer_id_ = -1;
}
}
+void CommandBufferHelper::FreeRingBuffer() {
+ GPU_CHECK_EQ(put_, get_offset());
+ FreeResources();
+}
+
bool CommandBufferHelper::Initialize(int32 ring_buffer_size) {
ring_buffer_size_ = ring_buffer_size;
return AllocateRingBuffer();
}
CommandBufferHelper::~CommandBufferHelper() {
+ FreeResources();
}
bool CommandBufferHelper::FlushSync() {
« no previous file with comments | « gpu/command_buffer/client/cmd_buffer_helper.h ('k') | gpu/command_buffer/client/gles2_implementation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698