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

Side by Side Diff: content/common/gpu/client/command_buffer_proxy_impl.cc

Issue 409723003: content: Add DeletedGpuMemoryBuffer IPC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unused code Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/child_process_messages.h ('k') | content/common/gpu/client/gpu_channel_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/gpu/client/command_buffer_proxy_impl.h" 5 #include "content/common/gpu/client/command_buffer_proxy_impl.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 335
336 *id = new_id; 336 *id = new_id;
337 DCHECK(gpu_memory_buffers_.find(new_id) == gpu_memory_buffers_.end()); 337 DCHECK(gpu_memory_buffers_.find(new_id) == gpu_memory_buffers_.end());
338 return gpu_memory_buffers_.add(new_id, buffer.Pass()).first->second; 338 return gpu_memory_buffers_.add(new_id, buffer.Pass()).first->second;
339 } 339 }
340 340
341 void CommandBufferProxyImpl::DestroyGpuMemoryBuffer(int32 id) { 341 void CommandBufferProxyImpl::DestroyGpuMemoryBuffer(int32 id) {
342 if (last_state_.error != gpu::error::kNoError) 342 if (last_state_.error != gpu::error::kNoError)
343 return; 343 return;
344 344
345 Send(new GpuCommandBufferMsg_DestroyGpuMemoryBuffer(route_id_, id)); 345 Send(new GpuCommandBufferMsg_UnregisterGpuMemoryBuffer(route_id_, id));
346 346
347 // Remove the gpu memory buffer from the client side cache. 347 // Remove the gpu memory buffer from the client side cache.
348 gpu_memory_buffers_.erase(id); 348 DCHECK(gpu_memory_buffers_.find(id) != gpu_memory_buffers_.end());
349 channel_->factory()->DeleteGpuMemoryBuffer(gpu_memory_buffers_.take(id));
349 } 350 }
350 351
351 int CommandBufferProxyImpl::GetRouteID() const { 352 int CommandBufferProxyImpl::GetRouteID() const {
352 return route_id_; 353 return route_id_;
353 } 354 }
354 355
355 void CommandBufferProxyImpl::Echo(const base::Closure& callback) { 356 void CommandBufferProxyImpl::Echo(const base::Closure& callback) {
356 if (last_state_.error != gpu::error::kNoError) { 357 if (last_state_.error != gpu::error::kNoError) {
357 return; 358 return;
358 } 359 }
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 if (last_state_.error == gpu::error::kNoError) 518 if (last_state_.error == gpu::error::kNoError)
518 shared_state()->Read(&last_state_); 519 shared_state()->Read(&last_state_);
519 } 520 }
520 521
521 gpu::CommandBufferSharedState* CommandBufferProxyImpl::shared_state() const { 522 gpu::CommandBufferSharedState* CommandBufferProxyImpl::shared_state() const {
522 return reinterpret_cast<gpu::CommandBufferSharedState*>( 523 return reinterpret_cast<gpu::CommandBufferSharedState*>(
523 shared_state_shm_->memory()); 524 shared_state_shm_->memory());
524 } 525 }
525 526
526 } // namespace content 527 } // namespace content
OLDNEW
« no previous file with comments | « content/common/child_process_messages.h ('k') | content/common/gpu/client/gpu_channel_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698