Index: content/browser/renderer_host/compositor_impl_android.cc |
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc |
index 010f8e2484e4810516adbf94a21dc1fcd34c3051..33e5b5ce68eeeb8a3332bdad4bb72b3064a3105d 100644 |
--- a/content/browser/renderer_host/compositor_impl_android.cc |
+++ b/content/browser/renderer_host/compositor_impl_android.cc |
@@ -18,6 +18,7 @@ |
#include "base/memory/weak_ptr.h" |
#include "base/single_thread_task_runner.h" |
#include "base/synchronization/lock.h" |
+#include "base/threading/simple_thread.h" |
#include "base/threading/thread.h" |
#include "base/threading/thread_checker.h" |
#include "cc/base/switches.h" |
@@ -27,6 +28,7 @@ |
#include "cc/output/context_provider.h" |
#include "cc/output/output_surface.h" |
#include "cc/output/output_surface_client.h" |
+#include "cc/resources/task_graph_runner.h" |
#include "cc/scheduler/begin_frame_source.h" |
#include "cc/surfaces/onscreen_display_client.h" |
#include "cc/surfaces/surface_display_output_surface.h" |
@@ -137,6 +139,29 @@ base::LazyInstance<cc::SurfaceManager> g_surface_manager = |
int g_surface_id_namespace = 0; |
+class SingleThreadTaskGraphRunner |
+ : public cc::TaskGraphRunner, |
+ public base::DelegateSimpleThread::Delegate { |
+ public: |
+ SingleThreadTaskGraphRunner() : worker_thread_(this, "CompositorWorker") { |
+ worker_thread_.Start(); |
+ } |
+ |
+ ~SingleThreadTaskGraphRunner() override { |
+ Shutdown(); |
+ worker_thread_.Join(); |
+ } |
+ |
+ private: |
+ // Overridden from base::DelegateSimpleThread::Delegate: |
+ void Run() override { cc::TaskGraphRunner::Run(); } |
+ |
+ base::DelegateSimpleThread worker_thread_; |
+}; |
+ |
+base::LazyInstance<SingleThreadTaskGraphRunner> g_task_graph_runner = |
+ LAZY_INSTANCE_INITIALIZER; |
+ |
} // anonymous namespace |
// static |
@@ -395,13 +420,9 @@ void CompositorImpl::CreateLayerTreeHost() { |
settings.single_thread_proxy_scheduler = false; |
host_ = cc::LayerTreeHost::CreateSingleThreaded( |
- this, |
- this, |
- HostSharedBitmapManager::current(), |
- BrowserGpuMemoryBufferManager::current(), |
- settings, |
- base::MessageLoopProxy::current(), |
- nullptr); |
+ this, this, HostSharedBitmapManager::current(), |
+ BrowserGpuMemoryBufferManager::current(), g_task_graph_runner.Pointer(), |
+ settings, base::MessageLoopProxy::current(), nullptr); |
host_->SetRootLayer(root_layer_); |
host_->SetVisible(true); |