summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2015-06-16 15:48:56 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-16 22:49:31 +0000
commitcf6105879590dbf12e023250821ddc9e3f807524 (patch)
tree713a43a6946547a70ea5ca04173146d3429032e9
parentb0e8c81ed1be3462355c5d5543d2636545029d63 (diff)
downloadchromium_src-cf6105879590dbf12e023250821ddc9e3f807524.zip
chromium_src-cf6105879590dbf12e023250821ddc9e3f807524.tar.gz
chromium_src-cf6105879590dbf12e023250821ddc9e3f807524.tar.bz2
cc: Turn impl_side_painting and use_one_copy on in LayerTreeSettings.
Make these default to true in LayerTreeSettings so that all unit tests will use them automatically unless they opt out. Fix all the tests that crashed with this on, due to having a null cc::TaskGraphRunner. R=enne, vmpstr BUG=413479 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel NOTRY=true Review URL: https://codereview.chromium.org/1177033008 Cr-Commit-Position: refs/heads/master@{#334726}
-rw-r--r--cc/blink/web_layer_impl_fixed_bounds_unittest.cc4
-rw-r--r--cc/debug/frame_timing_tracker_unittest.cc37
-rw-r--r--cc/debug/micro_benchmark_controller_unittest.cc10
-rw-r--r--cc/layers/contents_scaling_layer_unittest.cc5
-rw-r--r--cc/layers/delegated_renderer_layer_unittest.cc5
-rw-r--r--cc/layers/heads_up_display_layer_impl_unittest.cc5
-rw-r--r--cc/layers/layer_impl_unittest.cc16
-rw-r--r--cc/layers/layer_iterator_unittest.cc13
-rw-r--r--cc/layers/layer_perftest.cc3
-rw-r--r--cc/layers/layer_position_constraint_unittest.cc5
-rw-r--r--cc/layers/layer_unittest.cc16
-rw-r--r--cc/layers/nine_patch_layer_impl_unittest.cc4
-rw-r--r--cc/layers/nine_patch_layer_unittest.cc6
-rw-r--r--cc/layers/picture_layer_impl_unittest.cc8
-rw-r--r--cc/layers/picture_layer_unittest.cc24
-rw-r--r--cc/layers/render_surface_unittest.cc13
-rw-r--r--cc/layers/scrollbar_layer_unittest.cc4
-rw-r--r--cc/layers/solid_color_layer_impl_unittest.cc22
-rw-r--r--cc/layers/surface_layer_unittest.cc11
-rw-r--r--cc/layers/texture_layer_unittest.cc11
-rw-r--r--cc/layers/tiled_layer_unittest.cc11
-rw-r--r--cc/layers/ui_resource_layer_impl_unittest.cc13
-rw-r--r--cc/layers/ui_resource_layer_unittest.cc5
-rw-r--r--cc/test/fake_layer_tree_host.cc14
-rw-r--r--cc/test/fake_layer_tree_host.h6
-rw-r--r--cc/test/fake_ui_resource_layer_tree_host_impl.cc5
-rw-r--r--cc/test/fake_ui_resource_layer_tree_host_impl.h4
-rw-r--r--cc/test/layer_test_common.cc2
-rw-r--r--cc/test/layer_test_common.h2
-rw-r--r--cc/test/layer_tree_host_common_test.cc2
-rw-r--r--cc/test/layer_tree_host_common_test.h2
-rw-r--r--cc/test/layer_tree_json_parser_unittest.cc9
-rw-r--r--cc/trees/layer_tree_host.cc1
-rw-r--r--cc/trees/layer_tree_host_common_unittest.cc72
-rw-r--r--cc/trees/layer_tree_host_impl.cc3
-rw-r--r--cc/trees/layer_tree_host_impl_unittest.cc64
-rw-r--r--cc/trees/layer_tree_host_pixeltest_synchronous.cc1
-rw-r--r--cc/trees/layer_tree_host_unittest.cc2
-rw-r--r--cc/trees/layer_tree_host_unittest_context.cc4
-rw-r--r--cc/trees/layer_tree_host_unittest_scroll.cc10
-rw-r--r--cc/trees/layer_tree_settings.cc4
-rw-r--r--cc/trees/occlusion_tracker_unittest.cc4
-rw-r--r--cc/trees/tree_synchronizer_unittest.cc34
-rw-r--r--content/browser/renderer_host/compositor_impl_android.cc1
-rw-r--r--content/test/web_layer_tree_view_impl_for_testing.cc1
-rw-r--r--content/test/web_layer_tree_view_impl_for_testing.h2
46 files changed, 335 insertions, 165 deletions
diff --git a/cc/blink/web_layer_impl_fixed_bounds_unittest.cc b/cc/blink/web_layer_impl_fixed_bounds_unittest.cc
index 239e5ee..b49c0a9 100644
--- a/cc/blink/web_layer_impl_fixed_bounds_unittest.cc
+++ b/cc/blink/web_layer_impl_fixed_bounds_unittest.cc
@@ -7,6 +7,7 @@
#include "cc/layers/picture_image_layer.h"
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/geometry_test_utils.h"
+#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/layer_tree_host_common.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/public/platform/WebFloatPoint.h"
@@ -105,8 +106,9 @@ void CompareFixedBoundsLayerAndNormalLayer(const WebFloatPoint& anchor_point,
root_layer->addChild(normal_layer);
cc::FakeLayerTreeHostClient client(cc::FakeLayerTreeHostClient::DIRECT_3D);
+ cc::TestTaskGraphRunner task_graph_runner;
scoped_ptr<cc::FakeLayerTreeHost> host =
- cc::FakeLayerTreeHost::Create(&client);
+ cc::FakeLayerTreeHost::Create(&client, &task_graph_runner);
host->SetRootLayer(root_layer->layer());
{
diff --git a/cc/debug/frame_timing_tracker_unittest.cc b/cc/debug/frame_timing_tracker_unittest.cc
index 2b5f941..218927c 100644
--- a/cc/debug/frame_timing_tracker_unittest.cc
+++ b/cc/debug/frame_timing_tracker_unittest.cc
@@ -12,6 +12,7 @@
#include "cc/test/fake_impl_proxy.h"
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/test_shared_bitmap_manager.h"
+#include "cc/test/test_task_graph_runner.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
@@ -75,7 +76,9 @@ std::string MainFrameToString(
TEST(FrameTimingTrackerTest, DefaultTrackerIsEmpty) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
scoped_ptr<FrameTimingTracker> tracker(
FrameTimingTracker::Create(&host_impl));
@@ -88,7 +91,9 @@ TEST(FrameTimingTrackerTest, DefaultTrackerIsEmpty) {
TEST(FrameTimingTrackerTest, NoFrameIdsIsEmpty) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
scoped_ptr<FrameTimingTracker> tracker(
FrameTimingTracker::Create(&host_impl));
@@ -101,7 +106,9 @@ TEST(FrameTimingTrackerTest, NoFrameIdsIsEmpty) {
TEST(FrameTimingTrackerTest, NoRectIdsYieldsNoMainFrameEvents) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
scoped_ptr<FrameTimingTracker> tracker(
FrameTimingTracker::Create(&host_impl));
@@ -115,7 +122,9 @@ TEST(FrameTimingTrackerTest, NoRectIdsYieldsNoMainFrameEvents) {
TEST(FrameTimingTrackerTest, OneFrameId) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
scoped_ptr<FrameTimingTracker> tracker(
FrameTimingTracker::Create(&host_impl));
@@ -131,7 +140,9 @@ TEST(FrameTimingTrackerTest, OneFrameId) {
TEST(FrameTimingTrackerTest, OneMainFrameRect) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
scoped_ptr<FrameTimingTracker> tracker(
FrameTimingTracker::Create(&host_impl));
@@ -149,7 +160,9 @@ TEST(FrameTimingTrackerTest, OneMainFrameRect) {
TEST(FrameTimingTrackerTest, UnsortedTimestampsIds) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
scoped_ptr<FrameTimingTracker> tracker(
FrameTimingTracker::Create(&host_impl));
@@ -169,7 +182,9 @@ TEST(FrameTimingTrackerTest, UnsortedTimestampsIds) {
TEST(FrameTimingTrackerTest, MainFrameUnsortedTimestamps) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
scoped_ptr<FrameTimingTracker> tracker(
FrameTimingTracker::Create(&host_impl));
@@ -195,7 +210,9 @@ TEST(FrameTimingTrackerTest, MainFrameUnsortedTimestamps) {
TEST(FrameTimingTrackerTest, MultipleFrameIds) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
scoped_ptr<FrameTimingTracker> tracker(
FrameTimingTracker::Create(&host_impl));
@@ -232,7 +249,9 @@ TEST(FrameTimingTrackerTest, MultipleFrameIds) {
TEST(FrameTimingTrackerTest, MultipleMainFrameEvents) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
scoped_ptr<FrameTimingTracker> tracker(
FrameTimingTracker::Create(&host_impl));
diff --git a/cc/debug/micro_benchmark_controller_unittest.cc b/cc/debug/micro_benchmark_controller_unittest.cc
index 87a3b42..92cfc46 100644
--- a/cc/debug/micro_benchmark_controller_unittest.cc
+++ b/cc/debug/micro_benchmark_controller_unittest.cc
@@ -11,6 +11,7 @@
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/fake_proxy.h"
+#include "cc/test/test_task_graph_runner.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
@@ -23,11 +24,11 @@ class MicroBenchmarkControllerTest : public testing::Test {
void SetUp() override {
impl_proxy_ = make_scoped_ptr(new FakeImplProxy);
- shared_bitmap_manager_.reset(new TestSharedBitmapManager());
layer_tree_host_impl_ = make_scoped_ptr(new FakeLayerTreeHostImpl(
- impl_proxy_.get(), shared_bitmap_manager_.get(), nullptr));
+ impl_proxy_.get(), &shared_bitmap_manager_, &task_graph_runner_));
- layer_tree_host_ = FakeLayerTreeHost::Create(&layer_tree_host_client_);
+ layer_tree_host_ = FakeLayerTreeHost::Create(&layer_tree_host_client_,
+ &task_graph_runner_);
layer_tree_host_->SetRootLayer(Layer::Create(LayerSettings()));
layer_tree_host_->InitializeForTesting(scoped_ptr<Proxy>(new FakeProxy));
}
@@ -39,8 +40,9 @@ class MicroBenchmarkControllerTest : public testing::Test {
}
FakeLayerTreeHostClient layer_tree_host_client_;
+ TestTaskGraphRunner task_graph_runner_;
+ TestSharedBitmapManager shared_bitmap_manager_;
scoped_ptr<FakeLayerTreeHost> layer_tree_host_;
- scoped_ptr<SharedBitmapManager> shared_bitmap_manager_;
scoped_ptr<FakeLayerTreeHostImpl> layer_tree_host_impl_;
scoped_ptr<FakeImplProxy> impl_proxy_;
};
diff --git a/cc/layers/contents_scaling_layer_unittest.cc b/cc/layers/contents_scaling_layer_unittest.cc
index efad264..567b21e 100644
--- a/cc/layers/contents_scaling_layer_unittest.cc
+++ b/cc/layers/contents_scaling_layer_unittest.cc
@@ -8,6 +8,7 @@
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/geometry_test_utils.h"
+#include "cc/test/test_task_graph_runner.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
@@ -45,7 +46,9 @@ TEST(ContentsScalingLayerTest, CheckContentsBounds) {
LayerSettings layer_settings;
FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D);
- scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&client);
+ TestTaskGraphRunner task_graph_runner;
+ scoped_ptr<FakeLayerTreeHost> host =
+ FakeLayerTreeHost::Create(&client, &task_graph_runner);
scoped_refptr<MockContentsScalingLayer> test_layer =
make_scoped_refptr(new MockContentsScalingLayer(layer_settings));
diff --git a/cc/layers/delegated_renderer_layer_unittest.cc b/cc/layers/delegated_renderer_layer_unittest.cc
index 96b62af..ad4a345 100644
--- a/cc/layers/delegated_renderer_layer_unittest.cc
+++ b/cc/layers/delegated_renderer_layer_unittest.cc
@@ -11,6 +11,7 @@
#include "cc/test/fake_delegated_renderer_layer.h"
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/fake_proxy.h"
+#include "cc/test/test_task_graph_runner.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
@@ -23,13 +24,15 @@ class DelegatedRendererLayerTest : public testing::Test {
LayerTreeSettings settings;
settings.minimum_occlusion_tracking_size = gfx::Size();
- host_impl_ = FakeLayerTreeHost::Create(&host_client_, settings);
+ host_impl_ =
+ FakeLayerTreeHost::Create(&host_client_, &task_graph_runner_, settings);
host_impl_->SetViewportSize(gfx::Size(10, 10));
}
protected:
FakeProxy proxy_;
FakeLayerTreeHostClient host_client_;
+ TestTaskGraphRunner task_graph_runner_;
TestSharedBitmapManager shared_bitmap_manager_;
scoped_ptr<LayerTreeHost> host_impl_;
};
diff --git a/cc/layers/heads_up_display_layer_impl_unittest.cc b/cc/layers/heads_up_display_layer_impl_unittest.cc
index ab38fdd..b0a65df 100644
--- a/cc/layers/heads_up_display_layer_impl_unittest.cc
+++ b/cc/layers/heads_up_display_layer_impl_unittest.cc
@@ -8,6 +8,7 @@
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/fake_output_surface.h"
#include "cc/test/test_shared_bitmap_manager.h"
+#include "cc/test/test_task_graph_runner.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
@@ -32,7 +33,9 @@ void CheckDrawLayer(HeadsUpDisplayLayerImpl* layer,
TEST(HeadsUpDisplayLayerImplTest, ResourcelessSoftwareDrawAfterResourceLoss) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
host_impl.CreatePendingTree();
host_impl.InitializeRenderer(FakeOutputSurface::Create3d());
scoped_ptr<HeadsUpDisplayLayerImpl> layer =
diff --git a/cc/layers/layer_impl_unittest.cc b/cc/layers/layer_impl_unittest.cc
index 713a99d..5a794ab 100644
--- a/cc/layers/layer_impl_unittest.cc
+++ b/cc/layers/layer_impl_unittest.cc
@@ -88,7 +88,9 @@ TEST(LayerImplTest, VerifyLayerChangesAreTrackedProperly) {
// Create a simple LayerImpl tree:
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
EXPECT_TRUE(host_impl.InitializeRenderer(FakeOutputSurface::Create3d()));
scoped_ptr<LayerImpl> root_clip =
LayerImpl::Create(host_impl.active_tree(), 1);
@@ -251,7 +253,9 @@ TEST(LayerImplTest, VerifyLayerChangesAreTrackedProperly) {
TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
EXPECT_TRUE(host_impl.InitializeRenderer(FakeOutputSurface::Create3d()));
host_impl.active_tree()->SetRootLayer(
LayerImpl::Create(host_impl.active_tree(), 1));
@@ -369,7 +373,9 @@ TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) {
TEST(LayerImplTest, SafeOpaqueBackgroundColor) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
EXPECT_TRUE(host_impl.InitializeRenderer(FakeOutputSurface::Create3d()));
scoped_ptr<LayerImpl> layer = LayerImpl::Create(host_impl.active_tree(), 1);
@@ -400,7 +406,9 @@ TEST(LayerImplTest, SafeOpaqueBackgroundColor) {
TEST(LayerImplTest, TransformInvertibility) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
scoped_ptr<LayerImpl> layer = LayerImpl::Create(host_impl.active_tree(), 1);
EXPECT_TRUE(layer->transform().IsInvertible());
diff --git a/cc/layers/layer_iterator_unittest.cc b/cc/layers/layer_iterator_unittest.cc
index b53daee..130222d 100644
--- a/cc/layers/layer_iterator_unittest.cc
+++ b/cc/layers/layer_iterator_unittest.cc
@@ -8,6 +8,7 @@
#include "cc/layers/layer.h"
#include "cc/test/fake_layer_tree_host.h"
+#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/layer_tree_host_common.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -114,7 +115,9 @@ TEST(LayerIteratorTest, SimpleTree) {
root_layer->AddChild(fourth);
FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D);
- scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&client);
+ TestTaskGraphRunner task_graph_runner;
+ scoped_ptr<FakeLayerTreeHost> host =
+ FakeLayerTreeHost::Create(&client, &task_graph_runner);
host->SetRootLayer(root_layer);
RenderSurfaceLayerList render_surface_layer_list;
@@ -152,7 +155,9 @@ TEST(LayerIteratorTest, ComplexTree) {
root23->AddChild(root231);
FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D);
- scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&client);
+ TestTaskGraphRunner task_graph_runner;
+ scoped_ptr<FakeLayerTreeHost> host =
+ FakeLayerTreeHost::Create(&client, &task_graph_runner);
host->SetRootLayer(root_layer);
RenderSurfaceLayerList render_surface_layer_list;
@@ -199,7 +204,9 @@ TEST(LayerIteratorTest, ComplexTreeMultiSurface) {
root23->AddChild(root231);
FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D);
- scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&client);
+ TestTaskGraphRunner task_graph_runner;
+ scoped_ptr<FakeLayerTreeHost> host =
+ FakeLayerTreeHost::Create(&client, &task_graph_runner);
host->SetRootLayer(root_layer);
RenderSurfaceLayerList render_surface_layer_list;
diff --git a/cc/layers/layer_perftest.cc b/cc/layers/layer_perftest.cc
index fbe00f3..bc32ded 100644
--- a/cc/layers/layer_perftest.cc
+++ b/cc/layers/layer_perftest.cc
@@ -39,7 +39,8 @@ class LayerPerfTest : public testing::Test {
protected:
void SetUp() override {
- layer_tree_host_ = FakeLayerTreeHost::Create(&fake_client_);
+ layer_tree_host_ =
+ FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_);
layer_tree_host_->InitializeSingleThreaded(
&fake_client_, base::ThreadTaskRunnerHandle::Get(), nullptr);
}
diff --git a/cc/layers/layer_position_constraint_unittest.cc b/cc/layers/layer_position_constraint_unittest.cc
index 19b6803..6977fb8 100644
--- a/cc/layers/layer_position_constraint_unittest.cc
+++ b/cc/layers/layer_position_constraint_unittest.cc
@@ -10,6 +10,7 @@
#include "cc/layers/layer_impl.h"
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/geometry_test_utils.h"
+#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/layer_tree_host_common.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -55,7 +56,8 @@ class LayerPositionConstraintTest : public testing::Test {
public:
LayerPositionConstraintTest()
: fake_client_(FakeLayerTreeHostClient::DIRECT_3D),
- layer_tree_host_(FakeLayerTreeHost::Create(&fake_client_)),
+ layer_tree_host_(
+ FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_)),
root_impl_(nullptr),
scroll_layer_impl_(nullptr),
child_transform_layer_impl_(nullptr),
@@ -123,6 +125,7 @@ class LayerPositionConstraintTest : public testing::Test {
protected:
FakeLayerTreeHostClient fake_client_;
+ TestTaskGraphRunner task_graph_runner_;
scoped_ptr<FakeLayerTreeHost> layer_tree_host_;
LayerSettings layer_settings_;
scoped_refptr<Layer> root_;
diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc
index 61d9333..3aa8da9 100644
--- a/cc/layers/layer_unittest.cc
+++ b/cc/layers/layer_unittest.cc
@@ -73,6 +73,7 @@ class LayerTest : public testing::Test {
LayerTreeSettings settings;
params.client = &fake_client_;
params.settings = &settings;
+ params.task_graph_runner = &task_graph_runner_;
layer_tree_host_.reset(
new StrictMock<MockLayerTreeHost>(&fake_client_, &params));
}
@@ -941,18 +942,16 @@ TEST_F(LayerTest, TranformIsInvertibleAnimation) {
class LayerTreeHostFactory {
public:
- LayerTreeHostFactory()
- : client_(FakeLayerTreeHostClient::DIRECT_3D),
- shared_bitmap_manager_(new TestSharedBitmapManager),
- gpu_memory_buffer_manager_(new TestGpuMemoryBufferManager) {}
+ LayerTreeHostFactory() : client_(FakeLayerTreeHostClient::DIRECT_3D) {}
scoped_ptr<LayerTreeHost> Create() { return Create(LayerTreeSettings()); }
scoped_ptr<LayerTreeHost> Create(LayerTreeSettings settings) {
LayerTreeHost::InitParams params;
params.client = &client_;
- params.shared_bitmap_manager = shared_bitmap_manager_.get();
- params.gpu_memory_buffer_manager = gpu_memory_buffer_manager_.get();
+ params.shared_bitmap_manager = &shared_bitmap_manager_;
+ params.task_graph_runner = &task_graph_runner_;
+ params.gpu_memory_buffer_manager = &gpu_memory_buffer_manager_;
params.settings = &settings;
params.main_task_runner = base::ThreadTaskRunnerHandle::Get();
return LayerTreeHost::CreateSingleThreaded(&client_, &params);
@@ -960,8 +959,9 @@ class LayerTreeHostFactory {
private:
FakeLayerTreeHostClient client_;
- scoped_ptr<TestSharedBitmapManager> shared_bitmap_manager_;
- scoped_ptr<TestGpuMemoryBufferManager> gpu_memory_buffer_manager_;
+ TestSharedBitmapManager shared_bitmap_manager_;
+ TestTaskGraphRunner task_graph_runner_;
+ TestGpuMemoryBufferManager gpu_memory_buffer_manager_;
};
void AssertLayerTreeHostMatchesForSubtree(Layer* layer, LayerTreeHost* host) {
diff --git a/cc/layers/nine_patch_layer_impl_unittest.cc b/cc/layers/nine_patch_layer_impl_unittest.cc
index a71f92e..8537ddb 100644
--- a/cc/layers/nine_patch_layer_impl_unittest.cc
+++ b/cc/layers/nine_patch_layer_impl_unittest.cc
@@ -45,7 +45,9 @@ void NinePatchLayerLayoutTest(const gfx::Size& bitmap_size,
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeUIResourceLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ TestTaskGraphRunner task_graph_runner;
+ FakeUIResourceLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
host_impl.InitializeRenderer(FakeOutputSurface::Create3d());
scoped_ptr<NinePatchLayerImpl> layer =
diff --git a/cc/layers/nine_patch_layer_unittest.cc b/cc/layers/nine_patch_layer_unittest.cc
index b6be34d..579808b 100644
--- a/cc/layers/nine_patch_layer_unittest.cc
+++ b/cc/layers/nine_patch_layer_unittest.cc
@@ -13,7 +13,7 @@
#include "cc/test/fake_output_surface.h"
#include "cc/test/fake_output_surface_client.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.h"
#include "cc/trees/single_thread_proxy.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -34,7 +34,8 @@ class NinePatchLayerTest : public testing::Test {
protected:
void SetUp() override {
- layer_tree_host_ = FakeLayerTreeHost::Create(&fake_client_);
+ layer_tree_host_ =
+ FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_);
}
void TearDown() override {
@@ -42,6 +43,7 @@ class NinePatchLayerTest : public testing::Test {
}
FakeLayerTreeHostClient fake_client_;
+ TestTaskGraphRunner task_graph_runner_;
scoped_ptr<FakeLayerTreeHost> layer_tree_host_;
};
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index 5b46c6e..c43000d 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -4509,7 +4509,9 @@ void PictureLayerImplTest::TestQuadsForSolidColor(bool test_for_solid) {
scoped_refptr<PictureLayer> layer =
PictureLayer::Create(layer_settings_, &client);
FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D);
- scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client);
+ TestTaskGraphRunner task_graph_runner;
+ scoped_ptr<FakeLayerTreeHost> host =
+ FakeLayerTreeHost::Create(&host_client, &task_graph_runner);
host->SetRootLayer(layer);
RecordingSource* recording_source = layer->GetRecordingSourceForTesting();
@@ -4570,7 +4572,9 @@ TEST_F(PictureLayerImplTest, NonSolidToSolidNoTilings) {
scoped_refptr<PictureLayer> layer =
PictureLayer::Create(layer_settings_, &client);
FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D);
- scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client);
+ TestTaskGraphRunner task_graph_runner;
+ scoped_ptr<FakeLayerTreeHost> host =
+ FakeLayerTreeHost::Create(&host_client, &task_graph_runner);
host->SetRootLayer(layer);
RecordingSource* recording_source = layer->GetRecordingSourceForTesting();
diff --git a/cc/layers/picture_layer_unittest.cc b/cc/layers/picture_layer_unittest.cc
index 4e6946b..4faaf20 100644
--- a/cc/layers/picture_layer_unittest.cc
+++ b/cc/layers/picture_layer_unittest.cc
@@ -13,6 +13,8 @@
#include "cc/test/fake_picture_layer_impl.h"
#include "cc/test/fake_proxy.h"
#include "cc/test/impl_side_painting_settings.h"
+#include "cc/test/test_shared_bitmap_manager.h"
+#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/single_thread_proxy.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -40,7 +42,9 @@ TEST(PictureLayerTest, NoTilesIfEmptyBounds) {
layer->SetBounds(gfx::Size(10, 10));
FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D);
- scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client);
+ TestTaskGraphRunner task_graph_runner;
+ scoped_ptr<FakeLayerTreeHost> host =
+ FakeLayerTreeHost::Create(&host_client, &task_graph_runner);
host->SetRootLayer(layer);
layer->SetIsDrawable(true);
layer->SavePaintProperties();
@@ -63,7 +67,7 @@ TEST(PictureLayerTest, NoTilesIfEmptyBounds) {
TestSharedBitmapManager shared_bitmap_manager;
FakeLayerTreeHostImpl host_impl(ImplSidePaintingSettings(), &proxy,
- &shared_bitmap_manager, nullptr);
+ &shared_bitmap_manager, &task_graph_runner);
host_impl.CreatePendingTree();
scoped_ptr<FakePictureLayerImpl> layer_impl =
FakePictureLayerImpl::Create(host_impl.pending_tree(), 1);
@@ -81,7 +85,9 @@ TEST(PictureLayerTest, SuitableForGpuRasterization) {
scoped_refptr<PictureLayer> layer =
PictureLayer::Create(LayerSettings(), &client);
FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D);
- scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client);
+ TestTaskGraphRunner task_graph_runner;
+ scoped_ptr<FakeLayerTreeHost> host =
+ FakeLayerTreeHost::Create(&host_client, &task_graph_runner);
host->SetRootLayer(layer);
RecordingSource* recording_source = layer->GetRecordingSourceForTesting();
@@ -103,8 +109,9 @@ TEST(PictureLayerTest, UseTileGridSize) {
scoped_refptr<PictureLayer> layer =
PictureLayer::Create(LayerSettings(), &client);
FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D);
+ TestTaskGraphRunner task_graph_runner;
scoped_ptr<FakeLayerTreeHost> host =
- FakeLayerTreeHost::Create(&host_client, settings);
+ FakeLayerTreeHost::Create(&host_client, &task_graph_runner, settings);
host->SetRootLayer(layer);
// Tile-grid is set according to its setting.
@@ -121,11 +128,13 @@ TEST(PictureLayerTest, UseTileGridSize) {
TEST(PictureLayerTest, NonMonotonicSourceFrameNumber) {
LayerTreeSettings settings;
settings.single_thread_proxy_scheduler = false;
+ settings.use_zero_copy = true;
+ settings.use_one_copy = false;
FakeLayerTreeHostClient host_client1(FakeLayerTreeHostClient::DIRECT_3D);
FakeLayerTreeHostClient host_client2(FakeLayerTreeHostClient::DIRECT_3D);
- scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
- new TestSharedBitmapManager());
+ TestSharedBitmapManager shared_bitmap_manager;
+ TestTaskGraphRunner task_graph_runner;
MockContentLayerClient client;
scoped_refptr<FakePictureLayer> layer =
@@ -133,8 +142,9 @@ TEST(PictureLayerTest, NonMonotonicSourceFrameNumber) {
LayerTreeHost::InitParams params;
params.client = &host_client1;
- params.shared_bitmap_manager = shared_bitmap_manager.get();
+ params.shared_bitmap_manager = &shared_bitmap_manager;
params.settings = &settings;
+ params.task_graph_runner = &task_graph_runner;
params.main_task_runner = base::ThreadTaskRunnerHandle::Get();
scoped_ptr<LayerTreeHost> host1 =
LayerTreeHost::CreateSingleThreaded(&host_client1, &params);
diff --git a/cc/layers/render_surface_unittest.cc b/cc/layers/render_surface_unittest.cc
index 929407c..96f8532 100644
--- a/cc/layers/render_surface_unittest.cc
+++ b/cc/layers/render_surface_unittest.cc
@@ -13,6 +13,7 @@
#include "cc/test/geometry_test_utils.h"
#include "cc/test/mock_occlusion_tracker.h"
#include "cc/test/test_shared_bitmap_manager.h"
+#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/single_thread_proxy.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -38,7 +39,9 @@ TEST(RenderSurfaceTest, VerifySurfaceChangesAreTrackedProperly) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
scoped_ptr<LayerImpl> owning_layer =
LayerImpl::Create(host_impl.active_tree(), 1);
owning_layer->SetHasRenderSurface(true);
@@ -83,7 +86,9 @@ TEST(RenderSurfaceTest, VerifySurfaceChangesAreTrackedProperly) {
TEST(RenderSurfaceTest, SanityCheckSurfaceCreatesCorrectSharedQuadState) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
scoped_ptr<LayerImpl> root_layer =
LayerImpl::Create(host_impl.active_tree(), 1);
@@ -147,7 +152,9 @@ class TestRenderPassSink : public RenderPassSink {
TEST(RenderSurfaceTest, SanityCheckSurfaceCreatesCorrectRenderPass) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
scoped_ptr<LayerImpl> root_layer =
LayerImpl::Create(host_impl.active_tree(), 1);
diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc
index af7a100..dc432cc 100644
--- a/cc/layers/scrollbar_layer_unittest.cc
+++ b/cc/layers/scrollbar_layer_unittest.cc
@@ -121,10 +121,13 @@ class ScrollbarLayerTest : public testing::Test {
public:
ScrollbarLayerTest() : fake_client_(FakeLayerTreeHostClient::DIRECT_3D) {
layer_tree_settings_.single_thread_proxy_scheduler = false;
+ layer_tree_settings_.use_zero_copy = true;
+ layer_tree_settings_.use_one_copy = false;
LayerTreeHost::InitParams params;
params.client = &fake_client_;
params.settings = &layer_tree_settings_;
+ params.task_graph_runner = &task_graph_runner_;
layer_tree_host_.reset(
new FakeResourceTrackingLayerTreeHost(&fake_client_, &params));
@@ -138,6 +141,7 @@ class ScrollbarLayerTest : public testing::Test {
protected:
FakeLayerTreeHostClient fake_client_;
+ TestTaskGraphRunner task_graph_runner_;
LayerTreeSettings layer_tree_settings_;
LayerSettings layer_settings_;
scoped_ptr<FakeResourceTrackingLayerTreeHost> layer_tree_host_;
diff --git a/cc/layers/solid_color_layer_impl_unittest.cc b/cc/layers/solid_color_layer_impl_unittest.cc
index 9cfd2ef..8d32780 100644
--- a/cc/layers/solid_color_layer_impl_unittest.cc
+++ b/cc/layers/solid_color_layer_impl_unittest.cc
@@ -12,7 +12,7 @@
#include "cc/test/fake_impl_proxy.h"
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/layer_test_common.h"
-#include "cc/test/test_shared_bitmap_manager.h"
+#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/single_thread_proxy.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -27,8 +27,8 @@ TEST(SolidColorLayerImplTest, VerifyTilingCompleteAndNoOverlap) {
gfx::Rect visible_content_rect = gfx::Rect(layer_size);
FakeImplProxy proxy;
- TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, nullptr, &task_graph_runner);
scoped_ptr<SolidColorLayerImpl> layer =
SolidColorLayerImpl::Create(host_impl.active_tree(), 1);
layer->draw_properties().visible_content_rect = visible_content_rect;
@@ -53,8 +53,8 @@ TEST(SolidColorLayerImplTest, VerifyCorrectBackgroundColorInQuad) {
gfx::Rect visible_content_rect = gfx::Rect(layer_size);
FakeImplProxy proxy;
- TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, nullptr, &task_graph_runner);
scoped_ptr<SolidColorLayerImpl> layer =
SolidColorLayerImpl::Create(host_impl.active_tree(), 1);
layer->draw_properties().visible_content_rect = visible_content_rect;
@@ -82,8 +82,8 @@ TEST(SolidColorLayerImplTest, VerifyCorrectOpacityInQuad) {
gfx::Rect visible_content_rect = gfx::Rect(layer_size);
FakeImplProxy proxy;
- TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, nullptr, &task_graph_runner);
scoped_ptr<SolidColorLayerImpl> layer =
SolidColorLayerImpl::Create(host_impl.active_tree(), 1);
layer->draw_properties().visible_content_rect = visible_content_rect;
@@ -111,8 +111,8 @@ TEST(SolidColorLayerImplTest, VerifyCorrectBlendModeInQuad) {
gfx::Rect visible_content_rect = gfx::Rect(layer_size);
FakeImplProxy proxy;
- TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, nullptr, &task_graph_runner);
scoped_ptr<SolidColorLayerImpl> layer =
SolidColorLayerImpl::Create(host_impl.active_tree(), 1);
layer->SetBounds(layer_size);
@@ -142,7 +142,9 @@ TEST(SolidColorLayerImplTest, VerifyOpaqueRect) {
root->AddChild(layer);
FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D);
- scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&client);
+ TestTaskGraphRunner task_graph_runner;
+ scoped_ptr<FakeLayerTreeHost> host =
+ FakeLayerTreeHost::Create(&client, &task_graph_runner);
host->SetRootLayer(root);
RenderSurfaceLayerList render_surface_layer_list;
diff --git a/cc/layers/surface_layer_unittest.cc b/cc/layers/surface_layer_unittest.cc
index 74fa2dd..eac14a0 100644
--- a/cc/layers/surface_layer_unittest.cc
+++ b/cc/layers/surface_layer_unittest.cc
@@ -16,7 +16,7 @@
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/fake_output_surface.h"
#include "cc/test/layer_tree_test.h"
-#include "cc/test/test_shared_bitmap_manager.h"
+#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/layer_tree_host.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -32,7 +32,8 @@ class SurfaceLayerTest : public testing::Test {
protected:
void SetUp() override {
- layer_tree_host_ = FakeLayerTreeHost::Create(&fake_client_);
+ layer_tree_host_ =
+ FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_);
layer_tree_host_->SetViewportSize(gfx::Size(10, 10));
}
@@ -43,9 +44,9 @@ class SurfaceLayerTest : public testing::Test {
}
}
- scoped_ptr<FakeLayerTreeHost> layer_tree_host_;
FakeLayerTreeHostClient fake_client_;
- TestSharedBitmapManager shared_bitmap_manager_;
+ TestTaskGraphRunner task_graph_runner_;
+ scoped_ptr<FakeLayerTreeHost> layer_tree_host_;
LayerSettings layer_settings_;
};
@@ -76,7 +77,7 @@ TEST_F(SurfaceLayerTest, MultipleFramesOneSurface) {
layer_tree_host_->SetRootLayer(layer);
scoped_ptr<FakeLayerTreeHost> layer_tree_host2 =
- FakeLayerTreeHost::Create(&fake_client_);
+ FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_);
scoped_refptr<SurfaceLayer> layer2(SurfaceLayer::Create(
layer_settings_, base::Bind(&SatisfyCallback, &blank_change),
base::Bind(&RequireCallback, &required_id, &required_seq)));
diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc
index c3c6fd5..60228d3 100644
--- a/cc/layers/texture_layer_unittest.cc
+++ b/cc/layers/texture_layer_unittest.cc
@@ -54,9 +54,12 @@ gpu::Mailbox MailboxFromChar(char value) {
class MockLayerTreeHost : public LayerTreeHost {
public:
- static scoped_ptr<MockLayerTreeHost> Create(FakeLayerTreeHostClient* client) {
+ static scoped_ptr<MockLayerTreeHost> Create(
+ FakeLayerTreeHostClient* client,
+ TaskGraphRunner* task_graph_runner) {
LayerTreeHost::InitParams params;
params.client = client;
+ params.task_graph_runner = task_graph_runner;
LayerTreeSettings settings;
params.settings = &settings;
return make_scoped_ptr(new MockLayerTreeHost(client, &params));
@@ -190,7 +193,8 @@ class TextureLayerTest : public testing::Test {
protected:
void SetUp() override {
- layer_tree_host_ = MockLayerTreeHost::Create(&fake_client_);
+ layer_tree_host_ =
+ MockLayerTreeHost::Create(&fake_client_, &task_graph_runner_);
EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(AnyNumber());
layer_tree_host_->SetViewportSize(gfx::Size(10, 10));
Mock::VerifyAndClearExpectations(layer_tree_host_.get());
@@ -919,7 +923,8 @@ class TextureLayerImplWithMailboxTest : public TextureLayerTest {
void SetUp() override {
TextureLayerTest::SetUp();
- layer_tree_host_ = MockLayerTreeHost::Create(&fake_client_);
+ layer_tree_host_ =
+ MockLayerTreeHost::Create(&fake_client_, &task_graph_runner_);
EXPECT_TRUE(host_impl_.InitializeRenderer(FakeOutputSurface::Create3d()));
}
diff --git a/cc/layers/tiled_layer_unittest.cc b/cc/layers/tiled_layer_unittest.cc
index cce9812..7c60927 100644
--- a/cc/layers/tiled_layer_unittest.cc
+++ b/cc/layers/tiled_layer_unittest.cc
@@ -77,10 +77,9 @@ class TiledLayerTest : public testing::Test {
void SetUp() override {
impl_thread_.Start();
- shared_bitmap_manager_.reset(new TestSharedBitmapManager());
LayerTreeHost::InitParams params;
params.client = &synchronous_output_surface_client_;
- params.shared_bitmap_manager = shared_bitmap_manager_.get();
+ params.shared_bitmap_manager = &shared_bitmap_manager_;
params.settings = &settings_;
params.main_task_runner = base::ThreadTaskRunnerHandle::Get();
@@ -98,10 +97,10 @@ class TiledLayerTest : public testing::Test {
DebugScopedSetImplThreadAndMainThreadBlocked
impl_thread_and_main_thread_blocked(proxy_);
- resource_provider_ = FakeResourceProvider::Create(
- output_surface_.get(), shared_bitmap_manager_.get());
+ resource_provider_ = FakeResourceProvider::Create(output_surface_.get(),
+ &shared_bitmap_manager_);
host_impl_ = make_scoped_ptr(new FakeLayerTreeHostImpl(
- proxy_, shared_bitmap_manager_.get(), nullptr));
+ settings_, proxy_, &shared_bitmap_manager_, nullptr));
}
~TiledLayerTest() override {
@@ -217,8 +216,8 @@ class TiledLayerTest : public testing::Test {
LayerTreeSettings settings_;
LayerSettings layer_settings_;
FakeOutputSurfaceClient output_surface_client_;
+ TestSharedBitmapManager shared_bitmap_manager_;
scoped_ptr<OutputSurface> output_surface_;
- scoped_ptr<SharedBitmapManager> shared_bitmap_manager_;
scoped_ptr<ResourceProvider> resource_provider_;
scoped_ptr<ResourceUpdateQueue> queue_;
PriorityCalculator priority_calculator_;
diff --git a/cc/layers/ui_resource_layer_impl_unittest.cc b/cc/layers/ui_resource_layer_impl_unittest.cc
index b725e6d..c093a86 100644
--- a/cc/layers/ui_resource_layer_impl_unittest.cc
+++ b/cc/layers/ui_resource_layer_impl_unittest.cc
@@ -13,6 +13,7 @@
#include "cc/test/fake_ui_resource_layer_tree_host_impl.h"
#include "cc/test/layer_test_common.h"
#include "cc/test/test_shared_bitmap_manager.h"
+#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/single_thread_proxy.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -59,7 +60,9 @@ void QuadSizeTest(scoped_ptr<UIResourceLayerImpl> layer,
TEST(UIResourceLayerImplTest, VerifyDrawQuads) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeUIResourceLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ TestTaskGraphRunner task_graph_runner;
+ FakeUIResourceLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
host_impl.InitializeRenderer(FakeOutputSurface::Create3d());
// Make sure we're appending quads when there are valid values.
@@ -103,7 +106,9 @@ void OpaqueBoundsTest(scoped_ptr<UIResourceLayerImpl> layer,
TEST(UIResourceLayerImplTest, VerifySetOpaqueOnSkBitmap) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeUIResourceLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ TestTaskGraphRunner task_graph_runner;
+ FakeUIResourceLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
host_impl.InitializeRenderer(FakeOutputSurface::Create3d());
gfx::Size bitmap_size(100, 100);
@@ -131,7 +136,9 @@ TEST(UIResourceLayerImplTest, VerifySetOpaqueOnSkBitmap) {
TEST(UIResourceLayerImplTest, VerifySetOpaqueOnLayer) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeUIResourceLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
+ TestTaskGraphRunner task_graph_runner;
+ FakeUIResourceLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
host_impl.InitializeRenderer(FakeOutputSurface::Create3d());
gfx::Size bitmap_size(100, 100);
diff --git a/cc/layers/ui_resource_layer_unittest.cc b/cc/layers/ui_resource_layer_unittest.cc
index 512c677..d650687 100644
--- a/cc/layers/ui_resource_layer_unittest.cc
+++ b/cc/layers/ui_resource_layer_unittest.cc
@@ -14,6 +14,7 @@
#include "cc/test/fake_output_surface.h"
#include "cc/test/fake_output_surface_client.h"
#include "cc/test/geometry_test_utils.h"
+#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/single_thread_proxy.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -55,7 +56,8 @@ class UIResourceLayerTest : public testing::Test {
protected:
void SetUp() override {
- layer_tree_host_ = FakeLayerTreeHost::Create(&fake_client_);
+ layer_tree_host_ =
+ FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_);
layer_tree_host_->InitializeSingleThreaded(
&fake_client_, base::ThreadTaskRunnerHandle::Get(), nullptr);
}
@@ -65,6 +67,7 @@ class UIResourceLayerTest : public testing::Test {
}
FakeLayerTreeHostClient fake_client_;
+ TestTaskGraphRunner task_graph_runner_;
scoped_ptr<FakeLayerTreeHost> layer_tree_host_;
LayerSettings layer_settings_;
};
diff --git a/cc/test/fake_layer_tree_host.cc b/cc/test/fake_layer_tree_host.cc
index 97e7aef..09f2fc9 100644
--- a/cc/test/fake_layer_tree_host.cc
+++ b/cc/test/fake_layer_tree_host.cc
@@ -4,28 +4,36 @@
#include "cc/test/fake_layer_tree_host.h"
+#include "cc/test/test_task_graph_runner.h"
+
namespace cc {
FakeLayerTreeHost::FakeLayerTreeHost(FakeLayerTreeHostClient* client,
LayerTreeHost::InitParams* params)
: LayerTreeHost(params),
client_(client),
- host_impl_(*params->settings, &proxy_, &manager_, nullptr),
+ host_impl_(*params->settings,
+ &proxy_,
+ &manager_,
+ params->task_graph_runner),
needs_commit_(false) {
client_->SetLayerTreeHost(this);
}
scoped_ptr<FakeLayerTreeHost> FakeLayerTreeHost::Create(
- FakeLayerTreeHostClient* client) {
+ FakeLayerTreeHostClient* client,
+ TestTaskGraphRunner* task_graph_runner) {
LayerTreeSettings settings;
- return Create(client, settings);
+ return Create(client, task_graph_runner, settings);
}
scoped_ptr<FakeLayerTreeHost> FakeLayerTreeHost::Create(
FakeLayerTreeHostClient* client,
+ TestTaskGraphRunner* task_graph_runner,
const LayerTreeSettings& settings) {
LayerTreeHost::InitParams params;
params.client = client;
params.settings = &settings;
+ params.task_graph_runner = task_graph_runner;
return make_scoped_ptr(new FakeLayerTreeHost(client, &params));
}
diff --git a/cc/test/fake_layer_tree_host.h b/cc/test/fake_layer_tree_host.h
index f44f840..f1dbb63 100644
--- a/cc/test/fake_layer_tree_host.h
+++ b/cc/test/fake_layer_tree_host.h
@@ -15,12 +15,16 @@
#include "cc/trees/tree_synchronizer.h"
namespace cc {
+class TestTaskGraphRunner;
class FakeLayerTreeHost : public LayerTreeHost {
public:
- static scoped_ptr<FakeLayerTreeHost> Create(FakeLayerTreeHostClient* client);
static scoped_ptr<FakeLayerTreeHost> Create(
FakeLayerTreeHostClient* client,
+ TestTaskGraphRunner* task_graph_runner);
+ static scoped_ptr<FakeLayerTreeHost> Create(
+ FakeLayerTreeHostClient* client,
+ TestTaskGraphRunner* task_graph_runner,
const LayerTreeSettings& settings);
~FakeLayerTreeHost() override;
diff --git a/cc/test/fake_ui_resource_layer_tree_host_impl.cc b/cc/test/fake_ui_resource_layer_tree_host_impl.cc
index e48ef38..d61ad7c 100644
--- a/cc/test/fake_ui_resource_layer_tree_host_impl.cc
+++ b/cc/test/fake_ui_resource_layer_tree_host_impl.cc
@@ -11,8 +11,9 @@ namespace cc {
FakeUIResourceLayerTreeHostImpl::FakeUIResourceLayerTreeHostImpl(
Proxy* proxy,
- SharedBitmapManager* manager)
- : FakeLayerTreeHostImpl(proxy, manager, nullptr) {
+ SharedBitmapManager* manager,
+ TaskGraphRunner* task_graph_runner)
+ : FakeLayerTreeHostImpl(proxy, manager, task_graph_runner) {
}
FakeUIResourceLayerTreeHostImpl::~FakeUIResourceLayerTreeHostImpl() {}
diff --git a/cc/test/fake_ui_resource_layer_tree_host_impl.h b/cc/test/fake_ui_resource_layer_tree_host_impl.h
index 19746a1..ae12eaf 100644
--- a/cc/test/fake_ui_resource_layer_tree_host_impl.h
+++ b/cc/test/fake_ui_resource_layer_tree_host_impl.h
@@ -9,11 +9,13 @@
#include "cc/test/fake_layer_tree_host_impl.h"
namespace cc {
+class TaskGraphRunner;
class FakeUIResourceLayerTreeHostImpl : public FakeLayerTreeHostImpl {
public:
explicit FakeUIResourceLayerTreeHostImpl(Proxy* proxy,
- SharedBitmapManager* manager);
+ SharedBitmapManager* manager,
+ TaskGraphRunner* task_graph_runner);
~FakeUIResourceLayerTreeHostImpl() override;
void CreateUIResource(UIResourceId uid,
diff --git a/cc/test/layer_test_common.cc b/cc/test/layer_test_common.cc
index 8ae9aef..2bedaf8 100644
--- a/cc/test/layer_test_common.cc
+++ b/cc/test/layer_test_common.cc
@@ -113,7 +113,7 @@ void LayerTestCommon::VerifyQuadsAreOccluded(const QuadList& quads,
LayerTestCommon::LayerImplTest::LayerImplTest()
: client_(FakeLayerTreeHostClient::DIRECT_3D),
- host_(FakeLayerTreeHost::Create(&client_)),
+ host_(FakeLayerTreeHost::Create(&client_, &task_graph_runner_)),
root_layer_impl_(LayerImpl::Create(host_->host_impl()->active_tree(), 1)),
render_pass_(RenderPass::Create()) {
root_layer_impl_->SetHasRenderSurface(true);
diff --git a/cc/test/layer_test_common.h b/cc/test/layer_test_common.h
index dfd9729..9815e80 100644
--- a/cc/test/layer_test_common.h
+++ b/cc/test/layer_test_common.h
@@ -9,6 +9,7 @@
#include "base/memory/scoped_ptr.h"
#include "cc/quads/render_pass.h"
#include "cc/test/fake_layer_tree_host.h"
+#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/layer_tree_host_impl.h"
#define EXPECT_SET_NEEDS_COMMIT(expect, code_to_test) \
@@ -124,6 +125,7 @@ class LayerTestCommon {
private:
FakeLayerTreeHostClient client_;
+ TestTaskGraphRunner task_graph_runner_;
scoped_ptr<FakeLayerTreeHost> host_;
scoped_ptr<LayerImpl> root_layer_impl_;
scoped_ptr<RenderPass> render_pass_;
diff --git a/cc/test/layer_tree_host_common_test.cc b/cc/test/layer_tree_host_common_test.cc
index e91f169..918e7c3 100644
--- a/cc/test/layer_tree_host_common_test.cc
+++ b/cc/test/layer_tree_host_common_test.cc
@@ -160,7 +160,7 @@ void LayerTreeHostCommonTestBase::ExecuteCalculateDrawProperties(
scoped_ptr<FakeLayerTreeHost>
LayerTreeHostCommonTestBase::CreateFakeLayerTreeHost() {
- return FakeLayerTreeHost::Create(&client_);
+ return FakeLayerTreeHost::Create(&client_, &task_graph_runner_);
}
} // namespace cc
diff --git a/cc/test/layer_tree_host_common_test.h b/cc/test/layer_tree_host_common_test.h
index ec77434..f1181cb 100644
--- a/cc/test/layer_tree_host_common_test.h
+++ b/cc/test/layer_tree_host_common_test.h
@@ -10,6 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "cc/layers/layer_lists.h"
#include "cc/test/fake_layer_tree_host_client.h"
+#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/layer_tree_settings.h"
#include "cc/trees/property_tree.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -131,6 +132,7 @@ class LayerTreeHostCommonTestBase {
LayerSettings layer_settings_;
FakeLayerTreeHostClient client_;
+ TestTaskGraphRunner task_graph_runner_;
int render_surface_layer_list_count_;
};
diff --git a/cc/test/layer_tree_json_parser_unittest.cc b/cc/test/layer_tree_json_parser_unittest.cc
index 8286a0f..73aace8 100644
--- a/cc/test/layer_tree_json_parser_unittest.cc
+++ b/cc/test/layer_tree_json_parser_unittest.cc
@@ -9,6 +9,7 @@
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/geometry_test_utils.h"
+#include "cc/test/test_task_graph_runner.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
@@ -65,7 +66,9 @@ class LayerTreeJsonParserSanityCheck : public testing::Test {
TEST_F(LayerTreeJsonParserSanityCheck, Basic) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
LayerTreeImpl* tree = host_impl.active_tree();
scoped_ptr<LayerImpl> root_impl(LayerImpl::Create(tree, 1));
@@ -94,7 +97,9 @@ TEST_F(LayerTreeJsonParserSanityCheck, Basic) {
TEST_F(LayerTreeJsonParserSanityCheck, EventHandlerRegions) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
LayerTreeImpl* tree = host_impl.active_tree();
scoped_ptr<LayerImpl> root_impl(LayerImpl::Create(tree, 1));
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 9d1c366..31bd7f3 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -121,6 +121,7 @@ LayerTreeHost::LayerTreeHost(InitParams* params)
task_graph_runner_(params->task_graph_runner),
surface_id_namespace_(0u),
next_surface_sequence_(1u) {
+ DCHECK_IMPLIES(settings_.impl_side_painting, task_graph_runner_);
if (settings_.accelerated_animation_enabled)
animation_registrar_ = AnimationRegistrar::Create();
rendering_stats_instrumentation_->set_record_rendering_stats(
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index 96810bc..7f4e762 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -321,7 +321,9 @@ TEST_F(LayerTreeHostCommonTest, TransformsAboutScrollOffset) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
gfx::Transform identity_matrix;
scoped_ptr<LayerImpl> sublayer_scoped_ptr(
@@ -5824,7 +5826,9 @@ TEST_F(LayerTreeHostCommonTest, TransparentChildRenderSurfaceCreation) {
TEST_F(LayerTreeHostCommonTest, OpacityAnimatingOnPendingTree) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
host_impl.CreatePendingTree();
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.pending_tree(), 1);
@@ -6075,7 +6079,9 @@ INSTANTIATE_TEST_CASE_P(LayerTreeHostCommonTest,
TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayer) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
host_impl.CreatePendingTree();
const gfx::Transform identity_matrix;
@@ -6133,7 +6139,9 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayer) {
TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayerImpl) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
host_impl.CreatePendingTree();
const gfx::Transform identity_matrix;
@@ -6178,7 +6186,9 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_SingleLayerImpl) {
TEST_F(LayerTreeHostCommonTest, SubtreeHidden_TwoLayers) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
host_impl.CreatePendingTree();
const gfx::Transform identity_matrix;
@@ -6235,7 +6245,9 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHidden_TwoLayers) {
TEST_F(LayerTreeHostCommonTest, SubtreeHidden_TwoLayersImpl) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
host_impl.CreatePendingTree();
const gfx::Transform identity_matrix;
@@ -6280,7 +6292,9 @@ void EmptyCopyOutputCallback(scoped_ptr<CopyOutputResult> result) {}
TEST_F(LayerTreeHostCommonTest, SubtreeHiddenWithCopyRequest) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
host_impl.CreatePendingTree();
const gfx::Transform identity_matrix;
@@ -6429,7 +6443,9 @@ TEST_F(LayerTreeHostCommonTest, SubtreeHiddenWithCopyRequest) {
TEST_F(LayerTreeHostCommonTest, ClippedOutCopyRequest) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
host_impl.CreatePendingTree();
const gfx::Transform identity_matrix;
@@ -6504,7 +6520,9 @@ TEST_F(LayerTreeHostCommonTest, ClippedOutCopyRequest) {
TEST_F(LayerTreeHostCommonTest, VisibleContentRectInsideSurface) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
host_impl.CreatePendingTree();
const gfx::Transform identity_matrix;
@@ -7115,7 +7133,9 @@ TEST_F(LayerTreeHostCommonTest,
TEST_F(LayerTreeHostCommonTest, CanRenderToSeparateSurface) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
scoped_ptr<LayerImpl> root =
LayerImpl::Create(host_impl.active_tree(), 12345);
scoped_ptr<LayerImpl> child1 =
@@ -7857,7 +7877,9 @@ TEST_F(LayerTreeHostCommonTest, ScrollCompensationWithRounding) {
//
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
host_impl.CreatePendingTree();
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1);
scoped_ptr<LayerImpl> container =
@@ -8001,7 +8023,9 @@ TEST_F(LayerTreeHostCommonTest,
//
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
host_impl.CreatePendingTree();
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1);
scoped_ptr<LayerImpl> container =
@@ -8095,7 +8119,9 @@ class AnimationScaleFactorTrackingLayerImpl : public LayerImpl {
TEST_F(LayerTreeHostCommonTest, MaximumAnimationScaleFactor) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
gfx::Transform identity_matrix;
scoped_ptr<AnimationScaleFactorTrackingLayerImpl> grand_parent =
AnimationScaleFactorTrackingLayerImpl::Create(host_impl.active_tree(), 1);
@@ -8316,7 +8342,9 @@ static void GatherDrawnLayers(LayerImplList* rsll,
TEST_F(LayerTreeHostCommonTest, RenderSurfaceLayerListMembership) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
gfx::Transform identity_matrix;
scoped_ptr<LayerImpl> grand_parent =
@@ -8559,7 +8587,9 @@ TEST_F(LayerTreeHostCommonTest, RenderSurfaceLayerListMembership) {
TEST_F(LayerTreeHostCommonTest, DrawPropertyScales) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1);
LayerImpl* root_layer = root.get();
@@ -8815,7 +8845,9 @@ TEST_F(LayerTreeHostCommonTest, VisibleContentRectInChildRenderSurface) {
clip->AddChild(content);
FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D);
- scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&client);
+ TestTaskGraphRunner task_graph_runner;
+ scoped_ptr<FakeLayerTreeHost> host =
+ FakeLayerTreeHost::Create(&client, &task_graph_runner);
host->SetRootLayer(root);
gfx::Size device_viewport_size(768, 582);
@@ -8839,7 +8871,9 @@ TEST_F(LayerTreeHostCommonTest, VisibleContentRectInChildRenderSurface) {
TEST_F(LayerTreeHostCommonTest, BoundsDeltaAffectVisibleContentRect) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
// Set two layers: the root layer clips it's child,
// the child draws its content.
@@ -9447,7 +9481,9 @@ TEST_F(LayerTreeHostCommonTest, SkippingSubtreeMain) {
TEST_F(LayerTreeHostCommonTest, SkippingSubtreeImpl) {
FakeImplProxy proxy;
TestSharedBitmapManager shared_bitmap_manager;
- FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+ TestTaskGraphRunner task_graph_runner;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
+ &task_graph_runner);
gfx::Transform identity;
scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1);
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index c92cb44..f29f3da 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -233,6 +233,9 @@ LayerTreeHostImpl::LayerTreeHostImpl(
is_likely_to_require_a_draw_(false),
frame_timing_tracker_(FrameTimingTracker::Create(this)) {
DCHECK(proxy_->IsImplThread());
+ DCHECK_IMPLIES(settings.impl_side_painting, task_graph_runner_);
+ DCHECK_IMPLIES(settings.use_one_copy, !settings.use_zero_copy);
+ DCHECK_IMPLIES(settings.use_zero_copy, !settings.use_one_copy);
DidVisibilityChange(this, visible_);
animation_registrar_->set_supports_scroll_animations(
proxy_->SupportsImplScrolling());
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 2a7cbe3..72c88e4 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -87,9 +87,6 @@ class LayerTreeHostImplTest : public testing::Test,
base::ThreadTaskRunnerHandle::Get()),
always_impl_thread_(&proxy_),
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),
@@ -179,8 +176,8 @@ class LayerTreeHostImplTest : public testing::Test,
scoped_ptr<OutputSurface> output_surface) {
host_impl_ = LayerTreeHostImpl::Create(
settings, this, &proxy_, &stats_instrumentation_,
- shared_bitmap_manager_.get(), gpu_memory_buffer_manager_.get(),
- task_graph_runner_.get(), 0);
+ &shared_bitmap_manager_, &gpu_memory_buffer_manager_,
+ &task_graph_runner_, 0);
bool init = host_impl_->InitializeRenderer(output_surface.Pass());
host_impl_->SetViewportSize(gfx::Size(10, 10));
// Set the BeginFrameArgs so that methods which use it are able to.
@@ -424,9 +421,9 @@ class LayerTreeHostImplTest : public testing::Test,
DebugScopedSetImplThread always_impl_thread_;
DebugScopedSetMainThreadBlocked always_main_thread_blocked_;
- scoped_ptr<TestSharedBitmapManager> shared_bitmap_manager_;
- scoped_ptr<TestGpuMemoryBufferManager> gpu_memory_buffer_manager_;
- scoped_ptr<TestTaskGraphRunner> task_graph_runner_;
+ TestSharedBitmapManager shared_bitmap_manager_;
+ TestGpuMemoryBufferManager gpu_memory_buffer_manager_;
+ TestTaskGraphRunner task_graph_runner_;
scoped_ptr<LayerTreeHostImpl> host_impl_;
FakeRenderingStatsInstrumentation stats_instrumentation_;
bool on_can_draw_state_changed_called_;
@@ -1764,14 +1761,15 @@ class LayerTreeHostImplOverridePhysicalTime : public LayerTreeHostImpl {
LayerTreeHostImplClient* client,
Proxy* proxy,
SharedBitmapManager* manager,
+ TaskGraphRunner* task_graph_runner,
RenderingStatsInstrumentation* rendering_stats_instrumentation)
: LayerTreeHostImpl(settings,
client,
proxy,
rendering_stats_instrumentation,
manager,
- NULL,
- NULL,
+ nullptr,
+ task_graph_runner,
0) {}
BeginFrameArgs CurrentBeginFrameArgs() const override {
@@ -1794,9 +1792,9 @@ class LayerTreeHostImplTestScrollbarAnimation : public LayerTreeHostImplTest {
gfx::Size content_size(100, 100);
LayerTreeHostImplOverridePhysicalTime* host_impl_override_time =
- new LayerTreeHostImplOverridePhysicalTime(settings, this, &proxy_,
- shared_bitmap_manager_.get(),
- &stats_instrumentation_);
+ new LayerTreeHostImplOverridePhysicalTime(
+ settings, this, &proxy_, &shared_bitmap_manager_,
+ &task_graph_runner_, &stats_instrumentation_);
host_impl_ = make_scoped_ptr(host_impl_override_time);
host_impl_->InitializeRenderer(CreateOutputSurface());
host_impl_->SetViewportSize(viewport_size);
@@ -5257,7 +5255,7 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) {
scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl =
LayerTreeHostImpl::Create(
settings, this, &proxy_, &stats_instrumentation_,
- shared_bitmap_manager_.get(), NULL, task_graph_runner_.get(), 0);
+ &shared_bitmap_manager_, NULL, &task_graph_runner_, 0);
layer_tree_host_impl->InitializeRenderer(output_surface.Pass());
layer_tree_host_impl->WillBeginImplFrame(
CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
@@ -5537,6 +5535,7 @@ static scoped_ptr<LayerTreeHostImpl> SetupLayersForOpacity(
LayerTreeHostImplClient* client,
Proxy* proxy,
SharedBitmapManager* manager,
+ TaskGraphRunner* task_graph_runner,
RenderingStatsInstrumentation* stats_instrumentation) {
scoped_refptr<TestContextProvider> provider(TestContextProvider::Create());
scoped_ptr<OutputSurface> output_surface(
@@ -5546,8 +5545,9 @@ 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, NULL, 0);
+ scoped_ptr<LayerTreeHostImpl> my_host_impl =
+ LayerTreeHostImpl::Create(settings, client, proxy, stats_instrumentation,
+ manager, nullptr, task_graph_runner, 0);
my_host_impl->InitializeRenderer(output_surface.Pass());
my_host_impl->WillBeginImplFrame(
CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
@@ -5612,14 +5612,11 @@ static scoped_ptr<LayerTreeHostImpl> SetupLayersForOpacity(
}
TEST_F(LayerTreeHostImplTest, ContributingLayerEmptyScissorPartialSwap) {
- scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
- new TestSharedBitmapManager());
+ TestSharedBitmapManager shared_bitmap_manager;
+ TestTaskGraphRunner task_graph_runner;
scoped_ptr<LayerTreeHostImpl> my_host_impl =
- SetupLayersForOpacity(true,
- this,
- &proxy_,
- shared_bitmap_manager.get(),
- &stats_instrumentation_);
+ SetupLayersForOpacity(true, this, &proxy_, &shared_bitmap_manager,
+ &task_graph_runner, &stats_instrumentation_);
{
LayerTreeHostImpl::FrameData frame;
EXPECT_EQ(DRAW_SUCCESS, my_host_impl->PrepareToDraw(&frame));
@@ -5639,14 +5636,11 @@ TEST_F(LayerTreeHostImplTest, ContributingLayerEmptyScissorPartialSwap) {
}
TEST_F(LayerTreeHostImplTest, ContributingLayerEmptyScissorNoPartialSwap) {
- scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
- new TestSharedBitmapManager());
+ TestSharedBitmapManager shared_bitmap_manager;
+ TestTaskGraphRunner task_graph_runner;
scoped_ptr<LayerTreeHostImpl> my_host_impl =
- SetupLayersForOpacity(false,
- this,
- &proxy_,
- shared_bitmap_manager.get(),
- &stats_instrumentation_);
+ SetupLayersForOpacity(false, this, &proxy_, &shared_bitmap_manager,
+ &task_graph_runner, &stats_instrumentation_);
{
LayerTreeHostImpl::FrameData frame;
EXPECT_EQ(DRAW_SUCCESS, my_host_impl->PrepareToDraw(&frame));
@@ -6101,9 +6095,8 @@ TEST_F(LayerTreeHostImplTest,
TEST_F(LayerTreeHostImplTest, DefaultMemoryAllocation) {
LayerTreeSettings settings;
host_impl_ = LayerTreeHostImpl::Create(
- settings, this, &proxy_, &stats_instrumentation_,
- shared_bitmap_manager_.get(), gpu_memory_buffer_manager_.get(),
- task_graph_runner_.get(), 0);
+ settings, this, &proxy_, &stats_instrumentation_, &shared_bitmap_manager_,
+ &gpu_memory_buffer_manager_, &task_graph_runner_, 0);
scoped_ptr<OutputSurface> output_surface(
FakeOutputSurface::Create3d(TestWebGraphicsContext3D::Create()));
@@ -6212,9 +6205,8 @@ class LayerTreeHostImplTestPrepareTiles : public LayerTreeHostImplTest {
LayerTreeSettings settings;
settings.impl_side_painting = true;
- fake_host_impl_ = new FakeLayerTreeHostImpl(settings, &proxy_,
- shared_bitmap_manager_.get(),
- task_graph_runner_.get());
+ fake_host_impl_ = new FakeLayerTreeHostImpl(
+ settings, &proxy_, &shared_bitmap_manager_, &task_graph_runner_);
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_pixeltest_synchronous.cc b/cc/trees/layer_tree_host_pixeltest_synchronous.cc
index f61703f..a5286a2 100644
--- a/cc/trees/layer_tree_host_pixeltest_synchronous.cc
+++ b/cc/trees/layer_tree_host_pixeltest_synchronous.cc
@@ -22,6 +22,7 @@ class LayerTreeHostSynchronousPixelTest : public LayerTreePixelTest {
LayerTreePixelTest::InitializeSettings(settings);
settings->single_thread_proxy_scheduler = false;
settings->use_zero_copy = true;
+ settings->use_one_copy = false;
}
void BeginTest() override {
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 79c5f53..df35d34 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -1616,6 +1616,7 @@ class LayerTreeHostTestCompositeImmediatelyStateTransitions
void InitializeSettings(LayerTreeSettings* settings) override {
settings->single_thread_proxy_scheduler = false;
settings->use_zero_copy = true;
+ settings->use_one_copy = false;
}
void BeginTest() override {
@@ -4924,6 +4925,7 @@ class LayerTreeHostTestSynchronousCompositeSwapPromise
void InitializeSettings(LayerTreeSettings* settings) override {
settings->single_thread_proxy_scheduler = false;
settings->use_zero_copy = true;
+ settings->use_one_copy = false;
}
void BeginTest() override {
diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
index 421c8519..7e247d7 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -385,6 +385,7 @@ class MultipleCompositeDoesNotCreateOutputSurface
void InitializeSettings(LayerTreeSettings* settings) override {
settings->single_thread_proxy_scheduler = false;
settings->use_zero_copy = true;
+ settings->use_one_copy = false;
}
void RequestNewOutputSurface() override {
@@ -424,6 +425,7 @@ class FailedCreateDoesNotCreateExtraOutputSurface
void InitializeSettings(LayerTreeSettings* settings) override {
settings->single_thread_proxy_scheduler = false;
settings->use_zero_copy = true;
+ settings->use_one_copy = false;
}
void RequestNewOutputSurface() override {
@@ -477,6 +479,7 @@ class LayerTreeHostContextTestCommitAfterDelayedOutputSurface
void InitializeSettings(LayerTreeSettings* settings) override {
settings->single_thread_proxy_scheduler = false;
settings->use_zero_copy = true;
+ settings->use_one_copy = false;
}
void RequestNewOutputSurface() override {
@@ -519,6 +522,7 @@ class LayerTreeHostContextTestAvoidUnnecessaryComposite
void InitializeSettings(LayerTreeSettings* settings) override {
settings->single_thread_proxy_scheduler = false;
settings->use_zero_copy = true;
+ settings->use_one_copy = false;
}
void RequestNewOutputSurface() override {
diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc
index d1fe103..58410aa 100644
--- a/cc/trees/layer_tree_host_unittest_scroll.cc
+++ b/cc/trees/layer_tree_host_unittest_scroll.cc
@@ -19,6 +19,7 @@
#include "cc/test/geometry_test_utils.h"
#include "cc/test/layer_tree_test.h"
#include "cc/test/test_shared_bitmap_manager.h"
+#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/layer_tree_impl.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/size_conversions.h"
@@ -1138,13 +1139,14 @@ TEST(LayerTreeHostFlingTest, DidStopFlingingThread) {
impl_thread.task_runner().get(), &received_stop_flinging);
FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D);
- ASSERT_TRUE(impl_thread.task_runner().get());
- scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
- new TestSharedBitmapManager());
+ ASSERT_TRUE(impl_thread.task_runner());
+ TestSharedBitmapManager shared_bitmap_manager;
+ TestTaskGraphRunner task_graph_runner;
LayerTreeHost::InitParams params;
params.client = &client;
- params.shared_bitmap_manager = shared_bitmap_manager.get();
+ params.shared_bitmap_manager = &shared_bitmap_manager;
+ params.task_graph_runner = &task_graph_runner;
params.settings = &settings;
params.main_task_runner = base::ThreadTaskRunnerHandle::Get();
scoped_ptr<LayerTreeHost> layer_tree_host =
diff --git a/cc/trees/layer_tree_settings.cc b/cc/trees/layer_tree_settings.cc
index 5b82456..9bb1ea8 100644
--- a/cc/trees/layer_tree_settings.cc
+++ b/cc/trees/layer_tree_settings.cc
@@ -20,7 +20,7 @@ LayerSettings::~LayerSettings() {
}
LayerTreeSettings::LayerTreeSettings()
- : impl_side_painting(false),
+ : impl_side_painting(true),
single_thread_proxy_scheduler(true),
use_external_begin_frame_source(false),
main_frame_before_activation_enabled(false),
@@ -59,7 +59,7 @@ LayerTreeSettings::LayerTreeSettings()
max_unused_resource_memory_percentage(100),
max_memory_for_prepaint_percentage(100),
strict_layer_property_change_checking(false),
- use_one_copy(false),
+ use_one_copy(true),
use_zero_copy(false),
use_persistent_map_for_gpu_memory_buffers(false),
enable_elastic_overscroll(false),
diff --git a/cc/trees/occlusion_tracker_unittest.cc b/cc/trees/occlusion_tracker_unittest.cc
index fc45c1c3..6550d42 100644
--- a/cc/trees/occlusion_tracker_unittest.cc
+++ b/cc/trees/occlusion_tracker_unittest.cc
@@ -18,6 +18,7 @@
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/geometry_test_utils.h"
#include "cc/test/test_occlusion_tracker.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/gmock/include/gmock/gmock.h"
@@ -86,7 +87,7 @@ class OcclusionTrackerTest : public testing::Test {
explicit OcclusionTrackerTest(bool opaque_layers)
: opaque_layers_(opaque_layers),
client_(FakeLayerTreeHostClient::DIRECT_3D),
- host_(FakeLayerTreeHost::Create(&client_)),
+ host_(FakeLayerTreeHost::Create(&client_, &task_graph_runner_)),
next_layer_impl_id_(1) {}
virtual void RunMyTest() = 0;
@@ -314,6 +315,7 @@ class OcclusionTrackerTest : public testing::Test {
bool opaque_layers_;
FakeLayerTreeHostClient client_;
+ TestTaskGraphRunner task_graph_runner_;
scoped_ptr<FakeLayerTreeHost> host_;
// These hold ownership of the layers for the duration of the test.
scoped_ptr<LayerImpl> root_;
diff --git a/cc/trees/tree_synchronizer_unittest.cc b/cc/trees/tree_synchronizer_unittest.cc
index 6cf75ba..466a701 100644
--- a/cc/trees/tree_synchronizer_unittest.cc
+++ b/cc/trees/tree_synchronizer_unittest.cc
@@ -18,6 +18,7 @@
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/fake_rendering_stats_instrumentation.h"
#include "cc/test/test_shared_bitmap_manager.h"
+#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/proxy.h"
#include "cc/trees/single_thread_proxy.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -195,10 +196,11 @@ class TreeSynchronizerTest : public testing::Test {
public:
TreeSynchronizerTest()
: client_(FakeLayerTreeHostClient::DIRECT_3D),
- host_(FakeLayerTreeHost::Create(&client_)) {}
+ host_(FakeLayerTreeHost::Create(&client_, &task_graph_runner_)) {}
protected:
FakeLayerTreeHostClient client_;
+ TestTaskGraphRunner task_graph_runner_;
scoped_ptr<FakeLayerTreeHost> host_;
LayerSettings layer_settings_;
};
@@ -566,11 +568,11 @@ TEST_F(TreeSynchronizerTest, SynchronizeAnimations) {
FakeProxy proxy;
DebugScopedSetImplThread impl(&proxy);
FakeRenderingStatsInstrumentation stats_instrumentation;
- 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, NULL, 0);
+ TestSharedBitmapManager shared_bitmap_manager;
+ TestTaskGraphRunner task_graph_runner;
+ scoped_ptr<LayerTreeHostImpl> host_impl = LayerTreeHostImpl::Create(
+ settings, nullptr, &proxy, &stats_instrumentation, &shared_bitmap_manager,
+ nullptr, &task_graph_runner, 0);
scoped_refptr<Layer> layer_tree_root = Layer::Create(layer_settings_);
host_->SetRootLayer(layer_tree_root);
@@ -600,11 +602,11 @@ TEST_F(TreeSynchronizerTest, SynchronizeScrollParent) {
FakeProxy proxy;
DebugScopedSetImplThread impl(&proxy);
FakeRenderingStatsInstrumentation stats_instrumentation;
- 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, NULL, 0);
+ TestSharedBitmapManager shared_bitmap_manager;
+ TestTaskGraphRunner task_graph_runner;
+ scoped_ptr<LayerTreeHostImpl> host_impl = LayerTreeHostImpl::Create(
+ settings, nullptr, &proxy, &stats_instrumentation, &shared_bitmap_manager,
+ nullptr, &task_graph_runner, 0);
scoped_refptr<Layer> layer_tree_root = Layer::Create(layer_settings_);
scoped_refptr<Layer> scroll_parent = Layer::Create(layer_settings_);
@@ -668,11 +670,11 @@ TEST_F(TreeSynchronizerTest, SynchronizeClipParent) {
FakeProxy proxy;
DebugScopedSetImplThread impl(&proxy);
FakeRenderingStatsInstrumentation stats_instrumentation;
- 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, NULL, 0);
+ TestSharedBitmapManager shared_bitmap_manager;
+ TestTaskGraphRunner task_graph_runner;
+ scoped_ptr<LayerTreeHostImpl> host_impl = LayerTreeHostImpl::Create(
+ settings, nullptr, &proxy, &stats_instrumentation, &shared_bitmap_manager,
+ nullptr, &task_graph_runner, 0);
scoped_refptr<Layer> layer_tree_root = Layer::Create(layer_settings_);
scoped_refptr<Layer> clip_parent = Layer::Create(layer_settings_);
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index 77f7919..41685db 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -433,6 +433,7 @@ void CompositorImpl::CreateLayerTreeHost() {
settings.renderer_settings.highp_threshold_min = 2048;
settings.impl_side_painting = true;
settings.use_zero_copy = true;
+ settings.use_one_copy = false;
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
settings.initial_debug_state.SetRecordRenderingStats(
diff --git a/content/test/web_layer_tree_view_impl_for_testing.cc b/content/test/web_layer_tree_view_impl_for_testing.cc
index ecce63c..543806d 100644
--- a/content/test/web_layer_tree_view_impl_for_testing.cc
+++ b/content/test/web_layer_tree_view_impl_for_testing.cc
@@ -47,6 +47,7 @@ void WebLayerTreeViewImplForTesting::Initialize() {
params.client = this;
params.settings = &settings;
params.main_task_runner = base::ThreadTaskRunnerHandle::Get();
+ params.task_graph_runner = &task_graph_runner_;
layer_tree_host_ = cc::LayerTreeHost::CreateSingleThreaded(this, &params);
DCHECK(layer_tree_host_);
}
diff --git a/content/test/web_layer_tree_view_impl_for_testing.h b/content/test/web_layer_tree_view_impl_for_testing.h
index 63ac66f..bccf7cd 100644
--- a/content/test/web_layer_tree_view_impl_for_testing.h
+++ b/content/test/web_layer_tree_view_impl_for_testing.h
@@ -6,6 +6,7 @@
#define CONTENT_TEST_WEB_LAYER_TREE_VIEW_IMPL_FOR_TESTING_H_
#include "base/memory/scoped_ptr.h"
+#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/layer_tree_host_client.h"
#include "cc/trees/layer_tree_host_single_thread_client.h"
#include "third_party/WebKit/public/platform/WebLayerTreeView.h"
@@ -92,6 +93,7 @@ class WebLayerTreeViewImplForTesting
void DidAbortSwapBuffers() override {}
private:
+ cc::TestTaskGraphRunner task_graph_runner_;
scoped_ptr<cc::LayerTreeHost> layer_tree_host_;
DISALLOW_COPY_AND_ASSIGN(WebLayerTreeViewImplForTesting);