From 388d8d9404eacb90cb2971081eb8adeaaf48d27f Mon Sep 17 00:00:00 2001 From: sunnyps Date: Tue, 9 Jun 2015 12:26:22 -0700 Subject: [PATCH] Remove unnecessary task runner / PostTask in OutputSurfaceWithoutParent. Both OutputSurfaceWithoutParent and CompositorImpl live on the same thread. It's unlikely that this will change in the near future. In the meantime using a task runner to communicate between the output surface and the compositor is confusing. R=aelias@chromium.org,sievers@chromium.org Review URL: https://codereview.chromium.org/1171603002 Cr-Commit-Position: refs/heads/master@{#333549} --- content/browser/renderer_host/compositor_impl_android.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc index 4a120522049c..e29ce82e6ba1 100644 --- a/content/browser/renderer_host/compositor_impl_android.cc +++ b/content/browser/renderer_host/compositor_impl_android.cc @@ -82,7 +82,6 @@ class OutputSurfaceWithoutParent : public cc::OutputSurface { capabilities_.adjust_deadline_for_parent = false; capabilities_.max_frames_pending = 2; compositor_impl_ = compositor_impl; - main_thread_ = base::ThreadTaskRunnerHandle::Get(); } void SwapBuffers(cc::CompositorFrame* frame) override { @@ -100,11 +99,8 @@ class OutputSurfaceWithoutParent : public cc::OutputSurface { GetCommandBufferProxy()->SetSwapBuffersCompletionCallback( swap_buffers_completion_callback_.callback()); - main_thread_->PostTask( - FROM_HERE, - base::Bind(&CompositorImpl::PopulateGpuCapabilities, - compositor_impl_, - context_provider_->ContextCapabilities().gpu)); + compositor_impl_->PopulateGpuCapabilities( + context_provider_->ContextCapabilities().gpu); return true; } @@ -130,7 +126,6 @@ class OutputSurfaceWithoutParent : public cc::OutputSurface { gfx::SwapResult)> swap_buffers_completion_callback_; - scoped_refptr main_thread_; base::WeakPtr compositor_impl_; }; -- 2.11.4.GIT