Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 9583021: Only add rescheduled message when there are commands to reschedule. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 135 }
136 136
137 bool GpuCommandBufferStub::IsScheduled() { 137 bool GpuCommandBufferStub::IsScheduled() {
138 return !scheduler_.get() || scheduler_->IsScheduled(); 138 return !scheduler_.get() || scheduler_->IsScheduled();
139 } 139 }
140 140
141 bool GpuCommandBufferStub::HasMoreWork() { 141 bool GpuCommandBufferStub::HasMoreWork() {
142 return scheduler_.get() && scheduler_->HasMoreWork(); 142 return scheduler_.get() && scheduler_->HasMoreWork();
143 } 143 }
144 144
145 bool GpuCommandBufferStub::HasUnprocessedCommands() {
146 if (command_buffer_.get()) {
147 gpu::CommandBuffer::State state = command_buffer_->GetLastState();
148 return state.put_offset != state.get_offset;
149 }
150 return false;
151 }
152
145 void GpuCommandBufferStub::OnEcho(const IPC::Message& message) { 153 void GpuCommandBufferStub::OnEcho(const IPC::Message& message) {
146 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnEcho"); 154 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnEcho");
147 Send(new IPC::Message(message)); 155 Send(new IPC::Message(message));
148 } 156 }
149 157
150 void GpuCommandBufferStub::Destroy() { 158 void GpuCommandBufferStub::Destroy() {
151 // The scheduler has raw references to the decoder and the command buffer so 159 // The scheduler has raw references to the decoder and the command buffer so
152 // destroy it before those. 160 // destroy it before those.
153 scheduler_.reset(); 161 scheduler_.reset();
154 162
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 return; 591 return;
584 if (allocation.has_frontbuffer && allocation.has_backbuffer) 592 if (allocation.has_frontbuffer && allocation.has_backbuffer)
585 surface_->SetVisibility(gfx::GLSurface::VISIBILITY_STATE_FOREGROUND); 593 surface_->SetVisibility(gfx::GLSurface::VISIBILITY_STATE_FOREGROUND);
586 else if (allocation.has_frontbuffer) 594 else if (allocation.has_frontbuffer)
587 surface_->SetVisibility(gfx::GLSurface::VISIBILITY_STATE_BACKGROUND); 595 surface_->SetVisibility(gfx::GLSurface::VISIBILITY_STATE_BACKGROUND);
588 else 596 else
589 surface_->SetVisibility(gfx::GLSurface::VISIBILITY_STATE_HIBERNATED); 597 surface_->SetVisibility(gfx::GLSurface::VISIBILITY_STATE_HIBERNATED);
590 } 598 }
591 599
592 #endif // defined(ENABLE_GPU) 600 #endif // defined(ENABLE_GPU)
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698