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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 return; | 153 return; |
154 } | 154 } |
155 } | 155 } |
156 if (scheduler_.get()) | 156 if (scheduler_.get()) |
157 scheduler_->PollUnscheduleFences(); | 157 scheduler_->PollUnscheduleFences(); |
158 } | 158 } |
159 | 159 |
160 bool GpuCommandBufferStub::HasUnprocessedCommands() { | 160 bool GpuCommandBufferStub::HasUnprocessedCommands() { |
161 if (command_buffer_.get()) { | 161 if (command_buffer_.get()) { |
162 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); | 162 gpu::CommandBuffer::State state = command_buffer_->GetLastState(); |
163 return state.put_offset != state.get_offset; | 163 return state.put_offset != state.get_offset && |
| 164 !gpu::error::IsError(state.error); |
164 } | 165 } |
165 return false; | 166 return false; |
166 } | 167 } |
167 | 168 |
168 void GpuCommandBufferStub::OnEcho(const IPC::Message& message) { | 169 void GpuCommandBufferStub::OnEcho(const IPC::Message& message) { |
169 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnEcho"); | 170 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnEcho"); |
170 Send(new IPC::Message(message)); | 171 Send(new IPC::Message(message)); |
171 } | 172 } |
172 | 173 |
173 void GpuCommandBufferStub::DelayEcho(IPC::Message* message) { | 174 void GpuCommandBufferStub::DelayEcho(IPC::Message* message) { |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_AND_BACK); | 631 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_AND_BACK); |
631 else if (allocation.suggest_have_frontbuffer) | 632 else if (allocation.suggest_have_frontbuffer) |
632 surface_->SetBufferAllocation( | 633 surface_->SetBufferAllocation( |
633 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_ONLY); | 634 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_ONLY); |
634 else | 635 else |
635 surface_->SetBufferAllocation( | 636 surface_->SetBufferAllocation( |
636 gfx::GLSurface::BUFFER_ALLOCATION_NONE); | 637 gfx::GLSurface::BUFFER_ALLOCATION_NONE); |
637 } | 638 } |
638 | 639 |
639 #endif // defined(ENABLE_GPU) | 640 #endif // defined(ENABLE_GPU) |
OLD | NEW |