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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 return; | 205 return; |
206 | 206 |
207 last_put_offset_ = put_offset; | 207 last_put_offset_ = put_offset; |
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 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 Send(new GpuCommandBufferMsg_SetLatencyInfo(route_id_, latency_info)); | 218 // TODO(miletus) : Pass the std::vector<ui::LatencyInfo> 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)); |
219 } | 225 } |
220 | 226 |
221 gpu::CommandBuffer::State CommandBufferProxyImpl::FlushSync( | 227 gpu::CommandBuffer::State CommandBufferProxyImpl::FlushSync( |
222 int32 put_offset, | 228 int32 put_offset, |
223 int32 last_known_get) { | 229 int32 last_known_get) { |
224 TRACE_EVENT1("gpu", "CommandBufferProxyImpl::FlushSync", "put_offset", | 230 TRACE_EVENT1("gpu", "CommandBufferProxyImpl::FlushSync", "put_offset", |
225 put_offset); | 231 put_offset); |
226 Flush(put_offset); | 232 Flush(put_offset); |
227 TryUpdateState(); | 233 TryUpdateState(); |
228 if (last_known_get == last_state_.get_offset) { | 234 if (last_known_get == last_state_.get_offset) { |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 const GpuConsoleMessageCallback& callback) { | 595 const GpuConsoleMessageCallback& callback) { |
590 console_message_callback_ = callback; | 596 console_message_callback_ = callback; |
591 } | 597 } |
592 | 598 |
593 void CommandBufferProxyImpl::TryUpdateState() { | 599 void CommandBufferProxyImpl::TryUpdateState() { |
594 if (last_state_.error == gpu::error::kNoError) | 600 if (last_state_.error == gpu::error::kNoError) |
595 shared_state()->Read(&last_state_); | 601 shared_state()->Read(&last_state_); |
596 } | 602 } |
597 | 603 |
598 } // namespace content | 604 } // namespace content |
OLD | NEW |