diff options
author | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-02 01:48:51 +0000 |
---|---|---|
committer | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-02 01:48:51 +0000 |
commit | e01486f8efa9d4495b55cef19109443c670efbe8 (patch) | |
tree | 61d0d50f8ee46ae08edd01120313aa2b84802a1f | |
parent | fba298ade32d1716884423ebd10ad3f69cd23954 (diff) | |
download | chromium_src-e01486f8efa9d4495b55cef19109443c670efbe8.zip chromium_src-e01486f8efa9d4495b55cef19109443c670efbe8.tar.gz chromium_src-e01486f8efa9d4495b55cef19109443c670efbe8.tar.bz2 |
Revert 179911
> Merge 179080
> > 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
>
> TBR=backer@chromium.org
> Review URL: https://codereview.chromium.org/12114031
TBR=backer@chromium.org
Review URL: https://codereview.chromium.org/12179003
git-svn-id: svn://svn.chromium.org/chrome/branches/1364/src@180227 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | content/common/gpu/gpu_channel.cc | 5 | ||||
-rw-r--r-- | content/common/gpu/gpu_command_buffer_stub.h | 5 | ||||
-rw-r--r-- | gpu/command_buffer/service/gpu_scheduler.cc | 25 | ||||
-rw-r--r-- | gpu/command_buffer/service/gpu_scheduler.h | 2 |
4 files changed, 9 insertions, 28 deletions
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc index 687c90b..217d9ef 100644 --- a/content/common/gpu/gpu_channel.cc +++ b/content/common/gpu/gpu_channel.cc @@ -574,11 +574,6 @@ 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 886aca9..071b337 100644 --- a/content/common/gpu/gpu_command_buffer_stub.h +++ b/content/common/gpu/gpu_command_buffer_stub.h @@ -97,11 +97,6 @@ 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(); diff --git a/gpu/command_buffer/service/gpu_scheduler.cc b/gpu/command_buffer/service/gpu_scheduler.cc index dbfb7be..97d6e65 100644 --- a/gpu/command_buffer/service/gpu_scheduler.cc +++ b/gpu/command_buffer/service/gpu_scheduler.cc @@ -65,8 +65,16 @@ void GpuScheduler::PutChanged() { base::TimeTicks begin_time(base::TimeTicks::HighResNow()); error::Error error = error::kNoError; while (!parser_->IsEmpty()) { - if (IsPreempted()) + if (preemption_flag_.get() && + !was_preempted_ && + !preemption_flag_->IsSet()) { + TRACE_COUNTER_ID1("gpu", "GpuScheduler::Preempted", this, 1); + was_preempted_ = true; break; + } else if (was_preempted_) { + TRACE_COUNTER_ID1("gpu", "GpuScheduler::Preempted", this, 0); + was_preempted_ = false; + } DCHECK(IsScheduled()); DCHECK(unschedule_fences_.empty()); @@ -247,21 +255,6 @@ bool GpuScheduler::PollUnscheduleFences() { return true; } -bool GpuScheduler::IsPreempted() { - if (!preemption_flag_.get()) - return false; - - if (!was_preempted_ && !preemption_flag_->IsSet()) { - TRACE_COUNTER_ID1("gpu", "GpuScheduler::Preempted", this, 1); - was_preempted_ = true; - } else if (was_preempted_) { - TRACE_COUNTER_ID1("gpu", "GpuScheduler::Preempted", this, 0); - was_preempted_ = false; - } - - return !preemption_flag_->IsSet(); -} - void GpuScheduler::RescheduleTimeOut() { int new_count = unscheduled_count_ + rescheduled_count_; diff --git a/gpu/command_buffer/service/gpu_scheduler.h b/gpu/command_buffer/service/gpu_scheduler.h index 30aaf56..07b7b10 100644 --- a/gpu/command_buffer/service/gpu_scheduler.h +++ b/gpu/command_buffer/service/gpu_scheduler.h @@ -99,8 +99,6 @@ class GPU_EXPORT GpuScheduler return parser_.get(); } - bool IsPreempted(); - private: // Artificially reschedule if the scheduler is still unscheduled after a // timeout. |