Commit df621aff authored by jbauman@chromium.org's avatar jbauman@chromium.org

Only add rescheduled message when there are commands to reschedule.

Adding this message all the time prevents us from processing other command buffers when there really isn't anything left to do.

BUG=112349
TEST=


Review URL: http://codereview.chromium.org/9583021

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124759 0039d316-1c4b-4281-b951-d872f2087c98
parent 4473860d
...@@ -260,7 +260,7 @@ void GpuChannel::HandleMessage() { ...@@ -260,7 +260,7 @@ void GpuChannel::HandleMessage() {
// buffer that became unscheduled. // buffer that became unscheduled.
GpuCommandBufferStub* stub = stubs_.Lookup(message->routing_id()); GpuCommandBufferStub* stub = stubs_.Lookup(message->routing_id());
if (stub) { if (stub) {
if (!stub->IsScheduled() || stub->HasMoreWork()) { if (stub->HasUnprocessedCommands() || stub->HasMoreWork()) {
deferred_messages_.push_front(new GpuCommandBufferMsg_Rescheduled( deferred_messages_.push_front(new GpuCommandBufferMsg_Rescheduled(
stub->route_id())); stub->route_id()));
} }
......
...@@ -142,6 +142,14 @@ bool GpuCommandBufferStub::HasMoreWork() { ...@@ -142,6 +142,14 @@ bool GpuCommandBufferStub::HasMoreWork() {
return scheduler_.get() && scheduler_->HasMoreWork(); return scheduler_.get() && scheduler_->HasMoreWork();
} }
bool GpuCommandBufferStub::HasUnprocessedCommands() {
if (command_buffer_.get()) {
gpu::CommandBuffer::State state = command_buffer_->GetLastState();
return state.put_offset != state.get_offset;
}
return false;
}
void GpuCommandBufferStub::OnEcho(const IPC::Message& message) { void GpuCommandBufferStub::OnEcho(const IPC::Message& message) {
TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnEcho"); TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnEcho");
Send(new IPC::Message(message)); Send(new IPC::Message(message));
......
...@@ -129,6 +129,9 @@ class GpuCommandBufferStub ...@@ -129,6 +129,9 @@ class GpuCommandBufferStub
// Whether this command buffer needs to be polled again in the future. // Whether this command buffer needs to be polled again in the future.
bool HasMoreWork(); bool HasMoreWork();
// Whether there are commands in the buffer that haven't been processed.
bool HasUnprocessedCommands();
gpu::gles2::GLES2Decoder* decoder() const { return decoder_.get(); } gpu::gles2::GLES2Decoder* decoder() const { return decoder_.get(); }
gpu::GpuScheduler* scheduler() const { return scheduler_.get(); } gpu::GpuScheduler* scheduler() const { return scheduler_.get(); }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment