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( | 108 if (last_state_.error == gpu::error::kNoError) |
Ami GONE FROM CHROMIUM
2012/05/06 23:03:12
Multi-line if tests or bodies require braces aroun
| |
109 route_id_, !memory_allocation_changed_callback_.is_null())); | 109 Send(new GpuCommandBufferMsg_SetClientHasMemoryAllocationChangedCallback( |
110 route_id_, !memory_allocation_changed_callback_.is_null())); | |
110 } | 111 } |
111 | 112 |
112 void CommandBufferProxyImpl::OnSetMemoryAllocation( | 113 void CommandBufferProxyImpl::OnSetMemoryAllocation( |
113 const GpuMemoryAllocationForRenderer& allocation) { | 114 const GpuMemoryAllocationForRenderer& allocation) { |
114 if (!memory_allocation_changed_callback_.is_null()) | 115 if (!memory_allocation_changed_callback_.is_null()) |
115 memory_allocation_changed_callback_.Run(allocation); | 116 memory_allocation_changed_callback_.Run(allocation); |
116 } | 117 } |
117 | 118 |
118 void CommandBufferProxyImpl::SetChannelErrorCallback( | 119 void CommandBufferProxyImpl::SetChannelErrorCallback( |
119 const base::Closure& callback) { | 120 const base::Closure& callback) { |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
502 | 503 |
503 void CommandBufferProxyImpl::SetOnConsoleMessageCallback( | 504 void CommandBufferProxyImpl::SetOnConsoleMessageCallback( |
504 const GpuConsoleMessageCallback& callback) { | 505 const GpuConsoleMessageCallback& callback) { |
505 console_message_callback_ = callback; | 506 console_message_callback_ = callback; |
506 } | 507 } |
507 | 508 |
508 void CommandBufferProxyImpl::TryUpdateState() { | 509 void CommandBufferProxyImpl::TryUpdateState() { |
509 if (last_state_.error == gpu::error::kNoError) | 510 if (last_state_.error == gpu::error::kNoError) |
510 shared_state_->Read(&last_state_); | 511 shared_state_->Read(&last_state_); |
511 } | 512 } |
OLD | NEW |