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); | |
165 } | 164 } |
166 return false; | 165 return false; |
167 } | 166 } |
168 | 167 |
169 void GpuCommandBufferStub::OnEcho(const IPC::Message& message) { | 168 void GpuCommandBufferStub::OnEcho(const IPC::Message& message) { |
170 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnEcho"); | 169 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnEcho"); |
171 Send(new IPC::Message(message)); | 170 Send(new IPC::Message(message)); |
172 } | 171 } |
173 | 172 |
174 void GpuCommandBufferStub::DelayEcho(IPC::Message* message) { | 173 void GpuCommandBufferStub::DelayEcho(IPC::Message* message) { |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_AND_BACK); | 630 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_AND_BACK); |
632 else if (allocation.suggest_have_frontbuffer) | 631 else if (allocation.suggest_have_frontbuffer) |
633 surface_->SetBufferAllocation( | 632 surface_->SetBufferAllocation( |
634 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_ONLY); | 633 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_ONLY); |
635 else | 634 else |
636 surface_->SetBufferAllocation( | 635 surface_->SetBufferAllocation( |
637 gfx::GLSurface::BUFFER_ALLOCATION_NONE); | 636 gfx::GLSurface::BUFFER_ALLOCATION_NONE); |
638 } | 637 } |
639 | 638 |
640 #endif // defined(ENABLE_GPU) | 639 #endif // defined(ENABLE_GPU) |
OLD | NEW |