summaryrefslogtreecommitdiffstats
path: root/content/common
diff options
context:
space:
mode:
authorbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-27 05:41:34 +0000
committerbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-27 05:41:34 +0000
commitf7d852f9dcf8d13ebd55c4e4dde63b21d43cb6c9 (patch)
tree079aa068cd904436196b0795ecca62d4f0a6d322 /content/common
parent4c9bb9593a27f25e1d14d477899a38d8b57ca887 (diff)
downloadchromium_src-f7d852f9dcf8d13ebd55c4e4dde63b21d43cb6c9.zip
chromium_src-f7d852f9dcf8d13ebd55c4e4dde63b21d43cb6c9.tar.gz
chromium_src-f7d852f9dcf8d13ebd55c4e4dde63b21d43cb6c9.tar.bz2
Aura: Less MakeCurrents on UI preemption.
If we're going to exit in the GpuScheduler anyway, just early out to prevent an unnecessary MakeCurrent. R=piman BUG=171135, chrome-os-partner:14133, 148382, chromium-os:37557 Review URL: https://chromiumcodereview.appspot.com/12051073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179080 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common')
-rw-r--r--content/common/gpu/gpu_channel.cc5
-rw-r--r--content/common/gpu/gpu_command_buffer_stub.h5
2 files changed, 10 insertions, 0 deletions
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index 68a97ca..0718cea 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -567,6 +567,11 @@ void GpuChannel::HandleMessage() {
return;
}
+ if (stub && stub->IsPreempted()) {
+ OnScheduled();
+ return;
+ }
+
scoped_ptr<IPC::Message> message(m);
deferred_messages_.pop_front();
bool message_processed = true;
diff --git a/content/common/gpu/gpu_command_buffer_stub.h b/content/common/gpu/gpu_command_buffer_stub.h
index 4276550..87526b4 100644
--- a/content/common/gpu/gpu_command_buffer_stub.h
+++ b/content/common/gpu/gpu_command_buffer_stub.h
@@ -97,6 +97,11 @@ class GpuCommandBufferStub
// Whether this command buffer can currently handle IPC messages.
bool IsScheduled();
+ // If the command buffer is pre-empted and cannot process commands.
+ bool IsPreempted() const {
+ return scheduler_.get() && scheduler_->IsPreempted();
+ }
+
// Whether there are commands in the buffer that haven't been processed.
bool HasUnprocessedCommands();