| 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/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 const GPUCommandBufferConsoleMessage& message) { | 98 const GPUCommandBufferConsoleMessage& message) { |
| 99 if (!console_message_callback_.is_null()) { | 99 if (!console_message_callback_.is_null()) { |
| 100 console_message_callback_.Run(message.message, message.id); | 100 console_message_callback_.Run(message.message, message.id); |
| 101 } | 101 } |
| 102 } | 102 } |
| 103 | 103 |
| 104 void CommandBufferProxyImpl::SetMemoryAllocationChangedCallback( | 104 void CommandBufferProxyImpl::SetMemoryAllocationChangedCallback( |
| 105 const base::Callback<void(const GpuMemoryAllocationForRenderer&)>& | 105 const base::Callback<void(const GpuMemoryAllocationForRenderer&)>& |
| 106 callback) { | 106 callback) { |
| 107 memory_allocation_changed_callback_ = callback; | 107 memory_allocation_changed_callback_ = callback; |
| 108 Send(new GpuCommandBufferMsg_SetClientHasMemoryAllocationChangedCallback( |
| 109 route_id_, !memory_allocation_changed_callback_.is_null())); |
| 108 } | 110 } |
| 109 | 111 |
| 110 void CommandBufferProxyImpl::OnSetMemoryAllocation( | 112 void CommandBufferProxyImpl::OnSetMemoryAllocation( |
| 111 const GpuMemoryAllocationForRenderer& allocation) { | 113 const GpuMemoryAllocationForRenderer& allocation) { |
| 112 if (!memory_allocation_changed_callback_.is_null()) | 114 if (!memory_allocation_changed_callback_.is_null()) |
| 113 memory_allocation_changed_callback_.Run(allocation); | 115 memory_allocation_changed_callback_.Run(allocation); |
| 114 } | 116 } |
| 115 | 117 |
| 116 void CommandBufferProxyImpl::SetChannelErrorCallback( | 118 void CommandBufferProxyImpl::SetChannelErrorCallback( |
| 117 const base::Closure& callback) { | 119 const base::Closure& callback) { |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 | 502 |
| 501 void CommandBufferProxyImpl::SetOnConsoleMessageCallback( | 503 void CommandBufferProxyImpl::SetOnConsoleMessageCallback( |
| 502 const GpuConsoleMessageCallback& callback) { | 504 const GpuConsoleMessageCallback& callback) { |
| 503 console_message_callback_ = callback; | 505 console_message_callback_ = callback; |
| 504 } | 506 } |
| 505 | 507 |
| 506 void CommandBufferProxyImpl::TryUpdateState() { | 508 void CommandBufferProxyImpl::TryUpdateState() { |
| 507 if (last_state_.error == gpu::error::kNoError) | 509 if (last_state_.error == gpu::error::kNoError) |
| 508 shared_state_->Read(&last_state_); | 510 shared_state_->Read(&last_state_); |
| 509 } | 511 } |
| OLD | NEW |