summaryrefslogtreecommitdiffstats
path: root/cc/trees
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 /cc/trees
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 'cc/trees')
-rw-r--r--cc/trees/damage_tracker_unittest.cc5
-rw-r--r--cc/trees/layer_tree_host.cc23
-rw-r--r--cc/trees/layer_tree_host.h5
-rw-r--r--cc/trees/layer_tree_host_common_unittest.cc36
-rw-r--r--cc/trees/layer_tree_host_impl.cc27
-rw-r--r--cc/trees/layer_tree_host_impl.h3
-rw-r--r--cc/trees/layer_tree_host_impl_unittest.cc47
-rw-r--r--cc/trees/layer_tree_host_unittest.cc46
-rw-r--r--cc/trees/layer_tree_host_unittest_no_message_loop.cc2
-rw-r--r--cc/trees/layer_tree_host_unittest_scroll.cc12
-rw-r--r--cc/trees/layer_tree_impl_unittest.cc6
-rw-r--r--cc/trees/layer_tree_settings.cc3
-rw-r--r--cc/trees/layer_tree_settings.h1
-rw-r--r--cc/trees/occlusion_tracker_perftest.cc10
-rw-r--r--cc/trees/tree_synchronizer_unittest.cc27
15 files changed, 110 insertions, 143 deletions
diff --git a/cc/trees/damage_tracker_unittest.cc b/cc/trees/damage_tracker_unittest.cc
index 95609d3..2df71dd 100644
--- a/cc/trees/damage_tracker_unittest.cc
+++ b/cc/trees/damage_tracker_unittest.cc
@@ -12,6 +12,7 @@
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/geometry_test_utils.h"
#include "cc/test/test_shared_bitmap_manager.h"
+#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/layer_tree_host_common.h"
#include "cc/trees/single_thread_proxy.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -74,7 +75,8 @@ void EmulateDrawingOneFrame(LayerImpl* root) {
class DamageTrackerTest : public testing::Test {
public:
- DamageTrackerTest() : host_impl_(&proxy_, &shared_bitmap_manager_) {}
+ DamageTrackerTest()
+ : host_impl_(&proxy_, &shared_bitmap_manager_, &task_graph_runner_) {}
scoped_ptr<LayerImpl> CreateTestTreeWithOneSurface() {
scoped_ptr<LayerImpl> root =
@@ -176,6 +178,7 @@ class DamageTrackerTest : public testing::Test {
protected:
FakeImplProxy proxy_;
TestSharedBitmapManager shared_bitmap_manager_;
+ TestTaskGraphRunner task_graph_runner_;
FakeLayerTreeHostImpl host_impl_;
};
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 7814dac..9d2be10 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -56,6 +56,7 @@ scoped_ptr<LayerTreeHost> LayerTreeHost::CreateThreaded(
LayerTreeHostClient* client,
SharedBitmapManager* shared_bitmap_manager,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
+ TaskGraphRunner* task_graph_runner,
const LayerTreeSettings& settings,
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner,
@@ -63,7 +64,8 @@ scoped_ptr<LayerTreeHost> LayerTreeHost::CreateThreaded(
DCHECK(main_task_runner.get());
DCHECK(impl_task_runner.get());
scoped_ptr<LayerTreeHost> layer_tree_host(new LayerTreeHost(
- client, shared_bitmap_manager, gpu_memory_buffer_manager, settings));
+ client, shared_bitmap_manager, gpu_memory_buffer_manager,
+ task_graph_runner, settings));
layer_tree_host->InitializeThreaded(main_task_runner,
impl_task_runner,
external_begin_frame_source.Pass());
@@ -75,11 +77,13 @@ scoped_ptr<LayerTreeHost> LayerTreeHost::CreateSingleThreaded(
LayerTreeHostSingleThreadClient* single_thread_client,
SharedBitmapManager* shared_bitmap_manager,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
+ TaskGraphRunner* task_graph_runner,
const LayerTreeSettings& settings,
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_ptr<BeginFrameSource> external_begin_frame_source) {
scoped_ptr<LayerTreeHost> layer_tree_host(new LayerTreeHost(
- client, shared_bitmap_manager, gpu_memory_buffer_manager, settings));
+ client, shared_bitmap_manager, gpu_memory_buffer_manager,
+ task_graph_runner, settings));
layer_tree_host->InitializeSingleThreaded(single_thread_client,
main_task_runner,
external_begin_frame_source.Pass());
@@ -90,6 +94,7 @@ LayerTreeHost::LayerTreeHost(
LayerTreeHostClient* client,
SharedBitmapManager* shared_bitmap_manager,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
+ TaskGraphRunner* task_graph_runner,
const LayerTreeSettings& settings)
: micro_benchmark_controller_(this),
next_ui_resource_id_(1),
@@ -121,6 +126,7 @@ LayerTreeHost::LayerTreeHost(
next_commit_forces_redraw_(false),
shared_bitmap_manager_(shared_bitmap_manager),
gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
+ task_graph_runner_(task_graph_runner),
surface_id_namespace_(0u),
next_surface_sequence_(1u) {
if (settings_.accelerated_animation_enabled)
@@ -430,17 +436,14 @@ void LayerTreeHost::DidFailToInitializeOutputSurface() {
scoped_ptr<LayerTreeHostImpl> LayerTreeHost::CreateLayerTreeHostImpl(
LayerTreeHostImplClient* client) {
DCHECK(proxy_->IsImplThread());
- scoped_ptr<LayerTreeHostImpl> host_impl =
- LayerTreeHostImpl::Create(settings_,
- client,
- proxy_.get(),
- rendering_stats_instrumentation_.get(),
- shared_bitmap_manager_,
- gpu_memory_buffer_manager_,
- id_);
+ scoped_ptr<LayerTreeHostImpl> host_impl = LayerTreeHostImpl::Create(
+ settings_, client, proxy_.get(), rendering_stats_instrumentation_.get(),
+ shared_bitmap_manager_, gpu_memory_buffer_manager_, task_graph_runner_,
+ id_);
host_impl->SetUseGpuRasterization(UseGpuRasterization());
shared_bitmap_manager_ = NULL;
gpu_memory_buffer_manager_ = NULL;
+ task_graph_runner_ = NULL;
top_controls_manager_weak_ptr_ =
host_impl->top_controls_manager()->AsWeakPtr();
input_handler_weak_ptr_ = host_impl->AsWeakPtr();
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h
index 1379d08..e1bcad5 100644
--- a/cc/trees/layer_tree_host.h
+++ b/cc/trees/layer_tree_host.h
@@ -61,6 +61,7 @@ class RenderingStatsInstrumentation;
class ResourceProvider;
class ResourceUpdateQueue;
class SharedBitmapManager;
+class TaskGraphRunner;
class TopControlsManager;
class UIResourceRequest;
struct PendingPageScaleAnimation;
@@ -75,6 +76,7 @@ class CC_EXPORT LayerTreeHost {
LayerTreeHostClient* client,
SharedBitmapManager* shared_bitmap_manager,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
+ TaskGraphRunner* task_graph_runner,
const LayerTreeSettings& settings,
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner,
@@ -85,6 +87,7 @@ class CC_EXPORT LayerTreeHost {
LayerTreeHostSingleThreadClient* single_thread_client,
SharedBitmapManager* shared_bitmap_manager,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
+ TaskGraphRunner* task_graph_runner,
const LayerTreeSettings& settings,
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_ptr<BeginFrameSource> external_begin_frame_source);
@@ -307,6 +310,7 @@ class CC_EXPORT LayerTreeHost {
LayerTreeHost(LayerTreeHostClient* client,
SharedBitmapManager* shared_bitmap_manager,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
+ TaskGraphRunner* task_graph_runner,
const LayerTreeSettings& settings);
void InitializeThreaded(
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
@@ -440,6 +444,7 @@ class CC_EXPORT LayerTreeHost {
SharedBitmapManager* shared_bitmap_manager_;
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_;
+ TaskGraphRunner* task_graph_runner_;
ScopedPtrVector<SwapPromise> swap_promise_list_;
std::set<SwapPromiseMonitor*> swap_promise_monitor_;
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index d18c1c8..082d14f 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -28,6 +28,7 @@
#include "cc/test/fake_picture_layer_impl.h"
#include "cc/test/geometry_test_utils.h"
#include "cc/test/layer_tree_host_common_test.h"
+#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/proxy.h"
#include "cc/trees/single_thread_proxy.h"
@@ -315,7 +316,7 @@ TEST_F(LayerTreeHostCommonTest, TransformsAboutScrollOffset) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
gfx::Transform identity_matrix;
scoped_ptr<LayerImpl> sublayer_scoped_ptr(
@@ -5721,7 +5722,7 @@ TEST_F(LayerTreeHostCommonTest, TransparentChildRenderSurfaceCreation) {
TEST_F(LayerTreeHostCommonTest, OpacityAnimatingOnPendingTree) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
host_impl.CreatePendingTree();
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.pending_tree(), 1);
@@ -5763,7 +5764,7 @@ class LCDTextTest
public testing::TestWithParam<LCDTextTestParam> {
public:
LCDTextTest()
- : host_impl_(&proxy_, &shared_bitmap_manager_),
+ : host_impl_(&proxy_, &shared_bitmap_manager_, &task_graph_runner_),
root_(nullptr),
child_(nullptr),
grand_child_(nullptr) {}
@@ -5810,6 +5811,7 @@ class LCDTextTest
FakeImplProxy proxy_;
TestSharedBitmapManager shared_bitmap_manager_;
+ TestTaskGraphRunner task_graph_runner_;
FakeLayerTreeHostImpl host_impl_;
LayerImpl* root_;
@@ -5947,7 +5949,7 @@ INSTANTIATE_TEST_CASE_P(LayerTreeHostCommonTest,
TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayer) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
host_impl.CreatePendingTree();
const gfx::Transform identity_matrix;
@@ -6005,7 +6007,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayer) {
TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayerImpl) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
host_impl.CreatePendingTree();
const gfx::Transform identity_matrix;
@@ -6050,7 +6052,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayerImpl) {
TEST_F(LayerTreeHostCommonTest, SubtreeHidden_TwoLayers) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
host_impl.CreatePendingTree();
const gfx::Transform identity_matrix;
@@ -6107,7 +6109,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_TwoLayers) {
TEST_F(LayerTreeHostCommonTest, SubtreeHidden_TwoLayersImpl) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
host_impl.CreatePendingTree();
const gfx::Transform identity_matrix;
@@ -6152,7 +6154,7 @@ void EmptyCopyOutputCallback(scoped_ptr<CopyOutputResult> result) {}
TEST_F(LayerTreeHostCommonTest, SubtreeHiddenWithCopyRequest) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
host_impl.CreatePendingTree();
const gfx::Transform identity_matrix;
@@ -6299,7 +6301,7 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHiddenWithCopyRequest) {
TEST_F(LayerTreeHostCommonTest, ClippedOutCopyRequest) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
host_impl.CreatePendingTree();
const gfx::Transform identity_matrix;
@@ -6374,7 +6376,7 @@ TEST_F(LayerTreeHostCommonTest, ClippedOutCopyRequest) {
TEST_F(LayerTreeHostCommonTest, VisibleContentRectInsideSurface) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
host_impl.CreatePendingTree();
const gfx::Transform identity_matrix;
@@ -6985,7 +6987,7 @@ TEST_F(LayerTreeHostCommonTest,
TEST_F(LayerTreeHostCommonTest, CanRenderToSeparateSurface) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
scoped_ptr<LayerImpl> root =
LayerImpl::Create(host_impl.active_tree(), 12345);
scoped_ptr<LayerImpl> child1 =
@@ -7706,7 +7708,7 @@ TEST_F(LayerTreeHostCommonTest, ScrollCompensationWithRounding) {
//
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
host_impl.CreatePendingTree();
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1);
scoped_ptr<LayerImpl> container =
@@ -7850,7 +7852,7 @@ TEST_F(LayerTreeHostCommonTest,
//
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
host_impl.CreatePendingTree();
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1);
scoped_ptr<LayerImpl> container =
@@ -7944,7 +7946,7 @@ class AnimationScaleFactorTrackingLayerImpl : public LayerImpl {
TEST_F(LayerTreeHostCommonTest, MaximumAnimationScaleFactor) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
gfx::Transform identity_matrix;
scoped_ptr<AnimationScaleFactorTrackingLayerImpl> grand_parent =
AnimationScaleFactorTrackingLayerImpl::Create(host_impl.active_tree(), 1);
@@ -8161,7 +8163,7 @@ static void GatherDrawnLayers(LayerImplList* rsll,
TEST_F(LayerTreeHostCommonTest, RenderSurfaceLayerListMembership) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
gfx::Transform identity_matrix;
scoped_ptr<LayerImpl> grand_parent =
@@ -8404,7 +8406,7 @@ TEST_F(LayerTreeHostCommonTest, RenderSurfaceLayerListMembership) {
TEST_F(LayerTreeHostCommonTest, DrawPropertyScales) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1);
LayerImpl* root_layer = root.get();
@@ -8684,7 +8686,7 @@ TEST_F(LayerTreeHostCommonTest, VisibleContentRectInChildRenderSurface) {
TEST_F(LayerTreeHostCommonTest, BoundsDeltaAffectVisibleContentRect) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
// Set two layers: the root layer clips it's child,
// the child draws its content.
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 9965d7a..2c13fcb 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -170,14 +170,11 @@ scoped_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create(
RenderingStatsInstrumentation* rendering_stats_instrumentation,
SharedBitmapManager* shared_bitmap_manager,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
+ TaskGraphRunner* task_graph_runner,
int id) {
- return make_scoped_ptr(new LayerTreeHostImpl(settings,
- client,
- proxy,
- rendering_stats_instrumentation,
- shared_bitmap_manager,
- gpu_memory_buffer_manager,
- id));
+ return make_scoped_ptr(new LayerTreeHostImpl(
+ settings, client, proxy, rendering_stats_instrumentation,
+ shared_bitmap_manager, gpu_memory_buffer_manager, task_graph_runner, id));
}
LayerTreeHostImpl::LayerTreeHostImpl(
@@ -187,6 +184,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(
RenderingStatsInstrumentation* rendering_stats_instrumentation,
SharedBitmapManager* shared_bitmap_manager,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
+ TaskGraphRunner* task_graph_runner,
int id)
: client_(client),
proxy_(proxy),
@@ -225,6 +223,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(
micro_benchmark_controller_(this),
shared_bitmap_manager_(shared_bitmap_manager),
gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
+ task_graph_runner_(task_graph_runner),
id_(id),
requires_high_res_to_draw_(false),
is_likely_to_require_a_draw_(false),
@@ -2032,8 +2031,7 @@ void LayerTreeHostImpl::CreateResourceAndTileTaskWorkerPool(
ResourcePool::Create(resource_provider_.get(), GL_TEXTURE_2D);
*tile_task_worker_pool = BitmapTileTaskWorkerPool::Create(
- task_runner, TileTaskWorkerPool::GetTaskGraphRunner(),
- resource_provider_.get());
+ task_runner, task_graph_runner_, resource_provider_.get());
return;
}
@@ -2042,7 +2040,7 @@ void LayerTreeHostImpl::CreateResourceAndTileTaskWorkerPool(
ResourcePool::Create(resource_provider_.get(), GL_TEXTURE_2D);
*tile_task_worker_pool = GpuTileTaskWorkerPool::Create(
- task_runner, TileTaskWorkerPool::GetTaskGraphRunner(),
+ task_runner, task_graph_runner_,
static_cast<GpuRasterizer*>(rasterizer_.get()));
return;
}
@@ -2066,7 +2064,7 @@ void LayerTreeHostImpl::CreateResourceAndTileTaskWorkerPool(
single_thread_synchronous_task_graph_runner_.reset(new TaskGraphRunner);
task_graph_runner = single_thread_synchronous_task_graph_runner_.get();
} else {
- task_graph_runner = TileTaskWorkerPool::GetTaskGraphRunner();
+ task_graph_runner = task_graph_runner_;
}
*tile_task_worker_pool = ZeroCopyTileTaskWorkerPool::Create(
@@ -2082,9 +2080,8 @@ void LayerTreeHostImpl::CreateResourceAndTileTaskWorkerPool(
ResourcePool::Create(resource_provider_.get(), GL_TEXTURE_2D);
*tile_task_worker_pool = OneCopyTileTaskWorkerPool::Create(
- task_runner, TileTaskWorkerPool::GetTaskGraphRunner(),
- context_provider, resource_provider_.get(),
- staging_resource_pool_.get());
+ task_runner, task_graph_runner_, context_provider,
+ resource_provider_.get(), staging_resource_pool_.get());
return;
}
}
@@ -2098,7 +2095,7 @@ void LayerTreeHostImpl::CreateResourceAndTileTaskWorkerPool(
resource_provider_.get(), GL_TEXTURE_2D);
*tile_task_worker_pool = PixelBufferTileTaskWorkerPool::Create(
- task_runner, TileTaskWorkerPool::GetTaskGraphRunner(), context_provider,
+ task_runner, task_graph_runner_, context_provider,
resource_provider_.get(),
GetMaxTransferBufferUsageBytes(context_provider->ContextCapabilities(),
settings_.renderer_settings.refresh_rate));
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h
index b6e5903..2efe2da 100644
--- a/cc/trees/layer_tree_host_impl.h
+++ b/cc/trees/layer_tree_host_impl.h
@@ -142,6 +142,7 @@ class CC_EXPORT LayerTreeHostImpl
RenderingStatsInstrumentation* rendering_stats_instrumentation,
SharedBitmapManager* shared_bitmap_manager,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
+ TaskGraphRunner* task_graph_runner,
int id);
~LayerTreeHostImpl() override;
@@ -531,6 +532,7 @@ class CC_EXPORT LayerTreeHostImpl
RenderingStatsInstrumentation* rendering_stats_instrumentation,
SharedBitmapManager* shared_bitmap_manager,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
+ TaskGraphRunner* task_graph_runner,
int id);
// Virtual for testing.
@@ -734,6 +736,7 @@ class CC_EXPORT LayerTreeHostImpl
SharedBitmapManager* shared_bitmap_manager_;
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_;
+ TaskGraphRunner* task_graph_runner_;
int id_;
std::set<SwapPromiseMonitor*> swap_promise_monitor_;
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 1526f93..49628d1 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -54,6 +54,7 @@
#include "cc/test/render_pass_test_common.h"
#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 "cc/test/test_web_graphics_context_3d.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/single_thread_proxy.h"
@@ -86,6 +87,7 @@ class LayerTreeHostImplTest : public testing::Test,
always_main_thread_blocked_(&proxy_),
shared_bitmap_manager_(new TestSharedBitmapManager),
gpu_memory_buffer_manager_(new TestGpuMemoryBufferManager),
+ task_graph_runner_(new TestTaskGraphRunner),
on_can_draw_state_changed_called_(false),
did_notify_ready_to_activate_(false),
did_request_commit_(false),
@@ -167,13 +169,10 @@ class LayerTreeHostImplTest : public testing::Test,
virtual bool CreateHostImpl(const LayerTreeSettings& settings,
scoped_ptr<OutputSurface> output_surface) {
- host_impl_ = LayerTreeHostImpl::Create(settings,
- this,
- &proxy_,
- &stats_instrumentation_,
- shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(),
- 0);
+ host_impl_ = LayerTreeHostImpl::Create(
+ settings, this, &proxy_, &stats_instrumentation_,
+ shared_bitmap_manager_.get(), gpu_memory_buffer_manager_.get(),
+ task_graph_runner_.get(), 0);
bool init = host_impl_->InitializeRenderer(output_surface.Pass());
host_impl_->SetViewportSize(gfx::Size(10, 10));
return init;
@@ -395,6 +394,7 @@ class LayerTreeHostImplTest : public testing::Test,
scoped_ptr<TestSharedBitmapManager> shared_bitmap_manager_;
scoped_ptr<TestGpuMemoryBufferManager> gpu_memory_buffer_manager_;
+ scoped_ptr<TestTaskGraphRunner> task_graph_runner_;
scoped_ptr<LayerTreeHostImpl> host_impl_;
FakeRenderingStatsInstrumentation stats_instrumentation_;
bool on_can_draw_state_changed_called_;
@@ -1547,6 +1547,7 @@ class LayerTreeHostImplOverridePhysicalTime : public LayerTreeHostImpl {
rendering_stats_instrumentation,
manager,
NULL,
+ NULL,
0) {}
BeginFrameArgs CurrentBeginFrameArgs() const override {
@@ -5046,16 +5047,10 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) {
// that we can force partial swap enabled.
LayerTreeSettings settings;
settings.renderer_settings.partial_swap_enabled = true;
- scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
- new TestSharedBitmapManager());
scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl =
- LayerTreeHostImpl::Create(settings,
- this,
- &proxy_,
- &stats_instrumentation_,
- shared_bitmap_manager.get(),
- NULL,
- 0);
+ LayerTreeHostImpl::Create(
+ settings, this, &proxy_, &stats_instrumentation_,
+ shared_bitmap_manager_.get(), NULL, task_graph_runner_.get(), 0);
layer_tree_host_impl->InitializeRenderer(output_surface.Pass());
layer_tree_host_impl->SetViewportSize(gfx::Size(500, 500));
@@ -5343,7 +5338,7 @@ static scoped_ptr<LayerTreeHostImpl> SetupLayersForOpacity(
LayerTreeSettings settings;
settings.renderer_settings.partial_swap_enabled = partial_swap;
scoped_ptr<LayerTreeHostImpl> my_host_impl = LayerTreeHostImpl::Create(
- settings, client, proxy, stats_instrumentation, manager, NULL, 0);
+ settings, client, proxy, stats_instrumentation, manager, NULL, NULL, 0);
my_host_impl->InitializeRenderer(output_surface.Pass());
my_host_impl->SetViewportSize(gfx::Size(100, 100));
@@ -6669,13 +6664,10 @@ TEST_F(LayerTreeHostImplTestDeferredInitialize, Fails) {
// doesn't support memory management extensions.
TEST_F(LayerTreeHostImplTest, DefaultMemoryAllocation) {
LayerTreeSettings settings;
- host_impl_ = LayerTreeHostImpl::Create(settings,
- this,
- &proxy_,
- &stats_instrumentation_,
- shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(),
- 0);
+ host_impl_ = LayerTreeHostImpl::Create(
+ settings, this, &proxy_, &stats_instrumentation_,
+ shared_bitmap_manager_.get(), gpu_memory_buffer_manager_.get(),
+ task_graph_runner_.get(), 0);
scoped_ptr<OutputSurface> output_surface(
FakeOutputSurface::Create3d(TestWebGraphicsContext3D::Create()));
@@ -6716,7 +6708,7 @@ TEST_F(LayerTreeHostImplTest, MemoryPolicy) {
LayerTreeSettings settings;
settings.gpu_rasterization_enabled = true;
host_impl_ = LayerTreeHostImpl::Create(
- settings, this, &proxy_, &stats_instrumentation_, NULL, NULL, 0);
+ settings, this, &proxy_, &stats_instrumentation_, NULL, NULL, NULL, 0);
host_impl_->SetUseGpuRasterization(true);
host_impl_->SetVisible(true);
host_impl_->SetMemoryPolicy(policy1);
@@ -6779,8 +6771,9 @@ class LayerTreeHostImplTestPrepareTiles : public LayerTreeHostImplTest {
LayerTreeSettings settings;
settings.impl_side_painting = true;
- fake_host_impl_ = new FakeLayerTreeHostImpl(
- settings, &proxy_, shared_bitmap_manager_.get());
+ fake_host_impl_ = new FakeLayerTreeHostImpl(settings, &proxy_,
+ shared_bitmap_manager_.get(),
+ task_graph_runner_.get());
host_impl_.reset(fake_host_impl_);
host_impl_->InitializeRenderer(CreateOutputSurface());
host_impl_->SetViewportSize(gfx::Size(10, 10));
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 20ef496..415b23e 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -2209,7 +2209,7 @@ class LayerTreeHostWithProxy : public LayerTreeHost {
LayerTreeHostWithProxy(FakeLayerTreeHostClient* client,
const LayerTreeSettings& settings,
scoped_ptr<FakeProxy> proxy)
- : LayerTreeHost(client, NULL, NULL, settings) {
+ : LayerTreeHost(client, NULL, NULL, NULL, settings) {
proxy->SetLayerTreeHost(this);
client->SetLayerTreeHost(this);
InitializeForTesting(proxy.Pass());
@@ -2281,14 +2281,9 @@ TEST(LayerTreeHostTest, PartialUpdatesWithGLRenderer) {
scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
new TestSharedBitmapManager());
- scoped_ptr<LayerTreeHost> host =
- LayerTreeHost::CreateSingleThreaded(&client,
- &client,
- shared_bitmap_manager.get(),
- NULL,
- settings,
- base::MessageLoopProxy::current(),
- nullptr);
+ scoped_ptr<LayerTreeHost> host = LayerTreeHost::CreateSingleThreaded(
+ &client, &client, shared_bitmap_manager.get(), NULL, NULL, settings,
+ base::MessageLoopProxy::current(), nullptr);
client.SetLayerTreeHost(host.get());
host->Composite(base::TimeTicks::Now());
@@ -2305,14 +2300,9 @@ TEST(LayerTreeHostTest, PartialUpdatesWithSoftwareRenderer) {
scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
new TestSharedBitmapManager());
- scoped_ptr<LayerTreeHost> host =
- LayerTreeHost::CreateSingleThreaded(&client,
- &client,
- shared_bitmap_manager.get(),
- NULL,
- settings,
- base::MessageLoopProxy::current(),
- nullptr);
+ scoped_ptr<LayerTreeHost> host = LayerTreeHost::CreateSingleThreaded(
+ &client, &client, shared_bitmap_manager.get(), NULL, NULL, settings,
+ base::MessageLoopProxy::current(), nullptr);
client.SetLayerTreeHost(host.get());
host->Composite(base::TimeTicks::Now());
@@ -2329,14 +2319,9 @@ TEST(LayerTreeHostTest, PartialUpdatesWithDelegatingRendererAndGLContent) {
scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
new TestSharedBitmapManager());
- scoped_ptr<LayerTreeHost> host =
- LayerTreeHost::CreateSingleThreaded(&client,
- &client,
- shared_bitmap_manager.get(),
- NULL,
- settings,
- base::MessageLoopProxy::current(),
- nullptr);
+ scoped_ptr<LayerTreeHost> host = LayerTreeHost::CreateSingleThreaded(
+ &client, &client, shared_bitmap_manager.get(), NULL, NULL, settings,
+ base::MessageLoopProxy::current(), nullptr);
client.SetLayerTreeHost(host.get());
host->Composite(base::TimeTicks::Now());
@@ -2354,14 +2339,9 @@ TEST(LayerTreeHostTest,
scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
new TestSharedBitmapManager());
- scoped_ptr<LayerTreeHost> host =
- LayerTreeHost::CreateSingleThreaded(&client,
- &client,
- shared_bitmap_manager.get(),
- NULL,
- settings,
- base::MessageLoopProxy::current(),
- nullptr);
+ scoped_ptr<LayerTreeHost> host = LayerTreeHost::CreateSingleThreaded(
+ &client, &client, shared_bitmap_manager.get(), NULL, NULL, settings,
+ base::MessageLoopProxy::current(), nullptr);
client.SetLayerTreeHost(host.get());
host->Composite(base::TimeTicks::Now());
diff --git a/cc/trees/layer_tree_host_unittest_no_message_loop.cc b/cc/trees/layer_tree_host_unittest_no_message_loop.cc
index 622143d..3abc4dc 100644
--- a/cc/trees/layer_tree_host_unittest_no_message_loop.cc
+++ b/cc/trees/layer_tree_host_unittest_no_message_loop.cc
@@ -106,7 +106,7 @@ class LayerTreeHostNoMessageLoopTest
settings.verify_property_trees = true;
settings.raster_enabled = false;
layer_tree_host_ = LayerTreeHost::CreateSingleThreaded(
- this, this, nullptr, nullptr, settings, nullptr, nullptr);
+ this, this, nullptr, nullptr, nullptr, settings, nullptr, nullptr);
layer_tree_host_->SetViewportSize(size_);
layer_tree_host_->SetRootLayer(root_layer_);
}
diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc
index fce09d4..be972e9 100644
--- a/cc/trees/layer_tree_host_unittest_scroll.cc
+++ b/cc/trees/layer_tree_host_unittest_scroll.cc
@@ -1126,14 +1126,10 @@ TEST(LayerTreeHostFlingTest, DidStopFlingingThread) {
ASSERT_TRUE(impl_thread.message_loop_proxy().get());
scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
new TestSharedBitmapManager());
- scoped_ptr<LayerTreeHost> layer_tree_host =
- LayerTreeHost::CreateThreaded(&client,
- shared_bitmap_manager.get(),
- NULL,
- settings,
- base::MessageLoopProxy::current(),
- impl_thread.message_loop_proxy(),
- nullptr);
+ scoped_ptr<LayerTreeHost> layer_tree_host = LayerTreeHost::CreateThreaded(
+ &client, shared_bitmap_manager.get(), NULL, NULL, settings,
+ base::MessageLoopProxy::current(), impl_thread.message_loop_proxy(),
+ nullptr);
impl_thread.message_loop_proxy()
->PostTask(FROM_HERE,
diff --git a/cc/trees/layer_tree_impl_unittest.cc b/cc/trees/layer_tree_impl_unittest.cc
index 06df3c2..c4abd52 100644
--- a/cc/trees/layer_tree_impl_unittest.cc
+++ b/cc/trees/layer_tree_impl_unittest.cc
@@ -13,6 +13,7 @@
#include "cc/test/geometry_test_utils.h"
#include "cc/test/layer_tree_host_common_test.h"
#include "cc/test/test_shared_bitmap_manager.h"
+#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/layer_tree_host_impl.h"
#include "ui/gfx/geometry/size_conversions.h"
@@ -25,8 +26,8 @@ class LayerTreeImplTest : public LayerTreeHostCommonTest {
LayerTreeSettings settings;
settings.layer_transforms_should_scale_layer_contents = true;
settings.scrollbar_show_scale_threshold = 1.1f;
- host_impl_.reset(
- new FakeLayerTreeHostImpl(settings, &proxy_, &shared_bitmap_manager_));
+ host_impl_.reset(new FakeLayerTreeHostImpl(
+ settings, &proxy_, &shared_bitmap_manager_, &task_graph_runner_));
EXPECT_TRUE(host_impl_->InitializeRenderer(FakeOutputSurface::Create3d()));
}
@@ -40,6 +41,7 @@ class LayerTreeImplTest : public LayerTreeHostCommonTest {
private:
TestSharedBitmapManager shared_bitmap_manager_;
+ TestTaskGraphRunner task_graph_runner_;
FakeImplProxy proxy_;
scoped_ptr<FakeLayerTreeHostImpl> host_impl_;
};
diff --git a/cc/trees/layer_tree_settings.cc b/cc/trees/layer_tree_settings.cc
index d10a141..09314adc 100644
--- a/cc/trees/layer_tree_settings.cc
+++ b/cc/trees/layer_tree_settings.cc
@@ -70,7 +70,8 @@ LayerTreeSettings::LayerTreeSettings()
use_occlusion_for_tile_prioritization(false),
record_full_layer(false),
use_display_lists(false),
- verify_property_trees(false) {
+ verify_property_trees(false),
+ gather_pixel_refs(false) {
}
LayerTreeSettings::~LayerTreeSettings() {}
diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h
index c3dd38e5..1f61f89 100644
--- a/cc/trees/layer_tree_settings.h
+++ b/cc/trees/layer_tree_settings.h
@@ -83,6 +83,7 @@ class CC_EXPORT LayerTreeSettings {
bool record_full_layer;
bool use_display_lists;
bool verify_property_trees;
+ bool gather_pixel_refs;
LayerTreeDebugState initial_debug_state;
diff --git a/cc/trees/occlusion_tracker_perftest.cc b/cc/trees/occlusion_tracker_perftest.cc
index e53a05f..854dacd 100644
--- a/cc/trees/occlusion_tracker_perftest.cc
+++ b/cc/trees/occlusion_tracker_perftest.cc
@@ -36,13 +36,9 @@ class OcclusionTrackerPerfTest : public testing::Test {
void CreateHost() {
LayerTreeSettings settings;
shared_bitmap_manager_.reset(new TestSharedBitmapManager());
- host_impl_ = LayerTreeHostImpl::Create(settings,
- &client_,
- &proxy_,
- &stats_,
- shared_bitmap_manager_.get(),
- NULL,
- 1);
+ host_impl_ =
+ LayerTreeHostImpl::Create(settings, &client_, &proxy_, &stats_,
+ shared_bitmap_manager_.get(), NULL, NULL, 1);
host_impl_->InitializeRenderer(FakeOutputSurface::Create3d());
scoped_ptr<LayerImpl> root_layer = LayerImpl::Create(active_tree(), 1);
diff --git a/cc/trees/tree_synchronizer_unittest.cc b/cc/trees/tree_synchronizer_unittest.cc
index d48f821..a17bec8 100644
--- a/cc/trees/tree_synchronizer_unittest.cc
+++ b/cc/trees/tree_synchronizer_unittest.cc
@@ -556,13 +556,8 @@ TEST_F(TreeSynchronizerTest, SynchronizeAnimations) {
scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
new TestSharedBitmapManager());
scoped_ptr<LayerTreeHostImpl> host_impl =
- LayerTreeHostImpl::Create(settings,
- NULL,
- &proxy,
- &stats_instrumentation,
- shared_bitmap_manager.get(),
- NULL,
- 0);
+ LayerTreeHostImpl::Create(settings, NULL, &proxy, &stats_instrumentation,
+ shared_bitmap_manager.get(), NULL, NULL, 0);
scoped_refptr<Layer> layer_tree_root = Layer::Create();
host_->SetRootLayer(layer_tree_root);
@@ -595,13 +590,8 @@ TEST_F(TreeSynchronizerTest, SynchronizeScrollParent) {
scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
new TestSharedBitmapManager());
scoped_ptr<LayerTreeHostImpl> host_impl =
- LayerTreeHostImpl::Create(settings,
- NULL,
- &proxy,
- &stats_instrumentation,
- shared_bitmap_manager.get(),
- NULL,
- 0);
+ LayerTreeHostImpl::Create(settings, NULL, &proxy, &stats_instrumentation,
+ shared_bitmap_manager.get(), NULL, NULL, 0);
scoped_refptr<Layer> layer_tree_root = Layer::Create();
scoped_refptr<Layer> scroll_parent = Layer::Create();
@@ -668,13 +658,8 @@ TEST_F(TreeSynchronizerTest, SynchronizeClipParent) {
scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
new TestSharedBitmapManager());
scoped_ptr<LayerTreeHostImpl> host_impl =
- LayerTreeHostImpl::Create(settings,
- NULL,
- &proxy,
- &stats_instrumentation,
- shared_bitmap_manager.get(),
- NULL,
- 0);
+ LayerTreeHostImpl::Create(settings, NULL, &proxy, &stats_instrumentation,
+ shared_bitmap_manager.get(), NULL, NULL, 0);
scoped_refptr<Layer> layer_tree_root = Layer::Create();
scoped_refptr<Layer> clip_parent = Layer::Create();