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 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 bool GpuCommandBufferStub::HasUnprocessedCommands() { | 174 bool GpuCommandBufferStub::HasUnprocessedCommands() { |
175 if (command_buffer_.get()) { | 175 if (command_buffer_.get()) { |
176 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); | 176 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); |
177 return state.put_offset != state.get_offset && | 177 return state.put_offset != state.get_offset && |
178 !gpu::error::IsError(state.error); | 178 !gpu::error::IsError(state.error); |
179 } | 179 } |
180 return false; | 180 return false; |
181 } | 181 } |
182 | 182 |
183 void GpuCommandBufferStub::OnEcho(const IPC::Message& message) { | 183 void GpuCommandBufferStub::OnEcho(const IPC::Message& message) { |
| 184 // For latency_tests.cc: |
| 185 UNSHIPPED_TRACE_EVENT_INSTANT0("test_gpu", "CompositorSwapBuffersComplete"); |
184 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnEcho"); | 186 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnEcho"); |
185 Send(new IPC::Message(message)); | 187 Send(new IPC::Message(message)); |
186 } | 188 } |
187 | 189 |
188 void GpuCommandBufferStub::DelayEcho(IPC::Message* message) { | 190 void GpuCommandBufferStub::DelayEcho(IPC::Message* message) { |
189 delayed_echos_.push_back(message); | 191 delayed_echos_.push_back(message); |
190 } | 192 } |
191 | 193 |
192 void GpuCommandBufferStub::OnReschedule() { | 194 void GpuCommandBufferStub::OnReschedule() { |
193 while (!delayed_echos_.empty()) { | 195 while (!delayed_echos_.empty()) { |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 } | 658 } |
657 | 659 |
658 void GpuCommandBufferStub::SetMemoryAllocation( | 660 void GpuCommandBufferStub::SetMemoryAllocation( |
659 const GpuMemoryAllocation& allocation) { | 661 const GpuMemoryAllocation& allocation) { |
660 allocation_ = allocation; | 662 allocation_ = allocation; |
661 | 663 |
662 SendMemoryAllocationToProxy(allocation); | 664 SendMemoryAllocationToProxy(allocation); |
663 } | 665 } |
664 | 666 |
665 #endif // defined(ENABLE_GPU) | 667 #endif // defined(ENABLE_GPU) |
OLD | NEW |