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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 Send(new GpuCommandBufferMsg_AsyncFlush(route_id_, | 209 Send(new GpuCommandBufferMsg_AsyncFlush(route_id_, |
210 put_offset, | 210 put_offset, |
211 ++flush_count_)); | 211 ++flush_count_)); |
212 } | 212 } |
213 | 213 |
214 void CommandBufferProxyImpl::SetLatencyInfo( | 214 void CommandBufferProxyImpl::SetLatencyInfo( |
215 const std::vector<ui::LatencyInfo>& latency_info) { | 215 const std::vector<ui::LatencyInfo>& latency_info) { |
216 if (last_state_.error != gpu::error::kNoError) | 216 if (last_state_.error != gpu::error::kNoError) |
217 return; | 217 return; |
218 // TODO(miletus) : Pass the std::vector<ui::LatencyInfo> latency_info | 218 Send(new GpuCommandBufferMsg_SetLatencyInfo(route_id_, latency_info)); |
219 // directly without merging once GpuCommandBufferMsg_SetLatencyInfo | |
220 // is converted to contain std::vector<ui::LatencyInfo>. | |
221 ui::LatencyInfo merged_latency; | |
222 for (size_t i = 0; i < latency_info.size(); i++) | |
223 merged_latency.MergeWith(latency_info[i]); | |
224 Send(new GpuCommandBufferMsg_SetLatencyInfo(route_id_, merged_latency)); | |
225 } | 219 } |
226 | 220 |
227 gpu::CommandBuffer::State CommandBufferProxyImpl::FlushSync( | 221 gpu::CommandBuffer::State CommandBufferProxyImpl::FlushSync( |
228 int32 put_offset, | 222 int32 put_offset, |
229 int32 last_known_get) { | 223 int32 last_known_get) { |
230 TRACE_EVENT1("gpu", "CommandBufferProxyImpl::FlushSync", "put_offset", | 224 TRACE_EVENT1("gpu", "CommandBufferProxyImpl::FlushSync", "put_offset", |
231 put_offset); | 225 put_offset); |
232 Flush(put_offset); | 226 Flush(put_offset); |
233 TryUpdateState(); | 227 TryUpdateState(); |
234 if (last_known_get == last_state_.get_offset) { | 228 if (last_known_get == last_state_.get_offset) { |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 const GpuConsoleMessageCallback& callback) { | 589 const GpuConsoleMessageCallback& callback) { |
596 console_message_callback_ = callback; | 590 console_message_callback_ = callback; |
597 } | 591 } |
598 | 592 |
599 void CommandBufferProxyImpl::TryUpdateState() { | 593 void CommandBufferProxyImpl::TryUpdateState() { |
600 if (last_state_.error == gpu::error::kNoError) | 594 if (last_state_.error == gpu::error::kNoError) |
601 shared_state()->Read(&last_state_); | 595 shared_state()->Read(&last_state_); |
602 } | 596 } |
603 | 597 |
604 } // namespace content | 598 } // namespace content |
OLD | NEW |