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

Unified Diff: content/common/gpu/client/command_buffer_proxy_impl.cc

Issue 10898014: Delete shared state transfer buffer upon command-buffer deletion. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/client/command_buffer_proxy_impl.cc
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc
index d6387747ab17b175341db4dc2a7c6c0be91a19e4..987ba6fb08e934e3f38d90048fb6416a07b93d32 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.cc
+++ b/content/common/gpu/client/command_buffer_proxy_impl.cc
@@ -34,10 +34,13 @@ CommandBufferProxyImpl::CommandBufferProxyImpl(
route_id_(route_id),
flush_count_(0),
last_put_offset_(-1),
- next_signal_id_(0) {
+ next_signal_id_(0),
+ state_buffer_(-1) {
}
CommandBufferProxyImpl::~CommandBufferProxyImpl() {
+ if (state_buffer_ != -1)
+ DestroyTransferBuffer(state_buffer_);
// Delete all the locally cached shared memory objects, closing the handle
// in this process.
for (TransferBufferMap::iterator it = transfer_buffers_.begin();
@@ -148,14 +151,14 @@ bool CommandBufferProxyImpl::Initialize() {
return false;
}
- int32 state_buffer = CreateTransferBuffer(sizeof *shared_state_, -1);
+ state_buffer_ = CreateTransferBuffer(sizeof *shared_state_, -1);
- if (state_buffer == -1) {
+ if (state_buffer_ == -1) {
LOG(ERROR) << "Failed to create shared state transfer buffer.";
return false;
}
- gpu::Buffer buffer = GetTransferBuffer(state_buffer);
+ gpu::Buffer buffer = GetTransferBuffer(state_buffer_);
if (!buffer.ptr) {
LOG(ERROR) << "Failed to get shared state transfer buffer";
return false;
@@ -165,7 +168,7 @@ bool CommandBufferProxyImpl::Initialize() {
shared_state_->Initialize();
if (!Send(new GpuCommandBufferMsg_SetSharedStateBuffer(route_id_,
- state_buffer))) {
+ state_buffer_))) {
LOG(ERROR) << "Failed to initialize shared command buffer state.";
return false;
}
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698