OLD | NEW |
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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 } | 340 } |
341 | 341 |
342 void CommandBufferProxyImpl::DestroyGpuMemoryBuffer(int32 id) { | 342 void CommandBufferProxyImpl::DestroyGpuMemoryBuffer(int32 id) { |
343 if (last_state_.error != gpu::error::kNoError) | 343 if (last_state_.error != gpu::error::kNoError) |
344 return; | 344 return; |
345 | 345 |
346 Send(new GpuCommandBufferMsg_UnregisterGpuMemoryBuffer(route_id_, id)); | 346 Send(new GpuCommandBufferMsg_UnregisterGpuMemoryBuffer(route_id_, id)); |
347 | 347 |
348 // Remove the gpu memory buffer from the client side cache. | 348 // Remove the gpu memory buffer from the client side cache. |
349 DCHECK(gpu_memory_buffers_.find(id) != gpu_memory_buffers_.end()); | 349 DCHECK(gpu_memory_buffers_.find(id) != gpu_memory_buffers_.end()); |
350 channel_->factory()->DeleteGpuMemoryBuffer(gpu_memory_buffers_.take(id)); | 350 gpu_memory_buffers_.take(id); |
351 } | 351 } |
352 | 352 |
353 int CommandBufferProxyImpl::GetRouteID() const { | 353 int CommandBufferProxyImpl::GetRouteID() const { |
354 return route_id_; | 354 return route_id_; |
355 } | 355 } |
356 | 356 |
357 void CommandBufferProxyImpl::Echo(const base::Closure& callback) { | 357 void CommandBufferProxyImpl::Echo(const base::Closure& callback) { |
358 if (last_state_.error != gpu::error::kNoError) { | 358 if (last_state_.error != gpu::error::kNoError) { |
359 return; | 359 return; |
360 } | 360 } |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 if (last_state_.error == gpu::error::kNoError) | 519 if (last_state_.error == gpu::error::kNoError) |
520 shared_state()->Read(&last_state_); | 520 shared_state()->Read(&last_state_); |
521 } | 521 } |
522 | 522 |
523 gpu::CommandBufferSharedState* CommandBufferProxyImpl::shared_state() const { | 523 gpu::CommandBufferSharedState* CommandBufferProxyImpl::shared_state() const { |
524 return reinterpret_cast<gpu::CommandBufferSharedState*>( | 524 return reinterpret_cast<gpu::CommandBufferSharedState*>( |
525 shared_state_shm_->memory()); | 525 shared_state_shm_->memory()); |
526 } | 526 } |
527 | 527 |
528 } // namespace content | 528 } // namespace content |
OLD | NEW |