summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorreveman <reveman@chromium.org>2015-03-23 13:27:47 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-23 20:29:01 +0000
commit34b7a15218828edc105d4c408556b05c52994840 (patch)
tree9abba677c77d4591e04d2a57e445d9ec10de64c6 /ui
parent15accba3b4eceb8527867e87573eabe13cb13b1b (diff)
downloadchromium_src-34b7a15218828edc105d4c408556b05c52994840.zip
chromium_src-34b7a15218828edc105d4c408556b05c52994840.tar.gz
chromium_src-34b7a15218828edc105d4c408556b05c52994840.tar.bz2
cc: Move worker threads to RenderThreadImpl.
This allows us to Join the threads when RenderThreadImpl is shutdown. BUG=468785 TEST=cc_unittests Review URL: https://codereview.chromium.org/999173004 Cr-Commit-Position: refs/heads/master@{#321836}
Diffstat (limited to 'ui')
-rw-r--r--ui/compositor/compositor.cc7
-rw-r--r--ui/compositor/compositor.h4
-rw-r--r--ui/compositor/test/in_process_context_factory.cc4
-rw-r--r--ui/compositor/test/in_process_context_factory.h3
4 files changed, 16 insertions, 2 deletions
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index 6102013..a380c41 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -134,12 +134,15 @@ Compositor::Compositor(gfx::AcceleratedWidget widget,
settings.use_zero_copy = IsUIZeroCopyEnabled();
settings.use_one_copy = IsUIOneCopyEnabled();
settings.use_image_texture_target = context_factory_->GetImageTextureTarget();
+ // Note: gathering of pixel refs is only needed when using multiple
+ // raster threads.
+ settings.gather_pixel_refs = false;
base::TimeTicks before_create = base::TimeTicks::Now();
host_ = cc::LayerTreeHost::CreateSingleThreaded(
this, this, context_factory_->GetSharedBitmapManager(),
- context_factory_->GetGpuMemoryBufferManager(), settings, task_runner_,
- nullptr);
+ context_factory_->GetGpuMemoryBufferManager(),
+ context_factory_->GetTaskGraphRunner(), settings, task_runner_, nullptr);
UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor",
base::TimeTicks::Now() - before_create);
host_->SetRootLayer(root_web_layer_);
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index f46b496..5a6d932 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -40,6 +40,7 @@ class LayerTreeHost;
class RendererSettings;
class SharedBitmapManager;
class SurfaceIdAllocator;
+class TaskGraphRunner;
}
namespace gfx {
@@ -100,6 +101,9 @@ class COMPOSITOR_EXPORT ContextFactory {
// Gets the GPU memory buffer manager.
virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0;
+ // Gets the task graph runner.
+ virtual cc::TaskGraphRunner* GetTaskGraphRunner() = 0;
+
// Creates a Surface ID allocator with a new namespace.
virtual scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() = 0;
diff --git a/ui/compositor/test/in_process_context_factory.cc b/ui/compositor/test/in_process_context_factory.cc
index e9ba92e..145e25f 100644
--- a/ui/compositor/test/in_process_context_factory.cc
+++ b/ui/compositor/test/in_process_context_factory.cc
@@ -188,6 +188,10 @@ InProcessContextFactory::GetGpuMemoryBufferManager() {
return &gpu_memory_buffer_manager_;
}
+cc::TaskGraphRunner* InProcessContextFactory::GetTaskGraphRunner() {
+ return &task_graph_runner_;
+}
+
scoped_ptr<cc::SurfaceIdAllocator>
InProcessContextFactory::CreateSurfaceIdAllocator() {
return make_scoped_ptr(
diff --git a/ui/compositor/test/in_process_context_factory.h b/ui/compositor/test/in_process_context_factory.h
index 7be5078..fdfb5cd 100644
--- a/ui/compositor/test/in_process_context_factory.h
+++ b/ui/compositor/test/in_process_context_factory.h
@@ -7,6 +7,7 @@
#include "cc/test/test_gpu_memory_buffer_manager.h"
#include "cc/test/test_shared_bitmap_manager.h"
+#include "cc/test/test_task_graph_runner.h"
#include "ui/compositor/compositor.h"
namespace base {
@@ -47,6 +48,7 @@ class InProcessContextFactory : public ContextFactory {
uint32 GetImageTextureTarget() override;
cc::SharedBitmapManager* GetSharedBitmapManager() override;
gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
+ cc::TaskGraphRunner* GetTaskGraphRunner() override;
scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override;
void ResizeDisplay(ui::Compositor* compositor,
const gfx::Size& size) override;
@@ -55,6 +57,7 @@ class InProcessContextFactory : public ContextFactory {
scoped_refptr<cc::ContextProvider> shared_main_thread_contexts_;
cc::TestSharedBitmapManager shared_bitmap_manager_;
cc::TestGpuMemoryBufferManager gpu_memory_buffer_manager_;
+ cc::TestTaskGraphRunner task_graph_runner_;
uint32_t next_surface_id_namespace_;
bool use_test_surface_;
bool context_factory_for_test_;