CC Animation: Erase cc::LayerSettings everywhere.
Also, erase LayerTreeSettings::use_compositor_animation_timelines flag.
BUG=575041
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1783613004
Cr-Commit-Position: refs/heads/master@{#380914}
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index 011c1a57..38006a7 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -140,8 +140,6 @@
"layers/layer_position_constraint.h",
"layers/layer_proto_converter.cc",
"layers/layer_proto_converter.h",
- "layers/layer_settings.cc",
- "layers/layer_settings.h",
"layers/layer_utils.cc",
"layers/layer_utils.h",
"layers/nine_patch_layer.cc",
@@ -647,8 +645,6 @@
"test/layer_tree_pixel_resource_test.h",
"test/layer_tree_pixel_test.cc",
"test/layer_tree_pixel_test.h",
- "test/layer_tree_settings_for_testing.cc",
- "test/layer_tree_settings_for_testing.h",
"test/layer_tree_test.cc",
"test/layer_tree_test.h",
"test/mock_helper.h",
diff --git a/cc/animation/animation_host_perftest.cc b/cc/animation/animation_host_perftest.cc
index 3e1d184..bd3cdeb 100644
--- a/cc/animation/animation_host_perftest.cc
+++ b/cc/animation/animation_host_perftest.cc
@@ -10,7 +10,6 @@
#include "cc/animation/animation_timeline.h"
#include "cc/debug/lap_timer.h"
#include "cc/layers/layer.h"
-#include "cc/layers/layer_settings.h"
#include "cc/test/fake_impl_task_runner_provider.h"
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/fake_layer_tree_host_client.h"
@@ -30,8 +29,6 @@
protected:
void SetUp() override {
LayerTreeSettings settings;
- settings.use_compositor_animation_timelines = true;
-
layer_tree_host_ =
FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_, settings);
layer_tree_host_->InitializeSingleThreaded(
@@ -43,15 +40,6 @@
layer_tree_host_ = nullptr;
}
- LayerSettings GetLayerSettings() const {
- DCHECK(layer_tree_host_);
-
- LayerSettings settings;
- settings.use_compositor_animation_timelines =
- layer_tree_host_->settings().use_compositor_animation_timelines;
- return settings;
- }
-
scoped_ptr<FakeLayerTreeHost> layer_tree_host_;
LapTimer timer_;
@@ -60,13 +48,10 @@
};
TEST_F(AnimationHostPerfTest, PushPropertiesTo) {
- if (!layer_tree_host_->settings().use_compositor_animation_timelines)
- return;
-
AnimationHost* host = layer_tree_host_->animation_host();
AnimationHost* host_impl = layer_tree_host_->host_impl()->animation_host();
- scoped_refptr<Layer> root_layer = Layer::Create(GetLayerSettings());
+ scoped_refptr<Layer> root_layer = Layer::Create();
layer_tree_host_->SetRootLayer(root_layer);
scoped_ptr<LayerImpl> root_layer_impl = LayerImpl::Create(
@@ -81,7 +66,7 @@
host_impl->AddAnimationTimeline(timeline_impl);
for (int i = 0; i < kNumberOfAnimationPlayers; ++i) {
- scoped_refptr<Layer> layer = Layer::Create(GetLayerSettings());
+ scoped_refptr<Layer> layer = Layer::Create();
root_layer->AddChild(layer);
const int layer_id = layer->id();
diff --git a/cc/blink/web_content_layer_impl.cc b/cc/blink/web_content_layer_impl.cc
index c55f2ec0..b7a855c 100644
--- a/cc/blink/web_content_layer_impl.cc
+++ b/cc/blink/web_content_layer_impl.cc
@@ -9,7 +9,6 @@
#include "base/command_line.h"
#include "cc/base/switches.h"
#include "cc/blink/web_display_item_list_impl.h"
-#include "cc/layers/layer_settings.h"
#include "cc/layers/picture_layer.h"
#include "cc/playback/display_item_list_settings.h"
#include "third_party/WebKit/public/platform/WebContentLayerClient.h"
@@ -52,8 +51,7 @@
WebContentLayerImpl::WebContentLayerImpl(blink::WebContentLayerClient* client)
: client_(client) {
- layer_ = make_scoped_ptr(
- new WebLayerImpl(PictureLayer::Create(cc::LayerSettings(), this)));
+ layer_ = make_scoped_ptr(new WebLayerImpl(PictureLayer::Create(this)));
layer_->layer()->SetIsDrawable(true);
}
diff --git a/cc/blink/web_external_texture_layer_impl.cc b/cc/blink/web_external_texture_layer_impl.cc
index c2f2a45..03f6e18f 100644
--- a/cc/blink/web_external_texture_layer_impl.cc
+++ b/cc/blink/web_external_texture_layer_impl.cc
@@ -6,7 +6,6 @@
#include "cc/blink/web_external_bitmap_impl.h"
#include "cc/blink/web_layer_impl.h"
-#include "cc/layers/layer_settings.h"
#include "cc/layers/texture_layer.h"
#include "cc/resources/single_release_callback.h"
#include "cc/resources/texture_mailbox.h"
@@ -25,8 +24,7 @@
blink::WebExternalTextureLayerClient* client)
: client_(client) {
cc::TextureLayerClient* cc_client = client_ ? this : nullptr;
- scoped_refptr<TextureLayer> layer =
- TextureLayer::CreateForMailbox(cc::LayerSettings(), cc_client);
+ scoped_refptr<TextureLayer> layer = TextureLayer::CreateForMailbox(cc_client);
layer->SetIsDrawable(true);
layer_.reset(new WebLayerImpl(layer));
}
diff --git a/cc/blink/web_image_layer_impl.cc b/cc/blink/web_image_layer_impl.cc
index e3b7421..68f6198 100644
--- a/cc/blink/web_image_layer_impl.cc
+++ b/cc/blink/web_image_layer_impl.cc
@@ -6,15 +6,13 @@
#include "cc/blink/web_layer_impl.h"
#include "cc/blink/web_layer_impl_fixed_bounds.h"
-#include "cc/layers/layer_settings.h"
#include "cc/layers/picture_image_layer.h"
#include "third_party/skia/include/core/SkImage.h"
namespace cc_blink {
WebImageLayerImpl::WebImageLayerImpl() {
- layer_.reset(new WebLayerImplFixedBounds(
- cc::PictureImageLayer::Create(cc::LayerSettings())));
+ layer_.reset(new WebLayerImplFixedBounds(cc::PictureImageLayer::Create()));
}
WebImageLayerImpl::~WebImageLayerImpl() {
diff --git a/cc/blink/web_layer_impl.cc b/cc/blink/web_layer_impl.cc
index 2d578fc2..667a848 100644
--- a/cc/blink/web_layer_impl.cc
+++ b/cc/blink/web_layer_impl.cc
@@ -19,7 +19,6 @@
#include "cc/blink/web_blend_mode.h"
#include "cc/layers/layer.h"
#include "cc/layers/layer_position_constraint.h"
-#include "cc/layers/layer_settings.h"
#include "cc/trees/layer_tree_host.h"
#include "third_party/WebKit/public/platform/WebFloatPoint.h"
#include "third_party/WebKit/public/platform/WebFloatRect.h"
@@ -41,8 +40,7 @@
namespace cc_blink {
WebLayerImpl::WebLayerImpl()
- : layer_(Layer::Create(cc::LayerSettings())),
- contents_opaque_is_fixed_(false) {}
+ : layer_(Layer::Create()), contents_opaque_is_fixed_(false) {}
WebLayerImpl::WebLayerImpl(scoped_refptr<Layer> layer)
: layer_(layer), contents_opaque_is_fixed_(false) {
diff --git a/cc/blink/web_layer_impl.h b/cc/blink/web_layer_impl.h
index 85726d26..a955fcb 100644
--- a/cc/blink/web_layer_impl.h
+++ b/cc/blink/web_layer_impl.h
@@ -41,7 +41,6 @@
namespace cc {
class FilterOperations;
class Layer;
-class LayerSettings;
}
namespace cc_blink {
diff --git a/cc/blink/web_layer_impl_fixed_bounds_unittest.cc b/cc/blink/web_layer_impl_fixed_bounds_unittest.cc
index ad9b1e13..01a1a386 100644
--- a/cc/blink/web_layer_impl_fixed_bounds_unittest.cc
+++ b/cc/blink/web_layer_impl_fixed_bounds_unittest.cc
@@ -4,7 +4,6 @@
#include <vector>
#include "cc/blink/web_layer_impl_fixed_bounds.h"
-#include "cc/layers/layer_settings.h"
#include "cc/layers/picture_image_layer.h"
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/geometry_test_utils.h"
@@ -90,16 +89,15 @@
scoped_ptr<WebLayerImplFixedBounds> root_layer(new WebLayerImplFixedBounds());
- WebLayerImplFixedBounds* fixed_bounds_layer = new WebLayerImplFixedBounds(
- cc::PictureImageLayer::Create(cc::LayerSettings()));
+ WebLayerImplFixedBounds* fixed_bounds_layer =
+ new WebLayerImplFixedBounds(cc::PictureImageLayer::Create());
fixed_bounds_layer->setBounds(bounds);
fixed_bounds_layer->SetFixedBounds(fixed_bounds);
fixed_bounds_layer->setTransform(transform.matrix());
fixed_bounds_layer->setPosition(position);
root_layer->addChild(fixed_bounds_layer);
- WebLayerImpl* normal_layer(
- new WebLayerImpl(cc::PictureImageLayer::Create(cc::LayerSettings())));
+ WebLayerImpl* normal_layer(new WebLayerImpl(cc::PictureImageLayer::Create()));
normal_layer->setBounds(bounds);
normal_layer->setTransform(transform.matrix());
diff --git a/cc/blink/web_scrollbar_layer_impl.cc b/cc/blink/web_scrollbar_layer_impl.cc
index 905d36b..e31f5c6 100644
--- a/cc/blink/web_scrollbar_layer_impl.cc
+++ b/cc/blink/web_scrollbar_layer_impl.cc
@@ -7,7 +7,6 @@
#include "cc/blink/scrollbar_impl.h"
#include "cc/blink/web_layer_impl.h"
#include "cc/layers/layer.h"
-#include "cc/layers/layer_settings.h"
#include "cc/layers/painted_scrollbar_layer.h"
#include "cc/layers/scrollbar_layer_interface.h"
#include "cc/layers/solid_color_scrollbar_layer.h"
@@ -32,7 +31,7 @@
blink::WebScrollbarThemePainter painter,
blink::WebScrollbarThemeGeometry* geometry)
: layer_(new WebLayerImpl(PaintedScrollbarLayer::Create(
- cc::LayerSettings(),
+
scoped_ptr<cc::Scrollbar>(
new ScrollbarImpl(make_scoped_ptr(scrollbar),
painter,
@@ -45,8 +44,7 @@
int track_start,
bool is_left_side_vertical_scrollbar)
: layer_(new WebLayerImpl(
- SolidColorScrollbarLayer::Create(cc::LayerSettings(),
- ConvertOrientation(orientation),
+ SolidColorScrollbarLayer::Create(ConvertOrientation(orientation),
thumb_thickness,
track_start,
is_left_side_vertical_scrollbar,
diff --git a/cc/cc.gyp b/cc/cc.gyp
index b301021..7b54509a 100644
--- a/cc/cc.gyp
+++ b/cc/cc.gyp
@@ -202,8 +202,6 @@
'layers/layer_position_constraint.h',
'layers/layer_proto_converter.cc',
'layers/layer_proto_converter.h',
- 'layers/layer_settings.cc',
- 'layers/layer_settings.h',
'layers/layer_utils.cc',
'layers/layer_utils.h',
'layers/nine_patch_layer.cc',
diff --git a/cc/cc_tests.gyp b/cc/cc_tests.gyp
index 37a56cb7..8cbc51d 100644
--- a/cc/cc_tests.gyp
+++ b/cc/cc_tests.gyp
@@ -244,8 +244,6 @@
'test/layer_tree_pixel_resource_test.h',
'test/layer_tree_pixel_test.cc',
'test/layer_tree_pixel_test.h',
- 'test/layer_tree_settings_for_testing.cc',
- 'test/layer_tree_settings_for_testing.h',
'test/layer_tree_test.cc',
'test/layer_tree_test.h',
'test/mock_helper.h',
diff --git a/cc/debug/micro_benchmark_controller_unittest.cc b/cc/debug/micro_benchmark_controller_unittest.cc
index a66d2dc..5e4aa403 100644
--- a/cc/debug/micro_benchmark_controller_unittest.cc
+++ b/cc/debug/micro_benchmark_controller_unittest.cc
@@ -7,7 +7,6 @@
#include "cc/debug/micro_benchmark.h"
#include "cc/debug/micro_benchmark_controller.h"
#include "cc/layers/layer.h"
-#include "cc/layers/layer_settings.h"
#include "cc/test/fake_impl_task_runner_provider.h"
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/fake_layer_tree_host_impl.h"
@@ -32,7 +31,7 @@
layer_tree_host_ = FakeLayerTreeHost::Create(&layer_tree_host_client_,
&task_graph_runner_);
- layer_tree_host_->SetRootLayer(Layer::Create(LayerSettings()));
+ layer_tree_host_->SetRootLayer(Layer::Create());
layer_tree_host_->InitializeForTesting(
TaskRunnerProvider::Create(nullptr, nullptr),
scoped_ptr<Proxy>(new FakeProxy), nullptr);
diff --git a/cc/layers/heads_up_display_layer.cc b/cc/layers/heads_up_display_layer.cc
index a34ca42..8d581dc 100644
--- a/cc/layers/heads_up_display_layer.cc
+++ b/cc/layers/heads_up_display_layer.cc
@@ -13,14 +13,12 @@
namespace cc {
-scoped_refptr<HeadsUpDisplayLayer> HeadsUpDisplayLayer::Create(
- const LayerSettings& settings) {
- return make_scoped_refptr(new HeadsUpDisplayLayer(settings));
+scoped_refptr<HeadsUpDisplayLayer> HeadsUpDisplayLayer::Create() {
+ return make_scoped_refptr(new HeadsUpDisplayLayer());
}
-HeadsUpDisplayLayer::HeadsUpDisplayLayer(const LayerSettings& settings)
- : Layer(settings),
- typeface_(skia::AdoptRef(
+HeadsUpDisplayLayer::HeadsUpDisplayLayer()
+ : typeface_(skia::AdoptRef(
SkTypeface::CreateFromName("times new roman", SkTypeface::kNormal))) {
if (!typeface_) {
typeface_ = skia::AdoptRef(
diff --git a/cc/layers/heads_up_display_layer.h b/cc/layers/heads_up_display_layer.h
index 23b3407a..5d416c2 100644
--- a/cc/layers/heads_up_display_layer.h
+++ b/cc/layers/heads_up_display_layer.h
@@ -21,8 +21,7 @@
class CC_EXPORT HeadsUpDisplayLayer : public Layer {
public:
- static scoped_refptr<HeadsUpDisplayLayer> Create(
- const LayerSettings& settings);
+ static scoped_refptr<HeadsUpDisplayLayer> Create();
void PrepareForCalculateDrawProperties(
const gfx::Size& device_viewport, float device_scale_factor);
@@ -35,7 +34,7 @@
void PushPropertiesTo(LayerImpl* layer) override;
protected:
- explicit HeadsUpDisplayLayer(const LayerSettings& settings);
+ HeadsUpDisplayLayer();
bool HasDrawableContent() const override;
private:
diff --git a/cc/layers/heads_up_display_unittest.cc b/cc/layers/heads_up_display_unittest.cc
index 532a169c..1801021 100644
--- a/cc/layers/heads_up_display_unittest.cc
+++ b/cc/layers/heads_up_display_unittest.cc
@@ -26,7 +26,7 @@
bool DrawsContent() const override { return true; }
private:
- DrawsContentLayer() : Layer(LayerSettings()) {}
+ DrawsContentLayer() {}
~DrawsContentLayer() override {}
};
diff --git a/cc/layers/io_surface_layer.cc b/cc/layers/io_surface_layer.cc
index 7fb3f3f1..0934f1e 100644
--- a/cc/layers/io_surface_layer.cc
+++ b/cc/layers/io_surface_layer.cc
@@ -10,14 +10,11 @@
namespace cc {
-scoped_refptr<IOSurfaceLayer> IOSurfaceLayer::Create(
- const LayerSettings& settings) {
- return make_scoped_refptr(new IOSurfaceLayer(settings));
+scoped_refptr<IOSurfaceLayer> IOSurfaceLayer::Create() {
+ return make_scoped_refptr(new IOSurfaceLayer());
}
-IOSurfaceLayer::IOSurfaceLayer(const LayerSettings& settings)
- : Layer(settings), io_surface_id_(0) {
-}
+IOSurfaceLayer::IOSurfaceLayer() : io_surface_id_(0) {}
IOSurfaceLayer::~IOSurfaceLayer() {}
diff --git a/cc/layers/io_surface_layer.h b/cc/layers/io_surface_layer.h
index a88492f..c0883094 100644
--- a/cc/layers/io_surface_layer.h
+++ b/cc/layers/io_surface_layer.h
@@ -15,7 +15,7 @@
class CC_EXPORT IOSurfaceLayer : public Layer {
public:
- static scoped_refptr<IOSurfaceLayer> Create(const LayerSettings& settings);
+ static scoped_refptr<IOSurfaceLayer> Create();
void SetIOSurfaceProperties(uint32_t io_surface_id, const gfx::Size& size);
@@ -25,7 +25,7 @@
protected:
bool HasDrawableContent() const override;
- explicit IOSurfaceLayer(const LayerSettings& settings);
+ IOSurfaceLayer();
private:
~IOSurfaceLayer() override;
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 854effe..9883c5cf 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -22,7 +22,6 @@
#include "cc/layers/layer_client.h"
#include "cc/layers/layer_impl.h"
#include "cc/layers/layer_proto_converter.h"
-#include "cc/layers/layer_settings.h"
#include "cc/layers/scrollbar_layer_interface.h"
#include "cc/output/copy_output_request.h"
#include "cc/output/copy_output_result.h"
@@ -41,11 +40,11 @@
base::StaticAtomicSequenceNumber g_next_layer_id;
-scoped_refptr<Layer> Layer::Create(const LayerSettings& settings) {
- return make_scoped_refptr(new Layer(settings));
+scoped_refptr<Layer> Layer::Create() {
+ return make_scoped_refptr(new Layer());
}
-Layer::Layer(const LayerSettings& settings)
+Layer::Layer()
: needs_push_properties_(false),
num_dependents_need_push_properties_(0),
// Layer IDs start from 1.
@@ -97,8 +96,7 @@
replica_layer_(nullptr),
client_(nullptr),
num_unclipped_descendants_(0),
- frame_timing_requests_dirty_(false) {
-}
+ frame_timing_requests_dirty_(false) {}
Layer::~Layer() {
// Our parent should be holding a reference to us so there should be no
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index c14f14d..97023d0 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -55,7 +55,6 @@
class LayerAnimationEventObserver;
class LayerClient;
class LayerImpl;
-class LayerSettings;
class LayerTreeHost;
class LayerTreeHostCommon;
class LayerTreeImpl;
@@ -82,7 +81,7 @@
INVALID_ID = -1,
};
- static scoped_refptr<Layer> Create(const LayerSettings& settings);
+ static scoped_refptr<Layer> Create();
int id() const { return layer_id_; }
@@ -534,8 +533,7 @@
friend class LayerImpl;
friend class TreeSynchronizer;
virtual ~Layer();
-
- explicit Layer(const LayerSettings& settings);
+ Layer();
// These SetNeeds functions are in order of severity of update:
//
diff --git a/cc/layers/layer_perftest.cc b/cc/layers/layer_perftest.cc
index e27f0309..d3c1191 100644
--- a/cc/layers/layer_perftest.cc
+++ b/cc/layers/layer_perftest.cc
@@ -6,7 +6,6 @@
#include "base/thread_task_runner_handle.h"
#include "cc/debug/lap_timer.h"
-#include "cc/layers/layer_settings.h"
#include "cc/test/fake_impl_task_runner_provider.h"
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/fake_layer_tree_host_client.h"
@@ -57,7 +56,7 @@
};
TEST_F(LayerPerfTest, PushPropertiesTo) {
- scoped_refptr<Layer> test_layer = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> test_layer = Layer::Create();
scoped_ptr<LayerImpl> impl_layer =
LayerImpl::Create(host_impl_.active_tree(), 1);
diff --git a/cc/layers/layer_position_constraint_unittest.cc b/cc/layers/layer_position_constraint_unittest.cc
index b2cc0df..7cc7db0 100644
--- a/cc/layers/layer_position_constraint_unittest.cc
+++ b/cc/layers/layer_position_constraint_unittest.cc
@@ -8,7 +8,6 @@
#include "cc/layers/layer.h"
#include "cc/layers/layer_impl.h"
-#include "cc/layers/layer_settings.h"
#include "cc/proto/layer_position_constraint.pb.h"
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/fake_proxy.h"
@@ -22,8 +21,7 @@
class LayerWithForcedDrawsContent : public Layer {
public:
- explicit LayerWithForcedDrawsContent(const LayerSettings& settings)
- : Layer(settings) {}
+ LayerWithForcedDrawsContent() {}
bool DrawsContent() const override;
@@ -88,16 +86,14 @@
void CreateTreeForTest() {
// scroll_layer_ is the inner viewport scroll layer and child_ is the outer
// viewport scroll layer.
- root_ = Layer::Create(layer_settings_);
- inner_viewport_container_layer_ = Layer::Create(layer_settings_);
- scroll_layer_ = Layer::Create(layer_settings_);
- outer_viewport_container_layer_ = Layer::Create(layer_settings_);
- child_transform_layer_ = Layer::Create(layer_settings_);
- child_ = Layer::Create(layer_settings_);
- grand_child_ =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings_));
- great_grand_child_ =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings_));
+ root_ = Layer::Create();
+ inner_viewport_container_layer_ = Layer::Create();
+ scroll_layer_ = Layer::Create();
+ outer_viewport_container_layer_ = Layer::Create();
+ child_transform_layer_ = Layer::Create();
+ child_ = Layer::Create();
+ grand_child_ = make_scoped_refptr(new LayerWithForcedDrawsContent());
+ great_grand_child_ = make_scoped_refptr(new LayerWithForcedDrawsContent());
gfx::Transform IdentityMatrix;
gfx::Point3F transform_origin;
@@ -175,7 +171,6 @@
FakeLayerTreeHostClient fake_client_;
TestTaskGraphRunner task_graph_runner_;
scoped_ptr<FakeLayerTreeHost> layer_tree_host_;
- LayerSettings layer_settings_;
scoped_refptr<Layer> root_;
scoped_refptr<Layer> inner_viewport_container_layer_;
scoped_refptr<Layer> scroll_layer_;
@@ -554,7 +549,7 @@
// Add one more layer to the test tree for this scenario.
scoped_refptr<Layer> fixed_position_child =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings_));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
SetLayerPropertiesForTesting(fixed_position_child.get(), gfx::Transform(),
gfx::Point3F(), gfx::PointF(),
gfx::Size(100, 100), true);
@@ -711,7 +706,7 @@
// Add one more layer to the test tree for this scenario.
scoped_refptr<Layer> fixed_position_child =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings_));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
SetLayerPropertiesForTesting(fixed_position_child.get(), gfx::Transform(),
gfx::Point3F(), gfx::PointF(),
gfx::Size(100, 100), true);
@@ -1043,7 +1038,7 @@
// Add one more layer to the hierarchy for this test.
scoped_refptr<Layer> great_great_grand_child =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings_));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
great_grand_child_->AddChild(great_great_grand_child);
child_->SetIsContainerForFixedPositionLayers(true);
@@ -1096,7 +1091,7 @@
// This test checks for correct scroll compensation when the fixed-position
// container is the inner viewport scroll layer and has non-zero bounds delta.
scoped_refptr<Layer> fixed_child =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings_));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
fixed_child->SetBounds(gfx::Size(300, 300));
scroll_layer_->AddChild(fixed_child);
fixed_child->SetPositionConstraint(fixed_to_top_left_);
diff --git a/cc/layers/layer_proto_converter.cc b/cc/layers/layer_proto_converter.cc
index 19215c9..921028fe 100644
--- a/cc/layers/layer_proto_converter.cc
+++ b/cc/layers/layer_proto_converter.cc
@@ -8,7 +8,6 @@
#include "cc/layers/empty_content_layer_client.h"
#include "cc/layers/heads_up_display_layer.h"
#include "cc/layers/layer.h"
-#include "cc/layers/layer_settings.h"
#include "cc/layers/picture_layer.h"
#include "cc/proto/layer.pb.h"
#include "cc/trees/layer_tree_host_common.h"
@@ -113,12 +112,11 @@
// layer type we don't support.
case proto::LayerNode::UNKNOWN:
case proto::LayerNode::LAYER:
- return Layer::Create(LayerSettings()).get();
+ return Layer::Create().get();
case proto::LayerNode::PICTURE_LAYER:
- return PictureLayer::Create(LayerSettings(),
- EmptyContentLayerClient::GetInstance());
+ return PictureLayer::Create(EmptyContentLayerClient::GetInstance());
case proto::LayerNode::HEADS_UP_DISPLAY_LAYER:
- return HeadsUpDisplayLayer::Create(LayerSettings());
+ return HeadsUpDisplayLayer::Create();
}
// TODO(nyquist): Add the rest of the necessary LayerTypes. This function
// should not return null.
diff --git a/cc/layers/layer_proto_converter_unittest.cc b/cc/layers/layer_proto_converter_unittest.cc
index af1e902..fd88da4b 100644
--- a/cc/layers/layer_proto_converter_unittest.cc
+++ b/cc/layers/layer_proto_converter_unittest.cc
@@ -7,7 +7,6 @@
#include "cc/layers/empty_content_layer_client.h"
#include "cc/layers/heads_up_display_layer.h"
#include "cc/layers/layer.h"
-#include "cc/layers/layer_settings.h"
#include "cc/layers/picture_layer.h"
#include "cc/proto/layer.pb.h"
#include "cc/test/fake_layer_tree_host.h"
@@ -48,7 +47,7 @@
c
The old root node will be reused during deserialization.
*/
- scoped_refptr<Layer> old_root = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> old_root = Layer::Create();
proto::LayerNode root_node;
root_node.set_id(old_root->id());
root_node.set_type(proto::LayerNode::LAYER);
@@ -144,7 +143,7 @@
child_c_node->set_type(proto::LayerNode::LAYER);
child_c_node->set_parent_id(child_b_node->id());
- scoped_refptr<Layer> old_root = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> old_root = Layer::Create();
scoped_refptr<Layer> new_root =
LayerProtoConverter::DeserializeLayerHierarchy(old_root, root_node);
@@ -175,13 +174,13 @@
Layers marked with + have descendants with changed properties.
Layer b also has a mask layer and a replica layer.
*/
- scoped_refptr<Layer> layer_src_root = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_a = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_b = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_b_mask = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_b_replica = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_c = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_d = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_src_root = Layer::Create();
+ scoped_refptr<Layer> layer_src_a = Layer::Create();
+ scoped_refptr<Layer> layer_src_b = Layer::Create();
+ scoped_refptr<Layer> layer_src_b_mask = Layer::Create();
+ scoped_refptr<Layer> layer_src_b_replica = Layer::Create();
+ scoped_refptr<Layer> layer_src_c = Layer::Create();
+ scoped_refptr<Layer> layer_src_d = Layer::Create();
layer_src_root->AddChild(layer_src_a);
layer_src_root->AddChild(layer_src_b);
layer_src_a->AddChild(layer_src_c);
@@ -294,10 +293,10 @@
Layers marked with + have descendants with changed properties.
Layer b also has a mask layer.
*/
- scoped_refptr<Layer> layer_src_root = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_b = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_b_mask = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_c = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_src_root = Layer::Create();
+ scoped_refptr<Layer> layer_src_b = Layer::Create();
+ scoped_refptr<Layer> layer_src_b_mask = Layer::Create();
+ scoped_refptr<Layer> layer_src_c = Layer::Create();
layer_src_root->AddChild(layer_src_b);
layer_src_b->AddChild(layer_src_c);
layer_src_b->SetMaskLayer(layer_src_b_mask.get());
@@ -361,7 +360,7 @@
*/
proto::LayerUpdate updates;
- scoped_refptr<Layer> root = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> root = Layer::Create();
root->SetLayerTreeHost(layer_tree_host_.get());
proto::LayerProperties* root_props = updates.add_layers();
root_props->set_id(root->id());
@@ -369,7 +368,7 @@
root_props->set_num_dependents_need_push_properties(1);
root_props->mutable_base();
- scoped_refptr<Layer> a = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> a = Layer::Create();
a->SetLayerTreeHost(layer_tree_host_.get());
proto::LayerProperties* a_props = updates.add_layers();
a_props->set_id(a->id());
@@ -377,7 +376,7 @@
a_props->set_num_dependents_need_push_properties(0);
root->AddChild(a);
- scoped_refptr<Layer> b = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> b = Layer::Create();
b->SetLayerTreeHost(layer_tree_host_.get());
proto::LayerProperties* b_props = updates.add_layers();
b_props->set_id(b->id());
@@ -385,7 +384,7 @@
b_props->set_num_dependents_need_push_properties(1);
root->AddChild(b);
- scoped_refptr<Layer> c = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> c = Layer::Create();
c->SetLayerTreeHost(layer_tree_host_.get());
proto::LayerProperties* c_props = updates.add_layers();
c_props->set_id(c->id());
@@ -415,8 +414,8 @@
TEST_F(LayerProtoConverterTest, PictureLayerTypeSerialization) {
// Make sure that PictureLayers serialize to the
// proto::LayerType::PICTURE_LAYER type.
- scoped_refptr<PictureLayer> layer = PictureLayer::Create(
- LayerSettings(), EmptyContentLayerClient::GetInstance());
+ scoped_refptr<PictureLayer> layer =
+ PictureLayer::Create(EmptyContentLayerClient::GetInstance());
proto::LayerNode layer_hierarchy;
LayerProtoConverter::SerializeLayerHierarchy(layer.get(), &layer_hierarchy);
@@ -426,8 +425,8 @@
TEST_F(LayerProtoConverterTest, PictureLayerTypeDeserialization) {
// Make sure that proto::LayerType::PICTURE_LAYER ends up building a
// PictureLayer.
- scoped_refptr<Layer> old_root = PictureLayer::Create(
- LayerSettings(), EmptyContentLayerClient::GetInstance());
+ scoped_refptr<Layer> old_root =
+ PictureLayer::Create(EmptyContentLayerClient::GetInstance());
proto::LayerNode root_node;
root_node.set_id(old_root->id());
root_node.set_type(proto::LayerNode::PICTURE_LAYER);
@@ -448,8 +447,7 @@
TEST_F(LayerProtoConverterTest, HudLayerTypeSerialization) {
// Make sure that PictureLayers serialize to the
// proto::LayerType::HEADS_UP_DISPLAY_LAYER type.
- scoped_refptr<HeadsUpDisplayLayer> layer =
- HeadsUpDisplayLayer::Create(LayerSettings());
+ scoped_refptr<HeadsUpDisplayLayer> layer = HeadsUpDisplayLayer::Create();
proto::LayerNode layer_hierarchy;
LayerProtoConverter::SerializeLayerHierarchy(layer.get(), &layer_hierarchy);
@@ -459,7 +457,7 @@
TEST_F(LayerProtoConverterTest, HudLayerTypeDeserialization) {
// Make sure that proto::LayerType::HEADS_UP_DISPLAY_LAYER ends up building a
// HeadsUpDisplayLayer.
- scoped_refptr<Layer> old_root = HeadsUpDisplayLayer::Create(LayerSettings());
+ scoped_refptr<Layer> old_root = HeadsUpDisplayLayer::Create();
proto::LayerNode root_node;
root_node.set_id(old_root->id());
root_node.set_type(proto::LayerNode::HEADS_UP_DISPLAY_LAYER);
diff --git a/cc/layers/layer_settings.cc b/cc/layers/layer_settings.cc
deleted file mode 100644
index d2eac382..0000000
--- a/cc/layers/layer_settings.cc
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "cc/layers/layer_settings.h"
-
-namespace cc {
-
-LayerSettings::LayerSettings() : use_compositor_animation_timelines(true) {}
-
-LayerSettings::~LayerSettings() {}
-
-} // namespace cc
diff --git a/cc/layers/layer_settings.h b/cc/layers/layer_settings.h
deleted file mode 100644
index 4f1ac3ac..0000000
--- a/cc/layers/layer_settings.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CC_LAYERS_LAYER_SETTINGS_H_
-#define CC_LAYERS_LAYER_SETTINGS_H_
-
-#include "cc/base/cc_export.h"
-
-namespace cc {
-
-class CC_EXPORT LayerSettings {
- public:
- LayerSettings();
- ~LayerSettings();
-
- bool use_compositor_animation_timelines;
-};
-
-} // namespace cc
-
-#endif // CC_LAYERS_LAYER_SETTINGS_H_
diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc
index 5b213c9a..59a2b5c72c 100644
--- a/cc/layers/layer_unittest.cc
+++ b/cc/layers/layer_unittest.cc
@@ -14,7 +14,6 @@
#include "cc/base/math_util.h"
#include "cc/input/main_thread_scrolling_reason.h"
#include "cc/layers/layer_impl.h"
-#include "cc/layers/layer_settings.h"
#include "cc/output/copy_output_request.h"
#include "cc/output/copy_output_result.h"
#include "cc/proto/layer.pb.h"
@@ -131,7 +130,7 @@
// it can be re-used for the |dest| layer.
src->SetLayerTreeHost(nullptr);
- scoped_refptr<Layer> dest = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> dest = Layer::Create();
dest->layer_id_ = src->layer_id_;
dest->SetLayerTreeHost(layer_tree_host_.get());
dest->FromLayerPropertiesProto(props);
@@ -243,12 +242,12 @@
}
void RunNoMembersChangedTest() {
- scoped_refptr<Layer> layer = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer = Layer::Create();
VerifyBaseLayerPropertiesSerializationAndDeserialization(layer.get());
}
void RunArbitraryMembersChangedTest() {
- scoped_refptr<Layer> layer = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer = Layer::Create();
layer->transform_origin_ = gfx::Point3F(3.0f, 1.0f, 4.0f);
layer->background_color_ = SK_ColorRED;
layer->bounds_ = gfx::Size(3, 14);
@@ -295,7 +294,7 @@
}
void RunAllMembersChangedTest() {
- scoped_refptr<Layer> layer = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer = Layer::Create();
layer->transform_origin_ = gfx::Point3F(3.0f, 1.0f, 4.0f);
layer->background_color_ = SK_ColorRED;
layer->bounds_ = gfx::Size(3, 14);
@@ -345,20 +344,20 @@
}
void RunScrollAndClipLayersTest() {
- scoped_refptr<Layer> layer = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer = Layer::Create();
- scoped_refptr<Layer> scroll_parent = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> scroll_parent = Layer::Create();
layer->scroll_parent_ = scroll_parent.get();
- scoped_refptr<Layer> scroll_child = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> scroll_child = Layer::Create();
layer->scroll_children_.reset(new std::set<Layer*>);
layer->scroll_children_->insert(scroll_child.get());
- scoped_refptr<Layer> clip_parent = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> clip_parent = Layer::Create();
layer->clip_parent_ = clip_parent.get();
layer->clip_children_.reset(new std::set<Layer*>);
- scoped_refptr<Layer> clip_child1 = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> clip_child1 = Layer::Create();
layer->clip_children_->insert(clip_child1.get());
- scoped_refptr<Layer> clip_child2 = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> clip_child2 = Layer::Create();
layer->clip_children_->insert(clip_child2.get());
VerifyBaseLayerPropertiesSerializationAndDeserialization(layer.get());
@@ -376,10 +375,10 @@
The root layer has a LayerTreeHost, and it should propagate to all the
children.
*/
- scoped_refptr<Layer> layer_src_root = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_a = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_b = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_c = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_src_root = Layer::Create();
+ scoped_refptr<Layer> layer_src_a = Layer::Create();
+ scoped_refptr<Layer> layer_src_b = Layer::Create();
+ scoped_refptr<Layer> layer_src_c = Layer::Create();
layer_src_root->AddChild(layer_src_a);
layer_src_a->AddChild(layer_src_b);
layer_src_b->AddChild(layer_src_c);
@@ -388,7 +387,7 @@
layer_src_root->ToLayerNodeProto(&proto);
Layer::LayerIdMap empty_dest_layer_map;
- scoped_refptr<Layer> layer_dest_root = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_dest_root = Layer::Create();
// Forcefully set the layer tree host for the root layer, which should cause
// it to propagate to all the children.
@@ -438,8 +437,8 @@
not have called InvalidatePropertyTreesIndices() for any of the layers,
which would happen in for example SetLayerTreeHost(...) calls.
*/
- scoped_refptr<Layer> layer_root = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_a = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_root = Layer::Create();
+ scoped_refptr<Layer> layer_src_a = Layer::Create();
layer_root->AddChild(layer_src_a);
layer_root->transform_tree_index_ = 33;
layer_src_a->transform_tree_index_ = 42;
@@ -474,9 +473,9 @@
not have called InvalidatePropertyTreesIndices() for any of the layers,
which would happen in for example SetLayerTreeHost(...) calls.
*/
- scoped_refptr<Layer> layer_src_root = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_a = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_b = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_src_root = Layer::Create();
+ scoped_refptr<Layer> layer_src_a = Layer::Create();
+ scoped_refptr<Layer> layer_src_b = Layer::Create();
layer_src_root->AddChild(layer_src_a);
layer_src_root->AddChild(layer_src_b);
@@ -484,7 +483,7 @@
proto::LayerNode root_proto_1;
layer_src_root->ToLayerNodeProto(&root_proto_1);
Layer::LayerIdMap dest_layer_map;
- scoped_refptr<Layer> layer_dest_root = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_dest_root = Layer::Create();
layer_dest_root->FromLayerNodeProto(root_proto_1, dest_layer_map);
// Ensure initial copy is correct.
@@ -538,15 +537,15 @@
not have called InvalidatePropertyTreesIndices() for any of the layers,
which would happen in for example SetLayerTreeHost(...) calls.
*/
- scoped_refptr<Layer> layer_src_root = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_a = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_src_root = Layer::Create();
+ scoped_refptr<Layer> layer_src_a = Layer::Create();
layer_src_root->AddChild(layer_src_a);
// Copy tree-structure to new root.
proto::LayerNode root_proto_1;
layer_src_root->ToLayerNodeProto(&root_proto_1);
Layer::LayerIdMap dest_layer_map;
- scoped_refptr<Layer> layer_dest_root = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_dest_root = Layer::Create();
layer_dest_root->FromLayerNodeProto(root_proto_1, dest_layer_map);
// Ensure initial copy is correct.
@@ -559,7 +558,7 @@
layer_dest_a->transform_tree_index_ = 42;
// Add another child.
- scoped_refptr<Layer> layer_src_b = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_src_b = Layer::Create();
layer_src_root->AddChild(layer_src_b);
// Now serialize and deserialize again.
@@ -594,9 +593,9 @@
not have called InvalidatePropertyTreesIndices() for any of the layers,
which would happen in for example SetLayerTreeHost(...) calls.
*/
- scoped_refptr<Layer> layer_src_root = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_a = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_b = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_src_root = Layer::Create();
+ scoped_refptr<Layer> layer_src_a = Layer::Create();
+ scoped_refptr<Layer> layer_src_b = Layer::Create();
layer_src_root->AddChild(layer_src_a);
layer_src_root->AddChild(layer_src_b);
@@ -604,7 +603,7 @@
proto::LayerNode root_proto_1;
layer_src_root->ToLayerNodeProto(&root_proto_1);
Layer::LayerIdMap dest_layer_map;
- scoped_refptr<Layer> layer_dest_root = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_dest_root = Layer::Create();
layer_dest_root->FromLayerNodeProto(root_proto_1, dest_layer_map);
// Ensure initial copy is correct.
@@ -657,10 +656,10 @@
not have called InvalidatePropertyTreesIndices() for any of the layers,
which would happen in for example SetLayerTreeHost(...) calls.
*/
- scoped_refptr<Layer> layer_src_root = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_a = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_b = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_c = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_src_root = Layer::Create();
+ scoped_refptr<Layer> layer_src_a = Layer::Create();
+ scoped_refptr<Layer> layer_src_b = Layer::Create();
+ scoped_refptr<Layer> layer_src_c = Layer::Create();
layer_src_root->AddChild(layer_src_a);
layer_src_root->AddChild(layer_src_b);
layer_src_b->AddChild(layer_src_c);
@@ -669,7 +668,7 @@
proto::LayerNode root_proto_1;
layer_src_root->ToLayerNodeProto(&root_proto_1);
Layer::LayerIdMap dest_layer_map;
- scoped_refptr<Layer> layer_dest_root = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_dest_root = Layer::Create();
layer_dest_root->FromLayerNodeProto(root_proto_1, dest_layer_map);
// Ensure initial copy is correct.
@@ -736,10 +735,10 @@
not have called InvalidatePropertyTreesIndices() for any of the layers,
which would happen in for example SetLayerTreeHost(...) calls.
*/
- scoped_refptr<Layer> layer_src_root = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_a = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_b = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_c = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_src_root = Layer::Create();
+ scoped_refptr<Layer> layer_src_a = Layer::Create();
+ scoped_refptr<Layer> layer_src_b = Layer::Create();
+ scoped_refptr<Layer> layer_src_c = Layer::Create();
layer_src_root->AddChild(layer_src_a);
layer_src_root->AddChild(layer_src_b);
layer_src_a->AddChild(layer_src_c);
@@ -748,7 +747,7 @@
proto::LayerNode root_proto_1;
layer_src_root->ToLayerNodeProto(&root_proto_1);
Layer::LayerIdMap dest_layer_map;
- scoped_refptr<Layer> layer_dest_root = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_dest_root = Layer::Create();
layer_dest_root->FromLayerNodeProto(root_proto_1, dest_layer_map);
// Ensure initial copy is correct.
@@ -817,27 +816,18 @@
MOCK_METHOD0(SetNeedsFullTreeSync, void());
};
-class LayerTreeSettingsForLayerTest : public LayerTreeSettings {
- public:
- LayerTreeSettingsForLayerTest() { use_compositor_animation_timelines = true; }
-};
-
class LayerTest : public testing::Test {
public:
LayerTest()
- : host_impl_(LayerTreeSettingsForLayerTest(),
+ : host_impl_(LayerTreeSettings(),
&task_runner_provider_,
&shared_bitmap_manager_,
&task_graph_runner_),
fake_client_(FakeLayerTreeHostClient::DIRECT_3D) {
- layer_settings_.use_compositor_animation_timelines =
- settings().use_compositor_animation_timelines;
- if (settings().use_compositor_animation_timelines) {
- timeline_impl_ =
- AnimationTimeline::Create(AnimationIdProvider::NextTimelineId());
- timeline_impl_->set_is_impl_only(true);
- host_impl_.animation_host()->AddAnimationTimeline(timeline_impl_);
- }
+ timeline_impl_ =
+ AnimationTimeline::Create(AnimationIdProvider::NextTimelineId());
+ timeline_impl_->set_is_impl_only(true);
+ host_impl_.animation_host()->AddAnimationTimeline(timeline_impl_);
}
const LayerTreeSettings& settings() { return settings_; }
@@ -891,13 +881,13 @@
}
void CreateSimpleTestTree() {
- parent_ = Layer::Create(layer_settings_);
- child1_ = Layer::Create(layer_settings_);
- child2_ = Layer::Create(layer_settings_);
- child3_ = Layer::Create(layer_settings_);
- grand_child1_ = Layer::Create(layer_settings_);
- grand_child2_ = Layer::Create(layer_settings_);
- grand_child3_ = Layer::Create(layer_settings_);
+ parent_ = Layer::Create();
+ child1_ = Layer::Create();
+ child2_ = Layer::Create();
+ child3_ = Layer::Create();
+ grand_child1_ = Layer::Create();
+ grand_child2_ = Layer::Create();
+ grand_child3_ = Layer::Create();
EXPECT_CALL(*layer_tree_host_, SetNeedsFullTreeSync()).Times(AnyNumber());
layer_tree_host_->SetRootLayer(parent_);
@@ -931,12 +921,11 @@
scoped_refptr<AnimationTimeline> timeline_impl_;
- LayerTreeSettingsForLayerTest settings_;
- LayerSettings layer_settings_;
+ LayerTreeSettings settings_;
};
TEST_F(LayerTest, BasicCreateAndDestroy) {
- scoped_refptr<Layer> test_layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> test_layer = Layer::Create();
ASSERT_TRUE(test_layer.get());
EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(0);
@@ -949,12 +938,12 @@
TEST_F(LayerTest, LayerPropertyChangedForSubtree) {
EXPECT_CALL(*layer_tree_host_, SetNeedsFullTreeSync()).Times(AtLeast(1));
- scoped_refptr<Layer> root = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child2 = Layer::Create(layer_settings_);
- scoped_refptr<Layer> grand_child = Layer::Create(layer_settings_);
- scoped_refptr<Layer> dummy_layer1 = Layer::Create(layer_settings_);
- scoped_refptr<Layer> dummy_layer2 = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
+ scoped_refptr<Layer> child2 = Layer::Create();
+ scoped_refptr<Layer> grand_child = Layer::Create();
+ scoped_refptr<Layer> dummy_layer1 = Layer::Create();
+ scoped_refptr<Layer> dummy_layer2 = Layer::Create();
layer_tree_host_->SetRootLayer(root);
root->AddChild(child);
@@ -1134,8 +1123,8 @@
}
TEST_F(LayerTest, AddAndRemoveChild) {
- scoped_refptr<Layer> parent = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> parent = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
// Upon creation, layers should not have children or parent.
ASSERT_EQ(0U, parent->children().size());
@@ -1155,8 +1144,8 @@
TEST_F(LayerTest, AddSameChildTwice) {
EXPECT_CALL(*layer_tree_host_, SetNeedsFullTreeSync()).Times(AtLeast(1));
- scoped_refptr<Layer> parent = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> parent = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
layer_tree_host_->SetRootLayer(parent);
@@ -1172,11 +1161,11 @@
}
TEST_F(LayerTest, InsertChild) {
- scoped_refptr<Layer> parent = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child1 = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child2 = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child3 = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child4 = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> parent = Layer::Create();
+ scoped_refptr<Layer> child1 = Layer::Create();
+ scoped_refptr<Layer> child2 = Layer::Create();
+ scoped_refptr<Layer> child3 = Layer::Create();
+ scoped_refptr<Layer> child4 = Layer::Create();
EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(parent));
@@ -1217,9 +1206,9 @@
}
TEST_F(LayerTest, InsertChildPastEndOfList) {
- scoped_refptr<Layer> parent = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child1 = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child2 = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> parent = Layer::Create();
+ scoped_refptr<Layer> child1 = Layer::Create();
+ scoped_refptr<Layer> child2 = Layer::Create();
ASSERT_EQ(0U, parent->children().size());
@@ -1238,9 +1227,9 @@
}
TEST_F(LayerTest, InsertSameChildTwice) {
- scoped_refptr<Layer> parent = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child1 = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child2 = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> parent = Layer::Create();
+ scoped_refptr<Layer> child1 = Layer::Create();
+ scoped_refptr<Layer> child2 = Layer::Create();
EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(parent));
@@ -1267,7 +1256,7 @@
TEST_F(LayerTest, ReplaceChildWithNewChild) {
CreateSimpleTestTree();
- scoped_refptr<Layer> child4 = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> child4 = Layer::Create();
EXPECT_FALSE(child4->parent());
@@ -1292,8 +1281,8 @@
CreateSimpleTestTree();
// create another simple tree with test_layer and child4.
- scoped_refptr<Layer> test_layer = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child4 = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> test_layer = Layer::Create();
+ scoped_refptr<Layer> child4 = Layer::Create();
test_layer->AddChild(child4);
ASSERT_EQ(1U, test_layer->children().size());
EXPECT_EQ(child4, test_layer->children()[0]);
@@ -1315,9 +1304,9 @@
}
TEST_F(LayerTest, DeleteRemovedScrollParent) {
- scoped_refptr<Layer> parent = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child1 = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child2 = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> parent = Layer::Create();
+ scoped_refptr<Layer> child1 = Layer::Create();
+ scoped_refptr<Layer> child2 = Layer::Create();
EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(parent));
@@ -1344,9 +1333,9 @@
}
TEST_F(LayerTest, DeleteRemovedScrollChild) {
- scoped_refptr<Layer> parent = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child1 = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child2 = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> parent = Layer::Create();
+ scoped_refptr<Layer> child1 = Layer::Create();
+ scoped_refptr<Layer> child2 = Layer::Create();
EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(parent));
@@ -1396,11 +1385,11 @@
}
TEST_F(LayerTest, SetChildren) {
- scoped_refptr<Layer> old_parent = Layer::Create(layer_settings_);
- scoped_refptr<Layer> new_parent = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> old_parent = Layer::Create();
+ scoped_refptr<Layer> new_parent = Layer::Create();
- scoped_refptr<Layer> child1 = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child2 = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> child1 = Layer::Create();
+ scoped_refptr<Layer> child2 = Layer::Create();
LayerList new_children;
new_children.push_back(child1);
@@ -1427,17 +1416,17 @@
}
TEST_F(LayerTest, HasAncestor) {
- scoped_refptr<Layer> parent = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> parent = Layer::Create();
EXPECT_FALSE(parent->HasAncestor(parent.get()));
- scoped_refptr<Layer> child = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> child = Layer::Create();
parent->AddChild(child);
EXPECT_FALSE(child->HasAncestor(child.get()));
EXPECT_TRUE(child->HasAncestor(parent.get()));
EXPECT_FALSE(parent->HasAncestor(child.get()));
- scoped_refptr<Layer> child_child = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> child_child = Layer::Create();
child->AddChild(child_child);
EXPECT_FALSE(child_child->HasAncestor(child_child.get()));
@@ -1453,7 +1442,7 @@
// For this test we don't care about SetNeedsFullTreeSync calls.
EXPECT_CALL(*layer_tree_host_, SetNeedsFullTreeSync()).Times(AnyNumber());
- scoped_refptr<Layer> child4 = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> child4 = Layer::Create();
EXPECT_EQ(parent_.get(), parent_->RootLayer());
EXPECT_EQ(parent_.get(), child1_->RootLayer());
@@ -1508,7 +1497,7 @@
// 2. indirectly calls SetNeedsUpdate, exactly once for each call to
// SetNeedsDisplay.
- scoped_refptr<Layer> test_layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> test_layer = Layer::Create();
EXPECT_SET_NEEDS_FULL_TREE_SYNC(
1, layer_tree_host_->SetRootLayer(test_layer));
EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetIsDrawable(true));
@@ -1561,7 +1550,7 @@
}
TEST_F(LayerTest, TestSettingMainThreadScrollingReason) {
- scoped_refptr<Layer> test_layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> test_layer = Layer::Create();
EXPECT_SET_NEEDS_FULL_TREE_SYNC(1,
layer_tree_host_->SetRootLayer(test_layer));
EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetIsDrawable(true));
@@ -1612,13 +1601,13 @@
}
TEST_F(LayerTest, CheckPropertyChangeCausesCorrectBehavior) {
- scoped_refptr<Layer> test_layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> test_layer = Layer::Create();
EXPECT_SET_NEEDS_FULL_TREE_SYNC(
1, layer_tree_host_->SetRootLayer(test_layer));
EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetIsDrawable(true));
- scoped_refptr<Layer> dummy_layer1 = Layer::Create(layer_settings_);
- scoped_refptr<Layer> dummy_layer2 = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> dummy_layer1 = Layer::Create();
+ scoped_refptr<Layer> dummy_layer2 = Layer::Create();
// sanity check of initial test condition
EXPECT_FALSE(test_layer->NeedsDisplayForTesting());
@@ -1669,7 +1658,7 @@
}
TEST_F(LayerTest, PushPropertiesAccumulatesUpdateRect) {
- scoped_refptr<Layer> test_layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> test_layer = Layer::Create();
scoped_ptr<LayerImpl> impl_layer =
LayerImpl::Create(host_impl_.active_tree(), 1);
@@ -1701,7 +1690,7 @@
}
TEST_F(LayerTest, PushPropertiesCausesLayerPropertyChangedForTransform) {
- scoped_refptr<Layer> test_layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> test_layer = Layer::Create();
scoped_ptr<LayerImpl> impl_layer =
LayerImpl::Create(host_impl_.active_tree(), 1);
@@ -1720,7 +1709,7 @@
}
TEST_F(LayerTest, PushPropertiesCausesLayerPropertyChangedForOpacity) {
- scoped_refptr<Layer> test_layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> test_layer = Layer::Create();
scoped_ptr<LayerImpl> impl_layer =
LayerImpl::Create(host_impl_.active_tree(), 1);
@@ -1737,15 +1726,14 @@
}
TEST_F(LayerTest, MaskAndReplicaHasParent) {
- scoped_refptr<Layer> parent = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child = Layer::Create(layer_settings_);
- scoped_refptr<Layer> mask = Layer::Create(layer_settings_);
- scoped_refptr<Layer> replica = Layer::Create(layer_settings_);
- scoped_refptr<Layer> replica_mask = Layer::Create(layer_settings_);
- scoped_refptr<Layer> mask_replacement = Layer::Create(layer_settings_);
- scoped_refptr<Layer> replica_replacement = Layer::Create(layer_settings_);
- scoped_refptr<Layer> replica_mask_replacement =
- Layer::Create(layer_settings_);
+ scoped_refptr<Layer> parent = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
+ scoped_refptr<Layer> mask = Layer::Create();
+ scoped_refptr<Layer> replica = Layer::Create();
+ scoped_refptr<Layer> replica_mask = Layer::Create();
+ scoped_refptr<Layer> mask_replacement = Layer::Create();
+ scoped_refptr<Layer> replica_replacement = Layer::Create();
+ scoped_refptr<Layer> replica_mask_replacement = Layer::Create();
parent->AddChild(child);
child->SetMaskLayer(mask.get());
@@ -1773,7 +1761,7 @@
}
TEST_F(LayerTest, CheckTransformIsInvertible) {
- scoped_refptr<Layer> layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> layer = Layer::Create();
scoped_ptr<LayerImpl> impl_layer =
LayerImpl::Create(host_impl_.active_tree(), 1);
EXPECT_CALL(*layer_tree_host_, SetNeedsFullTreeSync()).Times(1);
@@ -1804,7 +1792,7 @@
}
TEST_F(LayerTest, TransformIsInvertibleAnimation) {
- scoped_refptr<Layer> layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> layer = Layer::Create();
scoped_ptr<LayerImpl> impl_layer =
LayerImpl::Create(host_impl_.active_tree(), 1);
EXPECT_CALL(*layer_tree_host_, SetNeedsFullTreeSync()).Times(1);
@@ -1872,22 +1860,14 @@
AssertLayerTreeHostMatchesForSubtree(layer->replica_layer(), host);
}
-class LayerLayerTreeHostTest : public testing::Test {
- public:
- LayerLayerTreeHostTest() {
- layer_settings_.use_compositor_animation_timelines = true;
- }
-
- protected:
- LayerSettings layer_settings_;
-};
+class LayerLayerTreeHostTest : public testing::Test {};
TEST_F(LayerLayerTreeHostTest, EnteringTree) {
- scoped_refptr<Layer> parent = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child = Layer::Create(layer_settings_);
- scoped_refptr<Layer> mask = Layer::Create(layer_settings_);
- scoped_refptr<Layer> replica = Layer::Create(layer_settings_);
- scoped_refptr<Layer> replica_mask = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> parent = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
+ scoped_refptr<Layer> mask = Layer::Create();
+ scoped_refptr<Layer> replica = Layer::Create();
+ scoped_refptr<Layer> replica_mask = Layer::Create();
// Set up a detached tree of layers. The host pointer should be nil for these
// layers.
@@ -1914,7 +1894,7 @@
}
TEST_F(LayerLayerTreeHostTest, AddingLayerSubtree) {
- scoped_refptr<Layer> parent = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> parent = Layer::Create();
LayerTreeHostFactory factory;
scoped_ptr<LayerTreeHost> layer_tree_host = factory.Create();
@@ -1924,16 +1904,16 @@
// Adding a subtree to a layer already associated with a host should set the
// host pointer on all layers in that subtree.
- scoped_refptr<Layer> child = Layer::Create(layer_settings_);
- scoped_refptr<Layer> grand_child = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> child = Layer::Create();
+ scoped_refptr<Layer> grand_child = Layer::Create();
child->AddChild(grand_child);
// Masks, replicas, and replica masks should pick up the new host too.
- scoped_refptr<Layer> child_mask = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> child_mask = Layer::Create();
child->SetMaskLayer(child_mask.get());
- scoped_refptr<Layer> child_replica = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> child_replica = Layer::Create();
child->SetReplicaLayer(child_replica.get());
- scoped_refptr<Layer> child_replica_mask = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> child_replica_mask = Layer::Create();
child_replica->SetMaskLayer(child_replica_mask.get());
parent->AddChild(child);
@@ -1943,11 +1923,11 @@
}
TEST_F(LayerLayerTreeHostTest, ChangeHost) {
- scoped_refptr<Layer> parent = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child = Layer::Create(layer_settings_);
- scoped_refptr<Layer> mask = Layer::Create(layer_settings_);
- scoped_refptr<Layer> replica = Layer::Create(layer_settings_);
- scoped_refptr<Layer> replica_mask = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> parent = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
+ scoped_refptr<Layer> mask = Layer::Create();
+ scoped_refptr<Layer> replica = Layer::Create();
+ scoped_refptr<Layer> replica_mask = Layer::Create();
// Same setup as the previous test.
parent->AddChild(child);
@@ -1974,11 +1954,11 @@
}
TEST_F(LayerLayerTreeHostTest, ChangeHostInSubtree) {
- scoped_refptr<Layer> first_parent = Layer::Create(layer_settings_);
- scoped_refptr<Layer> first_child = Layer::Create(layer_settings_);
- scoped_refptr<Layer> second_parent = Layer::Create(layer_settings_);
- scoped_refptr<Layer> second_child = Layer::Create(layer_settings_);
- scoped_refptr<Layer> second_grand_child = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> first_parent = Layer::Create();
+ scoped_refptr<Layer> first_child = Layer::Create();
+ scoped_refptr<Layer> second_parent = Layer::Create();
+ scoped_refptr<Layer> second_child = Layer::Create();
+ scoped_refptr<Layer> second_grand_child = Layer::Create();
// First put all children under the first parent and set the first host.
first_parent->AddChild(first_child);
@@ -2010,13 +1990,13 @@
}
TEST_F(LayerLayerTreeHostTest, ReplaceMaskAndReplicaLayer) {
- scoped_refptr<Layer> parent = Layer::Create(layer_settings_);
- scoped_refptr<Layer> mask = Layer::Create(layer_settings_);
- scoped_refptr<Layer> replica = Layer::Create(layer_settings_);
- scoped_refptr<Layer> mask_child = Layer::Create(layer_settings_);
- scoped_refptr<Layer> replica_child = Layer::Create(layer_settings_);
- scoped_refptr<Layer> mask_replacement = Layer::Create(layer_settings_);
- scoped_refptr<Layer> replica_replacement = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> parent = Layer::Create();
+ scoped_refptr<Layer> mask = Layer::Create();
+ scoped_refptr<Layer> replica = Layer::Create();
+ scoped_refptr<Layer> mask_child = Layer::Create();
+ scoped_refptr<Layer> replica_child = Layer::Create();
+ scoped_refptr<Layer> mask_replacement = Layer::Create();
+ scoped_refptr<Layer> replica_replacement = Layer::Create();
parent->SetMaskLayer(mask.get());
parent->SetReplicaLayer(replica.get());
@@ -2044,8 +2024,8 @@
}
TEST_F(LayerLayerTreeHostTest, DestroyHostWithNonNullRootLayer) {
- scoped_refptr<Layer> root = Layer::Create(layer_settings_);
- scoped_refptr<Layer> child = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
root->AddChild(child);
LayerTreeHostFactory factory;
scoped_ptr<LayerTreeHost> layer_tree_host = factory.Create();
@@ -2056,7 +2036,7 @@
LayerTreeHostFactory factory;
scoped_ptr<LayerTreeHost> layer_tree_host = factory.Create();
- scoped_refptr<Layer> layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> layer = Layer::Create();
layer_tree_host->SetRootLayer(layer);
for (int contents_opaque = 0; contents_opaque < 2; ++contents_opaque) {
@@ -2087,9 +2067,8 @@
class DrawsContentChangeLayer : public Layer {
public:
- static scoped_refptr<DrawsContentChangeLayer> Create(
- const LayerSettings& settings) {
- return make_scoped_refptr(new DrawsContentChangeLayer(settings));
+ static scoped_refptr<DrawsContentChangeLayer> Create() {
+ return make_scoped_refptr(new DrawsContentChangeLayer());
}
void SetLayerTreeHost(LayerTreeHost* host) override {
@@ -2107,19 +2086,18 @@
}
private:
- explicit DrawsContentChangeLayer(const LayerSettings& settings)
- : Layer(settings), fake_draws_content_(false) {}
+ DrawsContentChangeLayer() : fake_draws_content_(false) {}
~DrawsContentChangeLayer() override {}
bool fake_draws_content_;
};
TEST_F(LayerTest, DrawsContentChangedInSetLayerTreeHost) {
- scoped_refptr<Layer> root_layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> root_layer = Layer::Create();
scoped_refptr<DrawsContentChangeLayer> becomes_not_draws_content =
- DrawsContentChangeLayer::Create(layer_settings_);
+ DrawsContentChangeLayer::Create();
scoped_refptr<DrawsContentChangeLayer> becomes_draws_content =
- DrawsContentChangeLayer::Create(layer_settings_);
+ DrawsContentChangeLayer::Create();
root_layer->SetIsDrawable(true);
becomes_not_draws_content->SetIsDrawable(true);
becomes_not_draws_content->SetFakeDrawsContent(true);
@@ -2138,7 +2116,7 @@
}
TEST_F(LayerTest, DedupesCopyOutputRequestsBySource) {
- scoped_refptr<Layer> layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> layer = Layer::Create();
int result_count = 0;
// Create identical requests without the source being set, and expect the
@@ -2156,7 +2134,7 @@
layer = nullptr;
EXPECT_EQ(2, result_count);
- layer = Layer::Create(layer_settings_);
+ layer = Layer::Create();
result_count = 0;
// Create identical requests, but this time the source is being set. Expect
@@ -2202,7 +2180,7 @@
}
TEST_F(LayerTest, AnimationSchedulesLayerUpdate) {
- scoped_refptr<Layer> layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> layer = Layer::Create();
EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(layer));
EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times(1);
@@ -2231,12 +2209,12 @@
c
Layer c also has a mask layer and a replica layer.
*/
- scoped_refptr<Layer> layer_src_root = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_a = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_b = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_c = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_c_mask = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_c_replica = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_src_root = Layer::Create();
+ scoped_refptr<Layer> layer_src_a = Layer::Create();
+ scoped_refptr<Layer> layer_src_b = Layer::Create();
+ scoped_refptr<Layer> layer_src_c = Layer::Create();
+ scoped_refptr<Layer> layer_src_c_mask = Layer::Create();
+ scoped_refptr<Layer> layer_src_c_replica = Layer::Create();
layer_src_root->AddChild(layer_src_a);
layer_src_root->AddChild(layer_src_b);
layer_src_b->AddChild(layer_src_c);
@@ -2247,7 +2225,7 @@
layer_src_root->ToLayerNodeProto(&proto);
Layer::LayerIdMap empty_dest_layer_map;
- scoped_refptr<Layer> layer_dest_root = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_dest_root = Layer::Create();
layer_dest_root->FromLayerNodeProto(proto, empty_dest_layer_map);
EXPECT_EQ(layer_src_root->id(), layer_dest_root->id());
@@ -2285,15 +2263,15 @@
The deserialization should then re-use the Layers from last
deserialization.
*/
- scoped_refptr<Layer> layer_src_root = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_a = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_src_root = Layer::Create();
+ scoped_refptr<Layer> layer_src_a = Layer::Create();
layer_src_root->AddChild(layer_src_a);
proto::LayerNode root_proto_1;
layer_src_root->ToLayerNodeProto(&root_proto_1);
Layer::LayerIdMap dest_layer_map_1;
- scoped_refptr<Layer> layer_dest_root = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_dest_root = Layer::Create();
layer_dest_root->FromLayerNodeProto(root_proto_1, dest_layer_map_1);
EXPECT_EQ(layer_src_root->id(), layer_dest_root->id());
@@ -2307,7 +2285,7 @@
dest_layer_map_2[layer_dest_a_1->id()] = layer_dest_a_1;
// Add Layer |b|.
- scoped_refptr<Layer> layer_src_b = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_src_b = Layer::Create();
layer_src_root->AddChild(layer_src_b);
// Second serialization.
@@ -2346,11 +2324,11 @@
d
Then the subtree rooted at node |b| is deleted in the next update.
*/
- scoped_refptr<Layer> layer_src_root = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_a = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_b = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_c = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_d = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_src_root = Layer::Create();
+ scoped_refptr<Layer> layer_src_a = Layer::Create();
+ scoped_refptr<Layer> layer_src_b = Layer::Create();
+ scoped_refptr<Layer> layer_src_c = Layer::Create();
+ scoped_refptr<Layer> layer_src_d = Layer::Create();
layer_src_root->AddChild(layer_src_a);
layer_src_root->AddChild(layer_src_b);
layer_src_b->AddChild(layer_src_c);
@@ -2362,7 +2340,7 @@
// Deserialization 1.
Layer::LayerIdMap empty_dest_layer_map;
- scoped_refptr<Layer> layer_dest_root = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_dest_root = Layer::Create();
layer_dest_root->FromLayerNodeProto(proto1, empty_dest_layer_map);
EXPECT_EQ(layer_src_root->id(), layer_dest_root->id());
@@ -2393,9 +2371,9 @@
}
TEST_F(LayerTest, DeleteMaskAndReplicaLayer) {
- scoped_refptr<Layer> layer_src_root = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_mask = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_replica = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_src_root = Layer::Create();
+ scoped_refptr<Layer> layer_src_mask = Layer::Create();
+ scoped_refptr<Layer> layer_src_replica = Layer::Create();
layer_src_root->SetMaskLayer(layer_src_mask.get());
layer_src_root->SetReplicaLayer(layer_src_replica.get());
@@ -2405,7 +2383,7 @@
// Deserialization 1.
Layer::LayerIdMap dest_layer_map;
- scoped_refptr<Layer> layer_dest_root = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_dest_root = Layer::Create();
layer_dest_root->FromLayerNodeProto(proto1, dest_layer_map);
EXPECT_EQ(layer_src_root->id(), layer_dest_root->id());
@@ -2480,13 +2458,13 @@
Layers marked with + have descendants with changed properties.
Layer b also has a mask layer and a replica layer.
*/
- scoped_refptr<Layer> layer_src_root = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_a = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_b = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_b_mask = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_b_replica = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_c = Layer::Create(LayerSettings());
- scoped_refptr<Layer> layer_src_d = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer_src_root = Layer::Create();
+ scoped_refptr<Layer> layer_src_a = Layer::Create();
+ scoped_refptr<Layer> layer_src_b = Layer::Create();
+ scoped_refptr<Layer> layer_src_b_mask = Layer::Create();
+ scoped_refptr<Layer> layer_src_b_replica = Layer::Create();
+ scoped_refptr<Layer> layer_src_c = Layer::Create();
+ scoped_refptr<Layer> layer_src_d = Layer::Create();
layer_src_root->AddChild(layer_src_a);
layer_src_root->AddChild(layer_src_b);
layer_src_a->AddChild(layer_src_c);
@@ -2589,7 +2567,7 @@
}
TEST_F(LayerSerializationTest, SimplePropertiesDeserialization) {
- scoped_refptr<Layer> layer = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> layer = Layer::Create();
layer->SetLayerTreeHost(layer_tree_host_.get());
proto::LayerProperties properties;
properties.set_id(layer->id());
@@ -2638,7 +2616,7 @@
}
TEST_F(LayerTest, ElementIdAndMutablePropertiesArePushed) {
- scoped_refptr<Layer> test_layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> test_layer = Layer::Create();
scoped_ptr<LayerImpl> impl_layer =
LayerImpl::Create(host_impl_.active_tree(), 1);
diff --git a/cc/layers/layer_utils_unittest.cc b/cc/layers/layer_utils_unittest.cc
index 6d16c5c..e915c41 100644
--- a/cc/layers/layer_utils_unittest.cc
+++ b/cc/layers/layer_utils_unittest.cc
@@ -25,18 +25,10 @@
return std::sqrt(width * width + height * height);
}
-class LayerTreeSettingsForAnimationBoundsTest : public LayerTreeSettings {
- public:
- LayerTreeSettingsForAnimationBoundsTest() {
- use_compositor_animation_timelines = true;
- }
-};
-
class LayerUtilsGetAnimationBoundsTest : public testing::Test {
public:
LayerUtilsGetAnimationBoundsTest()
- : host_impl_(LayerTreeSettingsForAnimationBoundsTest(),
- &task_runner_provider_,
+ : host_impl_(&task_runner_provider_,
&shared_bitmap_manager_,
&task_graph_runner_),
root_(CreateTwoForkTree(&host_impl_)),
diff --git a/cc/layers/nine_patch_layer.cc b/cc/layers/nine_patch_layer.cc
index 218f1da..e2dc92f 100644
--- a/cc/layers/nine_patch_layer.cc
+++ b/cc/layers/nine_patch_layer.cc
@@ -12,15 +12,12 @@
namespace cc {
-scoped_refptr<NinePatchLayer> NinePatchLayer::Create(
- const LayerSettings& settings) {
- return make_scoped_refptr(new NinePatchLayer(settings));
+scoped_refptr<NinePatchLayer> NinePatchLayer::Create() {
+ return make_scoped_refptr(new NinePatchLayer());
}
-NinePatchLayer::NinePatchLayer(const LayerSettings& settings)
- : UIResourceLayer(settings),
- fill_center_(false),
- nearest_neighbor_(false) {}
+NinePatchLayer::NinePatchLayer()
+ : UIResourceLayer(), fill_center_(false), nearest_neighbor_(false) {}
NinePatchLayer::~NinePatchLayer() {}
diff --git a/cc/layers/nine_patch_layer.h b/cc/layers/nine_patch_layer.h
index a2c37e10..20b5e49 100644
--- a/cc/layers/nine_patch_layer.h
+++ b/cc/layers/nine_patch_layer.h
@@ -20,7 +20,7 @@
class CC_EXPORT NinePatchLayer : public UIResourceLayer {
public:
- static scoped_refptr<NinePatchLayer> Create(const LayerSettings& settings);
+ static scoped_refptr<NinePatchLayer> Create();
void PushPropertiesTo(LayerImpl* layer) override;
@@ -42,7 +42,7 @@
void SetNearestNeighbor(bool nearest_neighbor);
private:
- explicit NinePatchLayer(const LayerSettings& settings);
+ NinePatchLayer();
~NinePatchLayer() override;
scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
diff --git a/cc/layers/nine_patch_layer_unittest.cc b/cc/layers/nine_patch_layer_unittest.cc
index 5f14c091..381c024 100644
--- a/cc/layers/nine_patch_layer_unittest.cc
+++ b/cc/layers/nine_patch_layer_unittest.cc
@@ -4,7 +4,6 @@
#include "cc/layers/nine_patch_layer.h"
-#include "cc/layers/layer_settings.h"
#include "cc/resources/resource_provider.h"
#include "cc/resources/scoped_ui_resource.h"
#include "cc/test/fake_layer_tree_host.h"
@@ -47,8 +46,7 @@
};
TEST_F(NinePatchLayerTest, SetLayerProperties) {
- scoped_refptr<NinePatchLayer> test_layer =
- NinePatchLayer::Create(LayerSettings());
+ scoped_refptr<NinePatchLayer> test_layer = NinePatchLayer::Create();
ASSERT_TRUE(test_layer.get());
test_layer->SetIsDrawable(true);
test_layer->SetBounds(gfx::Size(100, 100));
diff --git a/cc/layers/painted_scrollbar_layer.cc b/cc/layers/painted_scrollbar_layer.cc
index 8815abb..e0e0859 100644
--- a/cc/layers/painted_scrollbar_layer.cc
+++ b/cc/layers/painted_scrollbar_layer.cc
@@ -31,18 +31,15 @@
}
scoped_refptr<PaintedScrollbarLayer> PaintedScrollbarLayer::Create(
- const LayerSettings& settings,
scoped_ptr<Scrollbar> scrollbar,
int scroll_layer_id) {
- return make_scoped_refptr(new PaintedScrollbarLayer(
- settings, std::move(scrollbar), scroll_layer_id));
+ return make_scoped_refptr(
+ new PaintedScrollbarLayer(std::move(scrollbar), scroll_layer_id));
}
-PaintedScrollbarLayer::PaintedScrollbarLayer(const LayerSettings& settings,
- scoped_ptr<Scrollbar> scrollbar,
+PaintedScrollbarLayer::PaintedScrollbarLayer(scoped_ptr<Scrollbar> scrollbar,
int scroll_layer_id)
- : Layer(settings),
- scrollbar_(std::move(scrollbar)),
+ : scrollbar_(std::move(scrollbar)),
scroll_layer_id_(scroll_layer_id),
internal_contents_scale_(1.f),
thumb_thickness_(scrollbar_->ThumbThickness()),
diff --git a/cc/layers/painted_scrollbar_layer.h b/cc/layers/painted_scrollbar_layer.h
index 27dc2c3..1d452bcc 100644
--- a/cc/layers/painted_scrollbar_layer.h
+++ b/cc/layers/painted_scrollbar_layer.h
@@ -22,7 +22,6 @@
scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
static scoped_refptr<PaintedScrollbarLayer> Create(
- const LayerSettings& settings,
scoped_ptr<Scrollbar> scrollbar,
int scroll_layer_id);
@@ -45,9 +44,7 @@
}
protected:
- PaintedScrollbarLayer(const LayerSettings& settings,
- scoped_ptr<Scrollbar> scrollbar,
- int scroll_layer_id);
+ PaintedScrollbarLayer(scoped_ptr<Scrollbar> scrollbar, int scroll_layer_id);
~PaintedScrollbarLayer() override;
// For unit tests
diff --git a/cc/layers/painted_scrollbar_layer_unittest.cc b/cc/layers/painted_scrollbar_layer_unittest.cc
index d170e8e..f5b49b9 100644
--- a/cc/layers/painted_scrollbar_layer_unittest.cc
+++ b/cc/layers/painted_scrollbar_layer_unittest.cc
@@ -4,7 +4,6 @@
#include "cc/layers/painted_scrollbar_layer.h"
-#include "cc/layers/layer_settings.h"
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/fake_layer_tree_host_client.h"
#include "cc/test/fake_scrollbar.h"
@@ -31,7 +30,6 @@
FakeLayerTreeHostClient fake_client_(FakeLayerTreeHostClient::DIRECT_3D);
TestTaskGraphRunner task_graph_runner_;
scoped_ptr<FakeLayerTreeHost> layer_tree_host_;
- LayerSettings layer_settings_;
layer_tree_host_ =
FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_);
@@ -41,8 +39,7 @@
MockScrollbar* scrollbar = new MockScrollbar();
scoped_refptr<PaintedScrollbarLayer> scrollbar_layer =
- PaintedScrollbarLayer::Create(layer_settings_,
- scoped_ptr<Scrollbar>(scrollbar), 1);
+ PaintedScrollbarLayer::Create(scoped_ptr<Scrollbar>(scrollbar), 1);
scrollbar_layer->SetIsDrawable(true);
scrollbar_layer->SetBounds(gfx::Size(100, 100));
diff --git a/cc/layers/picture_image_layer.cc b/cc/layers/picture_image_layer.cc
index b5a55c2..05cbb0c 100644
--- a/cc/layers/picture_image_layer.cc
+++ b/cc/layers/picture_image_layer.cc
@@ -16,14 +16,11 @@
namespace cc {
-scoped_refptr<PictureImageLayer> PictureImageLayer::Create(
- const LayerSettings& settings) {
- return make_scoped_refptr(new PictureImageLayer(settings));
+scoped_refptr<PictureImageLayer> PictureImageLayer::Create() {
+ return make_scoped_refptr(new PictureImageLayer());
}
-PictureImageLayer::PictureImageLayer(const LayerSettings& settings)
- : PictureLayer(settings, this) {
-}
+PictureImageLayer::PictureImageLayer() : PictureLayer(this) {}
PictureImageLayer::~PictureImageLayer() {
ClearClient();
diff --git a/cc/layers/picture_image_layer.h b/cc/layers/picture_image_layer.h
index fd3c1a2..88dd2c9 100644
--- a/cc/layers/picture_image_layer.h
+++ b/cc/layers/picture_image_layer.h
@@ -20,7 +20,7 @@
class CC_EXPORT PictureImageLayer : public PictureLayer, ContentLayerClient {
public:
- static scoped_refptr<PictureImageLayer> Create(const LayerSettings& settings);
+ static scoped_refptr<PictureImageLayer> Create();
void SetImage(skia::RefPtr<const SkImage> image);
@@ -39,7 +39,7 @@
bool HasDrawableContent() const override;
private:
- explicit PictureImageLayer(const LayerSettings& settings);
+ PictureImageLayer();
~PictureImageLayer() override;
skia::RefPtr<const SkImage> image_;
diff --git a/cc/layers/picture_image_layer_unittest.cc b/cc/layers/picture_image_layer_unittest.cc
index b03ea22..a200731 100644
--- a/cc/layers/picture_image_layer_unittest.cc
+++ b/cc/layers/picture_image_layer_unittest.cc
@@ -4,7 +4,6 @@
#include "cc/layers/picture_image_layer.h"
-#include "cc/layers/layer_settings.h"
#include "cc/playback/display_item.h"
#include "cc/test/skia_common.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -17,8 +16,7 @@
namespace {
TEST(PictureImageLayerTest, PaintContentsToDisplayList) {
- scoped_refptr<PictureImageLayer> layer =
- PictureImageLayer::Create(LayerSettings());
+ scoped_refptr<PictureImageLayer> layer = PictureImageLayer::Create();
gfx::Rect layer_rect(200, 200);
unsigned char image_pixels[4 * 200 * 200] = {0};
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index f5285168..9d7ec69 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -19,25 +19,20 @@
namespace cc {
-scoped_refptr<PictureLayer> PictureLayer::Create(const LayerSettings& settings,
- ContentLayerClient* client) {
- return make_scoped_refptr(new PictureLayer(settings, client));
+scoped_refptr<PictureLayer> PictureLayer::Create(ContentLayerClient* client) {
+ return make_scoped_refptr(new PictureLayer(client));
}
-PictureLayer::PictureLayer(const LayerSettings& settings,
- ContentLayerClient* client)
- : Layer(settings),
- client_(client),
+PictureLayer::PictureLayer(ContentLayerClient* client)
+ : client_(client),
instrumentation_object_tracker_(id()),
update_source_frame_number_(-1),
is_mask_(false),
- nearest_neighbor_(false) {
-}
+ nearest_neighbor_(false) {}
-PictureLayer::PictureLayer(const LayerSettings& settings,
- ContentLayerClient* client,
+PictureLayer::PictureLayer(ContentLayerClient* client,
scoped_ptr<DisplayListRecordingSource> source)
- : PictureLayer(settings, client) {
+ : PictureLayer(client) {
recording_source_ = std::move(source);
}
diff --git a/cc/layers/picture_layer.h b/cc/layers/picture_layer.h
index b7e7152..248eee8 100644
--- a/cc/layers/picture_layer.h
+++ b/cc/layers/picture_layer.h
@@ -19,8 +19,7 @@
class CC_EXPORT PictureLayer : public Layer {
public:
- static scoped_refptr<PictureLayer> Create(const LayerSettings& settings,
- ContentLayerClient* client);
+ static scoped_refptr<PictureLayer> Create(ContentLayerClient* client);
void ClearClient();
@@ -45,10 +44,9 @@
}
protected:
- PictureLayer(const LayerSettings& settings, ContentLayerClient* client);
+ explicit PictureLayer(ContentLayerClient* client);
// Allow tests to inject a recording source.
- PictureLayer(const LayerSettings& settings,
- ContentLayerClient* client,
+ PictureLayer(ContentLayerClient* client,
scoped_ptr<DisplayListRecordingSource> source);
~PictureLayer() override;
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index 67a00a1..90800f2d 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -16,7 +16,6 @@
#include "base/thread_task_runner_handle.h"
#include "cc/base/math_util.h"
#include "cc/layers/append_quads_data.h"
-#include "cc/layers/layer_settings.h"
#include "cc/layers/picture_layer.h"
#include "cc/quads/draw_quad.h"
#include "cc/quads/tile_draw_quad.h"
@@ -400,7 +399,6 @@
FakePictureLayerImpl* pending_layer_;
FakePictureLayerImpl* old_pending_layer_;
FakePictureLayerImpl* active_layer_;
- LayerSettings layer_settings_;
private:
DISALLOW_COPY_AND_ASSIGN(PictureLayerImplTest);
@@ -4383,8 +4381,7 @@
FakeContentLayerClient client;
client.set_bounds(layer_bounds);
- scoped_refptr<PictureLayer> layer =
- PictureLayer::Create(layer_settings_, &client);
+ scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client);
FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D);
TestTaskGraphRunner task_graph_runner;
scoped_ptr<FakeLayerTreeHost> host =
@@ -4448,8 +4445,7 @@
FakeContentLayerClient client;
client.set_bounds(layer_bounds);
- scoped_refptr<PictureLayer> layer =
- PictureLayer::Create(layer_settings_, &client);
+ scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client);
FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D);
TestTaskGraphRunner task_graph_runner;
scoped_ptr<FakeLayerTreeHost> host =
diff --git a/cc/layers/picture_layer_unittest.cc b/cc/layers/picture_layer_unittest.cc
index a34e2f3..45a06105 100644
--- a/cc/layers/picture_layer_unittest.cc
+++ b/cc/layers/picture_layer_unittest.cc
@@ -10,7 +10,6 @@
#include "cc/layers/append_quads_data.h"
#include "cc/layers/content_layer_client.h"
#include "cc/layers/empty_content_layer_client.h"
-#include "cc/layers/layer_settings.h"
#include "cc/layers/picture_layer_impl.h"
#include "cc/playback/display_item_list_settings.h"
#include "cc/proto/layer.pb.h"
@@ -21,7 +20,6 @@
#include "cc/test/fake_picture_layer.h"
#include "cc/test/fake_picture_layer_impl.h"
#include "cc/test/fake_proxy.h"
-#include "cc/test/layer_tree_settings_for_testing.h"
#include "cc/test/skia_common.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/test/test_task_graph_runner.h"
@@ -35,7 +33,7 @@
static scoped_refptr<TestSerializationPictureLayer> Create(
const gfx::Size& recording_source_viewport) {
return make_scoped_refptr(new TestSerializationPictureLayer(
- LayerSettings(), EmptyContentLayerClient::GetInstance(),
+ EmptyContentLayerClient::GetInstance(),
FakeDisplayListRecordingSource::CreateFilledRecordingSource(
recording_source_viewport),
recording_source_viewport));
@@ -93,11 +91,10 @@
}
private:
- TestSerializationPictureLayer(const LayerSettings& settings,
- ContentLayerClient* client,
+ TestSerializationPictureLayer(ContentLayerClient* client,
scoped_ptr<DisplayListRecordingSource> source,
const gfx::Size& recording_source_viewport)
- : PictureLayer(settings, client, std::move(source)),
+ : PictureLayer(client, std::move(source)),
recording_source_viewport_(recording_source_viewport) {}
~TestSerializationPictureLayer() override {}
@@ -144,15 +141,13 @@
TEST(PictureLayerTest, TestSerializationDeserialization) {
FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D);
TestTaskGraphRunner task_graph_runner;
- LayerTreeSettings settings;
- settings.use_compositor_animation_timelines = true;
scoped_ptr<FakeImageSerializationProcessor>
fake_image_serialization_processor =
make_scoped_ptr(new FakeImageSerializationProcessor);
- scoped_ptr<FakeLayerTreeHost> host =
- FakeLayerTreeHost::Create(&host_client, &task_graph_runner, settings,
- CompositorMode::SINGLE_THREADED,
- fake_image_serialization_processor.get());
+ scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(
+ &host_client, &task_graph_runner, LayerTreeSettings(),
+ CompositorMode::SINGLE_THREADED,
+ fake_image_serialization_processor.get());
gfx::Size recording_source_viewport(256, 256);
scoped_refptr<TestSerializationPictureLayer> layer =
TestSerializationPictureLayer::Create(recording_source_viewport);
@@ -183,8 +178,7 @@
TEST(PictureLayerTest, NoTilesIfEmptyBounds) {
ContentLayerClient* client = EmptyContentLayerClient::GetInstance();
- scoped_refptr<PictureLayer> layer =
- PictureLayer::Create(LayerSettings(), client);
+ scoped_refptr<PictureLayer> layer = PictureLayer::Create(client);
layer->SetBounds(gfx::Size(10, 10));
FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D);
@@ -211,7 +205,7 @@
scoped_ptr<FakeOutputSurface> output_surface =
FakeOutputSurface::CreateSoftware(
make_scoped_ptr(new SoftwareOutputDevice));
- FakeLayerTreeHostImpl host_impl(LayerTreeSettingsForTesting(),
+ FakeLayerTreeHostImpl host_impl(LayerTreeSettings(),
&impl_task_runner_provider,
&shared_bitmap_manager, &task_graph_runner);
host_impl.InitializeRenderer(output_surface.get());
@@ -232,8 +226,7 @@
client.set_bounds(layer_size);
skia::RefPtr<SkImage> image = CreateDiscardableImage(layer_size);
client.add_draw_image(image.get(), gfx::Point(), SkPaint());
- scoped_refptr<PictureLayer> layer =
- PictureLayer::Create(LayerSettings(), &client);
+ scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client);
layer->SetBounds(gfx::Size(10, 10));
FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D);
@@ -256,7 +249,7 @@
TestSharedBitmapManager shared_bitmap_manager;
scoped_ptr<OutputSurface> output_surface(FakeOutputSurface::Create3d());
- LayerTreeSettings layer_tree_settings = LayerTreeSettingsForTesting();
+ LayerTreeSettings layer_tree_settings = LayerTreeSettings();
layer_tree_settings.image_decode_tasks_enabled = true;
FakeLayerTreeHostImpl host_impl(layer_tree_settings,
&impl_task_runner_provider,
@@ -314,7 +307,7 @@
ContentLayerClient* client = EmptyContentLayerClient::GetInstance();
scoped_refptr<FakePictureLayer> layer =
FakePictureLayer::CreateWithRecordingSource(
- LayerSettings(), client, std::move(recording_source_owned));
+ client, std::move(recording_source_owned));
FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D);
TestTaskGraphRunner task_graph_runner;
@@ -345,7 +338,7 @@
// non-monotonically. This executes that code path under this scenario allowing
// for the code to verify correctness with DCHECKs.
TEST(PictureLayerTest, NonMonotonicSourceFrameNumber) {
- LayerTreeSettingsForTesting settings;
+ LayerTreeSettings settings;
settings.single_thread_proxy_scheduler = false;
settings.use_zero_copy = true;
@@ -355,8 +348,7 @@
TestTaskGraphRunner task_graph_runner;
ContentLayerClient* client = EmptyContentLayerClient::GetInstance();
- scoped_refptr<FakePictureLayer> layer =
- FakePictureLayer::Create(LayerSettings(), client);
+ scoped_refptr<FakePictureLayer> layer = FakePictureLayer::Create(client);
LayerTreeHost::InitParams params;
params.client = &host_client1;
diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc
index a592c50..7288882 100644
--- a/cc/layers/scrollbar_layer_unittest.cc
+++ b/cc/layers/scrollbar_layer_unittest.cc
@@ -37,24 +37,22 @@
namespace cc {
namespace {
-LayerImpl* LayerImplForScrollAreaAndScrollbar(const LayerSettings& settings,
- FakeLayerTreeHost* host,
+LayerImpl* LayerImplForScrollAreaAndScrollbar(FakeLayerTreeHost* host,
scoped_ptr<Scrollbar> scrollbar,
bool reverse_order,
bool use_solid_color_scrollbar,
int thumb_thickness,
int track_start) {
- scoped_refptr<Layer> layer_tree_root = Layer::Create(settings);
- scoped_refptr<Layer> child1 = Layer::Create(settings);
+ scoped_refptr<Layer> layer_tree_root = Layer::Create();
+ scoped_refptr<Layer> child1 = Layer::Create();
scoped_refptr<Layer> child2;
if (use_solid_color_scrollbar) {
const bool kIsLeftSideVerticalScrollbar = false;
child2 = SolidColorScrollbarLayer::Create(
- settings, scrollbar->Orientation(), thumb_thickness, track_start,
+ scrollbar->Orientation(), thumb_thickness, track_start,
kIsLeftSideVerticalScrollbar, child1->id());
} else {
- child2 = PaintedScrollbarLayer::Create(settings, std::move(scrollbar),
- child1->id());
+ child2 = PaintedScrollbarLayer::Create(std::move(scrollbar), child1->id());
}
layer_tree_root->AddChild(child1);
layer_tree_root->InsertChild(child2, reverse_order ? 0 : 1);
@@ -139,13 +137,10 @@
EXPECT_FALSE(layer_tree_host_->output_surface_lost());
}
- const LayerSettings& layer_settings() { return layer_settings_; }
-
protected:
FakeLayerTreeHostClient fake_client_;
TestTaskGraphRunner task_graph_runner_;
LayerTreeSettings layer_tree_settings_;
- LayerSettings layer_settings_;
scoped_ptr<FakeResourceTrackingLayerTreeHost> layer_tree_host_;
};
@@ -153,8 +148,7 @@
// Create and attach a non-overlay scrollbar.
scoped_ptr<Scrollbar> scrollbar(new FakeScrollbar);
LayerImpl* layer_impl_tree_root = LayerImplForScrollAreaAndScrollbar(
- layer_settings(), layer_tree_host_.get(), std::move(scrollbar), false,
- false, 0, 0);
+ layer_tree_host_.get(), std::move(scrollbar), false, false, 0, 0);
PaintedScrollbarLayerImpl* scrollbar_layer_impl =
static_cast<PaintedScrollbarLayerImpl*>(
layer_impl_tree_root->children()[1].get());
@@ -177,8 +171,7 @@
scrollbar.reset(new FakeScrollbar(false, false, true));
layer_impl_tree_root = LayerImplForScrollAreaAndScrollbar(
- layer_settings(), layer_tree_host_.get(), std::move(scrollbar), false,
- false, 0, 0);
+ layer_tree_host_.get(), std::move(scrollbar), false, false, 0, 0);
scrollbar_layer_impl = static_cast<PaintedScrollbarLayerImpl*>(
layer_impl_tree_root->children()[1].get());
layer_impl_tree_root->layer_tree_impl()->BuildPropertyTreesForTesting();
@@ -197,11 +190,11 @@
TEST_F(ScrollbarLayerTest, ScrollOffsetSynchronization) {
scoped_ptr<Scrollbar> scrollbar(new FakeScrollbar);
- scoped_refptr<Layer> layer_tree_root = Layer::Create(layer_settings());
- scoped_refptr<Layer> scroll_layer = Layer::Create(layer_settings());
- scoped_refptr<Layer> content_layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> layer_tree_root = Layer::Create();
+ scoped_refptr<Layer> scroll_layer = Layer::Create();
+ scoped_refptr<Layer> content_layer = Layer::Create();
scoped_refptr<Layer> scrollbar_layer = PaintedScrollbarLayer::Create(
- layer_settings(), std::move(scrollbar), layer_tree_root->id());
+ std::move(scrollbar), layer_tree_root->id());
// Choose bounds to give max_scroll_offset = (30, 50).
layer_tree_root->SetBounds(gfx::Size(70, 150));
@@ -265,12 +258,11 @@
} while (false)
TEST_F(ScrollbarLayerTest, UpdatePropertiesOfScrollBarWhenThumbRemoved) {
- scoped_refptr<Layer> root_clip_layer = Layer::Create(layer_settings());
- scoped_refptr<Layer> root_layer = Layer::Create(layer_settings());
- scoped_refptr<Layer> content_layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root_clip_layer = Layer::Create();
+ scoped_refptr<Layer> root_layer = Layer::Create();
+ scoped_refptr<Layer> content_layer = Layer::Create();
scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer =
- FakePaintedScrollbarLayer::Create(layer_settings(), false, true,
- root_layer->id());
+ FakePaintedScrollbarLayer::Create(false, true, root_layer->id());
root_layer->SetScrollClipLayerId(root_clip_layer->id());
// Give the root-clip a size that will result in MaxScrollOffset = (80, 0).
@@ -306,12 +298,11 @@
}
TEST_F(ScrollbarLayerTest, ThumbRect) {
- scoped_refptr<Layer> root_clip_layer = Layer::Create(layer_settings());
- scoped_refptr<Layer> root_layer = Layer::Create(layer_settings());
- scoped_refptr<Layer> content_layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root_clip_layer = Layer::Create();
+ scoped_refptr<Layer> root_layer = Layer::Create();
+ scoped_refptr<Layer> content_layer = Layer::Create();
scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer =
- FakePaintedScrollbarLayer::Create(layer_settings(), false, true,
- root_layer->id());
+ FakePaintedScrollbarLayer::Create(false, true, root_layer->id());
root_layer->SetScrollClipLayerId(root_clip_layer->id());
// Give the root-clip a size that will result in MaxScrollOffset = (80, 0).
@@ -391,8 +382,8 @@
scoped_ptr<Scrollbar> scrollbar(new FakeScrollbar(false, true, true));
LayerImpl* layer_impl_tree_root = LayerImplForScrollAreaAndScrollbar(
- layer_settings(), layer_tree_host_.get(), std::move(scrollbar), false,
- true, kThumbThickness, kTrackStart);
+ layer_tree_host_.get(), std::move(scrollbar), false, true,
+ kThumbThickness, kTrackStart);
ScrollbarLayerImplBase* scrollbar_layer_impl =
static_cast<SolidColorScrollbarLayerImpl*>(
layer_impl_tree_root->children()[1].get());
@@ -452,15 +443,15 @@
scoped_ptr<Scrollbar> scrollbar(new FakeScrollbar(false, true, true));
{
- scoped_refptr<Layer> layer_tree_root = Layer::Create(layer_settings());
- scoped_refptr<Layer> scroll_layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> layer_tree_root = Layer::Create();
+ scoped_refptr<Layer> scroll_layer = Layer::Create();
scroll_layer->SetScrollClipLayerId(layer_tree_root->id());
- scoped_refptr<Layer> child1 = Layer::Create(layer_settings());
+ scoped_refptr<Layer> child1 = Layer::Create();
scoped_refptr<Layer> child2;
const bool kIsLeftSideVerticalScrollbar = false;
child2 = SolidColorScrollbarLayer::Create(
- layer_settings(), scrollbar->Orientation(), kThumbThickness,
- kTrackStart, kIsLeftSideVerticalScrollbar, child1->id());
+ scrollbar->Orientation(), kThumbThickness, kTrackStart,
+ kIsLeftSideVerticalScrollbar, child1->id());
child2->ToScrollbarLayer()->SetScrollLayer(scroll_layer->id());
scroll_layer->AddChild(child1);
scroll_layer->InsertChild(child2, 1);
@@ -612,12 +603,12 @@
void SetScrollbarBounds(const gfx::Size& bounds) { bounds_ = bounds; }
void BeginTest() override {
- scroll_layer_ = Layer::Create(layer_settings());
+ scroll_layer_ = Layer::Create();
layer_tree_host()->root_layer()->AddChild(scroll_layer_);
scoped_ptr<Scrollbar> scrollbar(new FakeScrollbar);
- scrollbar_layer_ = PaintedScrollbarLayer::Create(
- layer_settings(), std::move(scrollbar), scroll_layer_->id());
+ scrollbar_layer_ = PaintedScrollbarLayer::Create(std::move(scrollbar),
+ scroll_layer_->id());
scrollbar_layer_->SetScrollLayer(scroll_layer_->id());
scrollbar_layer_->SetLayerTreeHost(layer_tree_host());
scrollbar_layer_->SetBounds(bounds_);
@@ -676,19 +667,19 @@
int expected_deleted,
bool use_solid_color_scrollbar) {
scoped_ptr<Scrollbar> scrollbar(new FakeScrollbar(false, true, false));
- scoped_refptr<Layer> layer_tree_root = Layer::Create(layer_settings());
- scoped_refptr<Layer> content_layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> layer_tree_root = Layer::Create();
+ scoped_refptr<Layer> content_layer = Layer::Create();
scoped_refptr<Layer> scrollbar_layer;
if (use_solid_color_scrollbar) {
const int kThumbThickness = 3;
const int kTrackStart = 0;
const bool kIsLeftSideVerticalScrollbar = false;
scrollbar_layer = SolidColorScrollbarLayer::Create(
- layer_settings(), scrollbar->Orientation(), kThumbThickness,
- kTrackStart, kIsLeftSideVerticalScrollbar, layer_tree_root->id());
+ scrollbar->Orientation(), kThumbThickness, kTrackStart,
+ kIsLeftSideVerticalScrollbar, layer_tree_root->id());
} else {
- scrollbar_layer = PaintedScrollbarLayer::Create(
- layer_settings(), std::move(scrollbar), layer_tree_root->id());
+ scrollbar_layer = PaintedScrollbarLayer::Create(std::move(scrollbar),
+ layer_tree_root->id());
}
layer_tree_root->AddChild(content_layer);
layer_tree_root->AddChild(scrollbar_layer);
@@ -741,11 +732,10 @@
TEST_F(ScrollbarLayerTestResourceCreationAndRelease, TestResourceUpdate) {
gfx::Point scrollbar_location(0, 185);
- scoped_refptr<Layer> layer_tree_root = Layer::Create(layer_settings());
- scoped_refptr<Layer> content_layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> layer_tree_root = Layer::Create();
+ scoped_refptr<Layer> content_layer = Layer::Create();
scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer =
- FakePaintedScrollbarLayer::Create(layer_settings(), false, true,
- layer_tree_root->id());
+ FakePaintedScrollbarLayer::Create(false, true, layer_tree_root->id());
layer_tree_root->AddChild(content_layer);
layer_tree_root->AddChild(scrollbar_layer);
@@ -884,11 +874,10 @@
public:
void TestResourceUpload(const float test_scale) {
gfx::Point scrollbar_location(0, 185);
- scoped_refptr<Layer> layer_tree_root = Layer::Create(layer_settings());
- scoped_refptr<Layer> content_layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> layer_tree_root = Layer::Create();
+ scoped_refptr<Layer> content_layer = Layer::Create();
scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer =
- FakePaintedScrollbarLayer::Create(layer_settings(), false, true,
- layer_tree_root->id());
+ FakePaintedScrollbarLayer::Create(false, true, layer_tree_root->id());
layer_tree_root->AddChild(content_layer);
layer_tree_root->AddChild(scrollbar_layer);
@@ -956,10 +945,10 @@
void TestScale(const gfx::Rect scrollbar_rect, const float test_scale) {
bool paint_during_update = true;
bool has_thumb = false;
- scoped_refptr<Layer> layer_tree_root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> layer_tree_root = Layer::Create();
scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer =
- FakePaintedScrollbarLayer::Create(layer_settings(), paint_during_update,
- has_thumb, layer_tree_root->id());
+ FakePaintedScrollbarLayer::Create(paint_during_update, has_thumb,
+ layer_tree_root->id());
layer_tree_root->AddChild(scrollbar_layer);
diff --git a/cc/layers/solid_color_layer.cc b/cc/layers/solid_color_layer.cc
index 2fbaca16..176f1e30 100644
--- a/cc/layers/solid_color_layer.cc
+++ b/cc/layers/solid_color_layer.cc
@@ -13,14 +13,11 @@
return SolidColorLayerImpl::Create(tree_impl, id());
}
-scoped_refptr<SolidColorLayer> SolidColorLayer::Create(
- const LayerSettings& settings) {
- return make_scoped_refptr(new SolidColorLayer(settings));
+scoped_refptr<SolidColorLayer> SolidColorLayer::Create() {
+ return make_scoped_refptr(new SolidColorLayer());
}
-SolidColorLayer::SolidColorLayer(const LayerSettings& settings)
- : Layer(settings) {
-}
+SolidColorLayer::SolidColorLayer() {}
SolidColorLayer::~SolidColorLayer() {}
diff --git a/cc/layers/solid_color_layer.h b/cc/layers/solid_color_layer.h
index 9a16f1a..d1f108a6 100644
--- a/cc/layers/solid_color_layer.h
+++ b/cc/layers/solid_color_layer.h
@@ -16,14 +16,14 @@
// SetBackgroundColor() on the base class.
class CC_EXPORT SolidColorLayer : public Layer {
public:
- static scoped_refptr<SolidColorLayer> Create(const LayerSettings& settings);
+ static scoped_refptr<SolidColorLayer> Create();
scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
void SetBackgroundColor(SkColor color) override;
protected:
- explicit SolidColorLayer(const LayerSettings& settings);
+ SolidColorLayer();
private:
~SolidColorLayer() override;
diff --git a/cc/layers/solid_color_layer_impl_unittest.cc b/cc/layers/solid_color_layer_impl_unittest.cc
index a4d1bfa7..9ad01f20 100644
--- a/cc/layers/solid_color_layer_impl_unittest.cc
+++ b/cc/layers/solid_color_layer_impl_unittest.cc
@@ -9,7 +9,6 @@
#include <vector>
#include "cc/layers/append_quads_data.h"
-#include "cc/layers/layer_settings.h"
#include "cc/layers/solid_color_layer.h"
#include "cc/quads/solid_color_draw_quad.h"
#include "cc/test/fake_impl_task_runner_provider.h"
@@ -134,14 +133,11 @@
gfx::Size layer_size = gfx::Size(100, 100);
gfx::Rect visible_layer_rect = gfx::Rect(layer_size);
- LayerSettings layer_settings;
-
- scoped_refptr<SolidColorLayer> layer =
- SolidColorLayer::Create(layer_settings);
+ scoped_refptr<SolidColorLayer> layer = SolidColorLayer::Create();
layer->SetBounds(layer_size);
layer->SetForceRenderSurface(true);
- scoped_refptr<Layer> root = Layer::Create(layer_settings);
+ scoped_refptr<Layer> root = Layer::Create();
root->AddChild(layer);
FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D);
diff --git a/cc/layers/solid_color_scrollbar_layer.cc b/cc/layers/solid_color_scrollbar_layer.cc
index 62a3180..9df9167c 100644
--- a/cc/layers/solid_color_scrollbar_layer.cc
+++ b/cc/layers/solid_color_scrollbar_layer.cc
@@ -23,31 +23,27 @@
}
scoped_refptr<SolidColorScrollbarLayer> SolidColorScrollbarLayer::Create(
- const LayerSettings& settings,
ScrollbarOrientation orientation,
int thumb_thickness,
int track_start,
bool is_left_side_vertical_scrollbar,
int scroll_layer_id) {
return make_scoped_refptr(new SolidColorScrollbarLayer(
- settings, orientation, thumb_thickness, track_start,
+ orientation, thumb_thickness, track_start,
is_left_side_vertical_scrollbar, scroll_layer_id));
}
SolidColorScrollbarLayer::SolidColorScrollbarLayer(
- const LayerSettings& settings,
ScrollbarOrientation orientation,
int thumb_thickness,
int track_start,
bool is_left_side_vertical_scrollbar,
int scroll_layer_id)
- : Layer(settings),
- scroll_layer_id_(Layer::INVALID_ID),
+ : scroll_layer_id_(Layer::INVALID_ID),
orientation_(orientation),
thumb_thickness_(thumb_thickness),
track_start_(track_start),
- is_left_side_vertical_scrollbar_(is_left_side_vertical_scrollbar) {
-}
+ is_left_side_vertical_scrollbar_(is_left_side_vertical_scrollbar) {}
SolidColorScrollbarLayer::~SolidColorScrollbarLayer() {}
diff --git a/cc/layers/solid_color_scrollbar_layer.h b/cc/layers/solid_color_scrollbar_layer.h
index 8f0c00c..1ed52ef 100644
--- a/cc/layers/solid_color_scrollbar_layer.h
+++ b/cc/layers/solid_color_scrollbar_layer.h
@@ -18,7 +18,6 @@
scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
static scoped_refptr<SolidColorScrollbarLayer> Create(
- const LayerSettings& settings,
ScrollbarOrientation orientation,
int thumb_thickness,
int track_start,
@@ -40,8 +39,7 @@
ScrollbarOrientation orientation() const override;
protected:
- SolidColorScrollbarLayer(const LayerSettings& settings,
- ScrollbarOrientation orientation,
+ SolidColorScrollbarLayer(ScrollbarOrientation orientation,
int thumb_thickness,
int track_start,
bool is_left_side_vertical_scrollbar,
diff --git a/cc/layers/surface_layer.cc b/cc/layers/surface_layer.cc
index 71ceb46..f31a8ae 100644
--- a/cc/layers/surface_layer.cc
+++ b/cc/layers/surface_layer.cc
@@ -40,21 +40,17 @@
};
scoped_refptr<SurfaceLayer> SurfaceLayer::Create(
- const LayerSettings& settings,
const SatisfyCallback& satisfy_callback,
const RequireCallback& require_callback) {
return make_scoped_refptr(
- new SurfaceLayer(settings, satisfy_callback, require_callback));
+ new SurfaceLayer(satisfy_callback, require_callback));
}
-SurfaceLayer::SurfaceLayer(const LayerSettings& settings,
- const SatisfyCallback& satisfy_callback,
+SurfaceLayer::SurfaceLayer(const SatisfyCallback& satisfy_callback,
const RequireCallback& require_callback)
- : Layer(settings),
- surface_scale_(1.f),
+ : surface_scale_(1.f),
satisfy_callback_(satisfy_callback),
- require_callback_(require_callback) {
-}
+ require_callback_(require_callback) {}
SurfaceLayer::~SurfaceLayer() {
DCHECK(!layer_tree_host());
diff --git a/cc/layers/surface_layer.h b/cc/layers/surface_layer.h
index c2e8a2d0..b4166d3 100644
--- a/cc/layers/surface_layer.h
+++ b/cc/layers/surface_layer.h
@@ -28,7 +28,6 @@
using RequireCallback = base::Callback<void(SurfaceId, SurfaceSequence)>;
static scoped_refptr<SurfaceLayer> Create(
- const LayerSettings& settings,
const SatisfyCallback& satisfy_callback,
const RequireCallback& require_callback);
@@ -40,8 +39,7 @@
void PushPropertiesTo(LayerImpl* layer) override;
protected:
- SurfaceLayer(const LayerSettings& settings,
- const SatisfyCallback& satisfy_callback,
+ SurfaceLayer(const SatisfyCallback& satisfy_callback,
const RequireCallback& require_callback);
bool HasDrawableContent() const override;
diff --git a/cc/layers/surface_layer_unittest.cc b/cc/layers/surface_layer_unittest.cc
index 2f8d5cd..0c15b5c3 100644
--- a/cc/layers/surface_layer_unittest.cc
+++ b/cc/layers/surface_layer_unittest.cc
@@ -49,7 +49,6 @@
FakeLayerTreeHostClient fake_client_;
TestTaskGraphRunner task_graph_runner_;
scoped_ptr<FakeLayerTreeHost> layer_tree_host_;
- LayerSettings layer_settings_;
};
void SatisfyCallback(SurfaceSequence* out, SurfaceSequence in) {
@@ -72,7 +71,7 @@
SurfaceId required_id;
std::set<SurfaceSequence> required_seq;
scoped_refptr<SurfaceLayer> layer(SurfaceLayer::Create(
- layer_settings_, base::Bind(&SatisfyCallback, &blank_change),
+ base::Bind(&SatisfyCallback, &blank_change),
base::Bind(&RequireCallback, &required_id, &required_seq)));
layer->SetSurfaceId(SurfaceId(1), 1.f, gfx::Size(1, 1));
layer_tree_host_->set_surface_id_namespace(1);
@@ -81,7 +80,7 @@
scoped_ptr<FakeLayerTreeHost> layer_tree_host2 =
FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_);
scoped_refptr<SurfaceLayer> layer2(SurfaceLayer::Create(
- layer_settings_, base::Bind(&SatisfyCallback, &blank_change),
+ base::Bind(&SatisfyCallback, &blank_change),
base::Bind(&RequireCallback, &required_id, &required_seq)));
layer2->SetSurfaceId(SurfaceId(1), 1.f, gfx::Size(1, 1));
layer_tree_host2->set_surface_id_namespace(2);
@@ -128,7 +127,7 @@
void BeginTest() override {
layer_tree_host()->set_surface_id_namespace(1);
layer_ = SurfaceLayer::Create(
- layer_settings(), base::Bind(&SatisfyCallback, &satisfied_sequence_),
+ base::Bind(&SatisfyCallback, &satisfied_sequence_),
base::Bind(&RequireCallback, &required_id_, &required_set_));
layer_->SetSurfaceId(SurfaceId(1), 1.f, gfx::Size(1, 1));
@@ -146,7 +145,7 @@
gfx::Size bounds(100, 100);
layer_tree_host()->SetViewportSize(bounds);
- blank_layer_ = SolidColorLayer::Create(layer_settings());
+ blank_layer_ = SolidColorLayer::Create();
blank_layer_->SetIsDrawable(true);
blank_layer_->SetBounds(gfx::Size(10, 10));
diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc
index 85df0f2..a656955 100644
--- a/cc/layers/texture_layer.cc
+++ b/cc/layers/texture_layer.cc
@@ -20,15 +20,12 @@
namespace cc {
scoped_refptr<TextureLayer> TextureLayer::CreateForMailbox(
- const LayerSettings& settings,
TextureLayerClient* client) {
- return scoped_refptr<TextureLayer>(new TextureLayer(settings, client));
+ return scoped_refptr<TextureLayer>(new TextureLayer(client));
}
-TextureLayer::TextureLayer(const LayerSettings& settings,
- TextureLayerClient* client)
- : Layer(settings),
- client_(client),
+TextureLayer::TextureLayer(TextureLayerClient* client)
+ : client_(client),
flipped_(true),
nearest_neighbor_(false),
uv_top_left_(0.f, 0.f),
diff --git a/cc/layers/texture_layer.h b/cc/layers/texture_layer.h
index 6b529dd..3601b23 100644
--- a/cc/layers/texture_layer.h
+++ b/cc/layers/texture_layer.h
@@ -91,7 +91,6 @@
// Used when mailbox names are specified instead of texture IDs.
static scoped_refptr<TextureLayer> CreateForMailbox(
- const LayerSettings& settings,
TextureLayerClient* client);
// Resets the client, which also resets the texture.
@@ -146,7 +145,7 @@
void PushPropertiesTo(LayerImpl* layer) override;
protected:
- TextureLayer(const LayerSettings& settings, TextureLayerClient* client);
+ explicit TextureLayer(TextureLayerClient* client);
~TextureLayer() override;
bool HasDrawableContent() const override;
diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc
index 6b28008..b02dd52c 100644
--- a/cc/layers/texture_layer_unittest.cc
+++ b/cc/layers/texture_layer_unittest.cc
@@ -235,12 +235,11 @@
scoped_ptr<OutputSurface> output_surface_;
FakeLayerTreeHostImpl host_impl_;
CommonMailboxObjects test_data_;
- LayerSettings layer_settings_;
};
TEST_F(TextureLayerTest, CheckPropertyChangeCausesCorrectBehavior) {
scoped_refptr<TextureLayer> test_layer =
- TextureLayer::CreateForMailbox(layer_settings_, nullptr);
+ TextureLayer::CreateForMailbox(nullptr);
EXPECT_SET_NEEDS_COMMIT(1, layer_tree_host_->SetRootLayer(test_layer));
// Test properties that should call SetNeedsCommit. All properties need to
@@ -277,7 +276,7 @@
TEST_F(TextureLayerWithMailboxTest, ReplaceMailboxOnMainThreadBeforeCommit) {
scoped_refptr<TextureLayer> test_layer =
- TextureLayer::CreateForMailbox(layer_settings_, nullptr);
+ TextureLayer::CreateForMailbox(nullptr);
ASSERT_TRUE(test_layer.get());
EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(AnyNumber());
@@ -334,7 +333,7 @@
TEST_F(TextureLayerTest, SetTextureMailboxWithoutReleaseCallback) {
scoped_refptr<TextureLayer> test_layer =
- TextureLayer::CreateForMailbox(layer_settings_, nullptr);
+ TextureLayer::CreateForMailbox(nullptr);
ASSERT_TRUE(test_layer.get());
// These use the same gpu::Mailbox, but different sync points.
@@ -416,7 +415,7 @@
TEST_F(TextureLayerMailboxHolderTest, TwoCompositors_BothReleaseThenMain) {
scoped_refptr<TextureLayer> test_layer =
- TextureLayer::CreateForMailbox(layer_settings_, nullptr);
+ TextureLayer::CreateForMailbox(nullptr);
ASSERT_TRUE(test_layer.get());
main_thread_.message_loop()->task_runner()->PostTask(
@@ -469,7 +468,7 @@
TEST_F(TextureLayerMailboxHolderTest, TwoCompositors_MainReleaseBetween) {
scoped_refptr<TextureLayer> test_layer =
- TextureLayer::CreateForMailbox(layer_settings_, nullptr);
+ TextureLayer::CreateForMailbox(nullptr);
ASSERT_TRUE(test_layer.get());
main_thread_.message_loop()->task_runner()->PostTask(
@@ -523,7 +522,7 @@
TEST_F(TextureLayerMailboxHolderTest, TwoCompositors_MainReleasedFirst) {
scoped_refptr<TextureLayer> test_layer =
- TextureLayer::CreateForMailbox(layer_settings_, nullptr);
+ TextureLayer::CreateForMailbox(nullptr);
ASSERT_TRUE(test_layer.get());
main_thread_.message_loop()->task_runner()->PostTask(
@@ -577,7 +576,7 @@
TEST_F(TextureLayerMailboxHolderTest, TwoCompositors_SecondImplRefShortcut) {
scoped_refptr<TextureLayer> test_layer =
- TextureLayer::CreateForMailbox(layer_settings_, nullptr);
+ TextureLayer::CreateForMailbox(nullptr);
ASSERT_TRUE(test_layer.get());
main_thread_.message_loop()->task_runner()->PostTask(
@@ -680,10 +679,10 @@
EXPECT_EQ(true, main_thread_.CalledOnValidThread());
gfx::Size bounds(100, 100);
- root_ = Layer::Create(layer_settings());
+ root_ = Layer::Create();
root_->SetBounds(bounds);
- layer_ = TextureLayer::CreateForMailbox(layer_settings(), nullptr);
+ layer_ = TextureLayer::CreateForMailbox(nullptr);
layer_->SetIsDrawable(true);
layer_->SetBounds(bounds);
@@ -797,10 +796,10 @@
void BeginTest() override {
gfx::Size bounds(100, 100);
- root_ = Layer::Create(layer_settings());
+ root_ = Layer::Create();
root_->SetBounds(bounds);
- layer_ = TextureLayer::CreateForMailbox(layer_settings(), nullptr);
+ layer_ = TextureLayer::CreateForMailbox(nullptr);
layer_->SetIsDrawable(true);
layer_->SetBounds(bounds);
@@ -1095,11 +1094,11 @@
}
void SetupTree() override {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(10, 10));
root->SetIsDrawable(true);
- texture_layer_ = TextureLayer::CreateForMailbox(layer_settings(), this);
+ texture_layer_ = TextureLayer::CreateForMailbox(this);
texture_layer_->SetBounds(gfx::Size(10, 10));
texture_layer_->SetIsDrawable(true);
root->AddChild(texture_layer_);
@@ -1193,22 +1192,22 @@
}
void SetupTree() override {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(10, 10));
root->SetIsDrawable(true);
- solid_layer_ = SolidColorLayer::Create(layer_settings());
+ solid_layer_ = SolidColorLayer::Create();
solid_layer_->SetBounds(gfx::Size(10, 10));
solid_layer_->SetIsDrawable(true);
solid_layer_->SetBackgroundColor(SK_ColorWHITE);
root->AddChild(solid_layer_);
- parent_layer_ = Layer::Create(layer_settings());
+ parent_layer_ = Layer::Create();
parent_layer_->SetBounds(gfx::Size(10, 10));
parent_layer_->SetIsDrawable(true);
root->AddChild(parent_layer_);
- texture_layer_ = TextureLayer::CreateForMailbox(layer_settings(), this);
+ texture_layer_ = TextureLayer::CreateForMailbox(this);
texture_layer_->SetBounds(gfx::Size(10, 10));
texture_layer_->SetIsDrawable(true);
parent_layer_->AddChild(texture_layer_);
@@ -1324,7 +1323,7 @@
LayerTreeTest::SetupTree();
scoped_refptr<TextureLayer> texture_layer =
- TextureLayer::CreateForMailbox(layer_settings(), this);
+ TextureLayer::CreateForMailbox(this);
texture_layer->SetBounds(gfx::Size(10, 10));
texture_layer->SetIsDrawable(true);
@@ -1390,10 +1389,10 @@
void SetupTree() override {
gfx::Size bounds(100, 100);
- root_ = Layer::Create(layer_settings());
+ root_ = Layer::Create();
root_->SetBounds(bounds);
- layer_ = TextureLayer::CreateForMailbox(layer_settings(), nullptr);
+ layer_ = TextureLayer::CreateForMailbox(nullptr);
layer_->SetIsDrawable(true);
layer_->SetBounds(bounds);
@@ -1461,10 +1460,10 @@
void SetupTree() override {
gfx::Size bounds(100, 100);
- root_ = Layer::Create(layer_settings());
+ root_ = Layer::Create();
root_->SetBounds(bounds);
- layer_ = TextureLayer::CreateForMailbox(layer_settings(), nullptr);
+ layer_ = TextureLayer::CreateForMailbox(nullptr);
layer_->SetIsDrawable(true);
layer_->SetBounds(bounds);
diff --git a/cc/layers/ui_resource_layer.cc b/cc/layers/ui_resource_layer.cc
index 6b5f8779..6842851 100644
--- a/cc/layers/ui_resource_layer.cc
+++ b/cc/layers/ui_resource_layer.cc
@@ -49,13 +49,12 @@
UIResourceLayer::UIResourceHolder::~UIResourceHolder() {}
-scoped_refptr<UIResourceLayer> UIResourceLayer::Create(
- const LayerSettings& settings) {
- return make_scoped_refptr(new UIResourceLayer(settings));
+scoped_refptr<UIResourceLayer> UIResourceLayer::Create() {
+ return make_scoped_refptr(new UIResourceLayer());
}
-UIResourceLayer::UIResourceLayer(const LayerSettings& settings)
- : Layer(settings), uv_top_left_(0.f, 0.f), uv_bottom_right_(1.f, 1.f) {
+UIResourceLayer::UIResourceLayer()
+ : uv_top_left_(0.f, 0.f), uv_bottom_right_(1.f, 1.f) {
vertex_opacity_[0] = 1.0f;
vertex_opacity_[1] = 1.0f;
vertex_opacity_[2] = 1.0f;
diff --git a/cc/layers/ui_resource_layer.h b/cc/layers/ui_resource_layer.h
index 52a45b7..794a86c 100644
--- a/cc/layers/ui_resource_layer.h
+++ b/cc/layers/ui_resource_layer.h
@@ -19,7 +19,7 @@
class CC_EXPORT UIResourceLayer : public Layer {
public:
- static scoped_refptr<UIResourceLayer> Create(const LayerSettings& settings);
+ static scoped_refptr<UIResourceLayer> Create();
void PushPropertiesTo(LayerImpl* layer) override;
@@ -49,7 +49,7 @@
};
protected:
- explicit UIResourceLayer(const LayerSettings& settings);
+ UIResourceLayer();
~UIResourceLayer() override;
bool HasDrawableContent() const override;
diff --git a/cc/layers/ui_resource_layer_unittest.cc b/cc/layers/ui_resource_layer_unittest.cc
index fa27710..94efef4 100644
--- a/cc/layers/ui_resource_layer_unittest.cc
+++ b/cc/layers/ui_resource_layer_unittest.cc
@@ -5,7 +5,6 @@
#include "cc/layers/ui_resource_layer.h"
#include "base/thread_task_runner_handle.h"
-#include "cc/layers/layer_settings.h"
#include "cc/resources/resource_provider.h"
#include "cc/resources/scoped_ui_resource.h"
#include "cc/test/fake_layer_tree_host.h"
@@ -30,9 +29,8 @@
class TestUIResourceLayer : public UIResourceLayer {
public:
- static scoped_refptr<TestUIResourceLayer> Create(
- const LayerSettings& settings) {
- return make_scoped_refptr(new TestUIResourceLayer(settings));
+ static scoped_refptr<TestUIResourceLayer> Create() {
+ return make_scoped_refptr(new TestUIResourceLayer());
}
UIResourceId GetUIResourceId() {
@@ -42,10 +40,7 @@
}
protected:
- explicit TestUIResourceLayer(const LayerSettings& settings)
- : UIResourceLayer(settings) {
- SetIsDrawable(true);
- }
+ TestUIResourceLayer() : UIResourceLayer() { SetIsDrawable(true); }
~TestUIResourceLayer() override {}
};
@@ -68,12 +63,10 @@
FakeLayerTreeHostClient fake_client_;
TestTaskGraphRunner task_graph_runner_;
scoped_ptr<FakeLayerTreeHost> layer_tree_host_;
- LayerSettings layer_settings_;
};
TEST_F(UIResourceLayerTest, SetBitmap) {
- scoped_refptr<UIResourceLayer> test_layer =
- TestUIResourceLayer::Create(layer_settings_);
+ scoped_refptr<UIResourceLayer> test_layer = TestUIResourceLayer::Create();
ASSERT_TRUE(test_layer.get());
test_layer->SetBounds(gfx::Size(100, 100));
@@ -97,8 +90,7 @@
}
TEST_F(UIResourceLayerTest, SetUIResourceId) {
- scoped_refptr<TestUIResourceLayer> test_layer =
- TestUIResourceLayer::Create(layer_settings_);
+ scoped_refptr<TestUIResourceLayer> test_layer = TestUIResourceLayer::Create();
ASSERT_TRUE(test_layer.get());
test_layer->SetBounds(gfx::Size(100, 100));
@@ -130,8 +122,7 @@
}
TEST_F(UIResourceLayerTest, BitmapClearedOnSetUIResourceId) {
- scoped_refptr<UIResourceLayer> test_layer =
- TestUIResourceLayer::Create(layer_settings_);
+ scoped_refptr<UIResourceLayer> test_layer = TestUIResourceLayer::Create();
ASSERT_TRUE(test_layer.get());
test_layer->SetBounds(gfx::Size(100, 100));
diff --git a/cc/layers/video_layer.cc b/cc/layers/video_layer.cc
index 49d6490..b55d82a 100644
--- a/cc/layers/video_layer.cc
+++ b/cc/layers/video_layer.cc
@@ -9,16 +9,14 @@
namespace cc {
scoped_refptr<VideoLayer> VideoLayer::Create(
- const LayerSettings& settings,
VideoFrameProvider* provider,
media::VideoRotation video_rotation) {
- return make_scoped_refptr(new VideoLayer(settings, provider, video_rotation));
+ return make_scoped_refptr(new VideoLayer(provider, video_rotation));
}
-VideoLayer::VideoLayer(const LayerSettings& settings,
- VideoFrameProvider* provider,
+VideoLayer::VideoLayer(VideoFrameProvider* provider,
media::VideoRotation video_rotation)
- : Layer(settings), provider_(provider), video_rotation_(video_rotation) {
+ : provider_(provider), video_rotation_(video_rotation) {
DCHECK(provider_);
}
diff --git a/cc/layers/video_layer.h b/cc/layers/video_layer.h
index fdc97531..4828468 100644
--- a/cc/layers/video_layer.h
+++ b/cc/layers/video_layer.h
@@ -9,7 +9,6 @@
#include "base/macros.h"
#include "cc/base/cc_export.h"
#include "cc/layers/layer.h"
-#include "cc/layers/layer_settings.h"
#include "media/base/video_rotation.h"
namespace media { class VideoFrame; }
@@ -22,8 +21,7 @@
// A Layer that contains a Video element.
class CC_EXPORT VideoLayer : public Layer {
public:
- static scoped_refptr<VideoLayer> Create(const LayerSettings& settings,
- VideoFrameProvider* provider,
+ static scoped_refptr<VideoLayer> Create(VideoFrameProvider* provider,
media::VideoRotation video_rotation);
scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
@@ -31,9 +29,7 @@
bool Update() override;
private:
- VideoLayer(const LayerSettings& settings,
- VideoFrameProvider* provider,
- media::VideoRotation video_rotation);
+ VideoLayer(VideoFrameProvider* provider, media::VideoRotation video_rotation);
~VideoLayer() override;
// This pointer is only for passing to VideoLayerImpl's constructor. It should
diff --git a/cc/test/fake_layer_tree_host.cc b/cc/test/fake_layer_tree_host.cc
index 5125a7b..cef4b32 100644
--- a/cc/test/fake_layer_tree_host.cc
+++ b/cc/test/fake_layer_tree_host.cc
@@ -31,9 +31,7 @@
scoped_ptr<FakeLayerTreeHost> FakeLayerTreeHost::Create(
FakeLayerTreeHostClient* client,
TestTaskGraphRunner* task_graph_runner) {
- LayerTreeSettings settings;
- settings.use_compositor_animation_timelines = true;
- return Create(client, task_graph_runner, settings);
+ return Create(client, task_graph_runner, LayerTreeSettings());
}
scoped_ptr<FakeLayerTreeHost> FakeLayerTreeHost::Create(
diff --git a/cc/test/fake_layer_tree_host_impl.cc b/cc/test/fake_layer_tree_host_impl.cc
index 3b9c1e2..17963c36 100644
--- a/cc/test/fake_layer_tree_host_impl.cc
+++ b/cc/test/fake_layer_tree_host_impl.cc
@@ -6,7 +6,6 @@
#include "cc/test/begin_frame_args_test.h"
#include "cc/test/fake_layer_tree_host_impl.h"
-#include "cc/test/layer_tree_settings_for_testing.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/trees/layer_tree_impl.h"
@@ -16,7 +15,7 @@
TaskRunnerProvider* task_runner_provider,
SharedBitmapManager* manager,
TaskGraphRunner* task_graph_runner)
- : FakeLayerTreeHostImpl(LayerTreeSettingsForTesting(),
+ : FakeLayerTreeHostImpl(LayerTreeSettings(),
task_runner_provider,
manager,
task_graph_runner,
diff --git a/cc/test/fake_painted_scrollbar_layer.cc b/cc/test/fake_painted_scrollbar_layer.cc
index 8e14ff3..14964eb 100644
--- a/cc/test/fake_painted_scrollbar_layer.cc
+++ b/cc/test/fake_painted_scrollbar_layer.cc
@@ -10,22 +10,19 @@
namespace cc {
scoped_refptr<FakePaintedScrollbarLayer> FakePaintedScrollbarLayer::Create(
- const LayerSettings& settings,
bool paint_during_update,
bool has_thumb,
int scrolling_layer_id) {
FakeScrollbar* fake_scrollbar = new FakeScrollbar(
paint_during_update, has_thumb, false);
- return make_scoped_refptr(new FakePaintedScrollbarLayer(
- settings, fake_scrollbar, scrolling_layer_id));
+ return make_scoped_refptr(
+ new FakePaintedScrollbarLayer(fake_scrollbar, scrolling_layer_id));
}
FakePaintedScrollbarLayer::FakePaintedScrollbarLayer(
- const LayerSettings& settings,
FakeScrollbar* fake_scrollbar,
int scrolling_layer_id)
- : PaintedScrollbarLayer(settings,
- scoped_ptr<Scrollbar>(fake_scrollbar),
+ : PaintedScrollbarLayer(scoped_ptr<Scrollbar>(fake_scrollbar),
scrolling_layer_id),
update_count_(0),
push_properties_count_(0),
diff --git a/cc/test/fake_painted_scrollbar_layer.h b/cc/test/fake_painted_scrollbar_layer.h
index 95ed921..3568087 100644
--- a/cc/test/fake_painted_scrollbar_layer.h
+++ b/cc/test/fake_painted_scrollbar_layer.h
@@ -18,7 +18,6 @@
class FakePaintedScrollbarLayer : public PaintedScrollbarLayer {
public:
static scoped_refptr<FakePaintedScrollbarLayer> Create(
- const LayerSettings& settings,
bool paint_during_update,
bool has_thumb,
int scrolling_layer_id);
@@ -48,8 +47,7 @@
using PaintedScrollbarLayer::UpdateThumbAndTrackGeometry;
private:
- FakePaintedScrollbarLayer(const LayerSettings& settings,
- FakeScrollbar* fake_scrollbar,
+ FakePaintedScrollbarLayer(FakeScrollbar* fake_scrollbar,
int scrolling_layer_id);
~FakePaintedScrollbarLayer() override;
diff --git a/cc/test/fake_picture_layer.cc b/cc/test/fake_picture_layer.cc
index 50b9e7d4..a93e55f 100644
--- a/cc/test/fake_picture_layer.cc
+++ b/cc/test/fake_picture_layer.cc
@@ -8,9 +8,8 @@
namespace cc {
-FakePictureLayer::FakePictureLayer(const LayerSettings& settings,
- ContentLayerClient* client)
- : PictureLayer(settings, client),
+FakePictureLayer::FakePictureLayer(ContentLayerClient* client)
+ : PictureLayer(client),
update_count_(0),
push_properties_count_(0),
always_update_resources_(false) {
@@ -19,10 +18,9 @@
}
FakePictureLayer::FakePictureLayer(
- const LayerSettings& settings,
ContentLayerClient* client,
scoped_ptr<DisplayListRecordingSource> source)
- : PictureLayer(settings, client, std::move(source)),
+ : PictureLayer(client, std::move(source)),
update_count_(0),
push_properties_count_(0),
always_update_resources_(false) {
diff --git a/cc/test/fake_picture_layer.h b/cc/test/fake_picture_layer.h
index 6bb9b175..4d7f52e 100644
--- a/cc/test/fake_picture_layer.h
+++ b/cc/test/fake_picture_layer.h
@@ -15,17 +15,14 @@
namespace cc {
class FakePictureLayer : public PictureLayer {
public:
- static scoped_refptr<FakePictureLayer> Create(const LayerSettings& settings,
- ContentLayerClient* client) {
- return make_scoped_refptr(new FakePictureLayer(settings, client));
+ static scoped_refptr<FakePictureLayer> Create(ContentLayerClient* client) {
+ return make_scoped_refptr(new FakePictureLayer(client));
}
static scoped_refptr<FakePictureLayer> CreateWithRecordingSource(
- const LayerSettings& settings,
ContentLayerClient* client,
scoped_ptr<DisplayListRecordingSource> source) {
- return make_scoped_refptr(
- new FakePictureLayer(settings, client, std::move(source)));
+ return make_scoped_refptr(new FakePictureLayer(client, std::move(source)));
}
scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
@@ -45,9 +42,8 @@
void PushPropertiesTo(LayerImpl* layer) override;
private:
- FakePictureLayer(const LayerSettings& settings, ContentLayerClient* client);
- FakePictureLayer(const LayerSettings& settings,
- ContentLayerClient* client,
+ explicit FakePictureLayer(ContentLayerClient* client);
+ FakePictureLayer(ContentLayerClient* client,
scoped_ptr<DisplayListRecordingSource> source);
~FakePictureLayer() override;
diff --git a/cc/test/layer_test_common.cc b/cc/test/layer_test_common.cc
index f1326a5..2979d5e4 100644
--- a/cc/test/layer_test_common.cc
+++ b/cc/test/layer_test_common.cc
@@ -18,7 +18,6 @@
#include "cc/quads/render_pass.h"
#include "cc/test/animation_test_common.h"
#include "cc/test/fake_output_surface.h"
-#include "cc/test/layer_tree_settings_for_testing.h"
#include "cc/test/mock_occlusion_tracker.h"
#include "cc/trees/layer_tree_host_common.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -118,7 +117,7 @@
}
LayerTestCommon::LayerImplTest::LayerImplTest()
- : LayerImplTest(LayerTreeSettingsForTesting()) {}
+ : LayerImplTest(LayerTreeSettings()) {}
LayerTestCommon::LayerImplTest::LayerImplTest(const LayerTreeSettings& settings)
: client_(FakeLayerTreeHostClient::DIRECT_3D),
@@ -131,23 +130,19 @@
host_->host_impl()->SetVisible(true);
host_->host_impl()->InitializeRenderer(output_surface_.get());
- if (host_->settings().use_compositor_animation_timelines) {
- const int timeline_id = AnimationIdProvider::NextTimelineId();
- timeline_ = AnimationTimeline::Create(timeline_id);
- host_->animation_host()->AddAnimationTimeline(timeline_);
- // Create impl-side instance.
- host_->animation_host()->PushPropertiesTo(
- host_->host_impl()->animation_host());
- timeline_impl_ =
- host_->host_impl()->animation_host()->GetTimelineById(timeline_id);
- }
+ const int timeline_id = AnimationIdProvider::NextTimelineId();
+ timeline_ = AnimationTimeline::Create(timeline_id);
+ host_->animation_host()->AddAnimationTimeline(timeline_);
+ // Create impl-side instance.
+ host_->animation_host()->PushPropertiesTo(
+ host_->host_impl()->animation_host());
+ timeline_impl_ =
+ host_->host_impl()->animation_host()->GetTimelineById(timeline_id);
}
LayerTestCommon::LayerImplTest::~LayerImplTest() {
- if (host_->settings().use_compositor_animation_timelines) {
- host_->animation_host()->RemoveAnimationTimeline(timeline_);
- timeline_ = nullptr;
- }
+ host_->animation_host()->RemoveAnimationTimeline(timeline_);
+ timeline_ = nullptr;
}
void LayerTestCommon::LayerImplTest::CalcDrawProps(
diff --git a/cc/test/layer_tree_host_common_test.cc b/cc/test/layer_tree_host_common_test.cc
index cbad7e8..d1a7dc25 100644
--- a/cc/test/layer_tree_host_common_test.cc
+++ b/cc/test/layer_tree_host_common_test.cc
@@ -17,8 +17,6 @@
const LayerTreeSettings& settings)
: LayerTestCommon::LayerImplTest(settings),
render_surface_layer_list_count_(0) {
- layer_settings_.use_compositor_animation_timelines =
- settings.use_compositor_animation_timelines;
}
LayerTreeHostCommonTestBase::~LayerTreeHostCommonTestBase() {
@@ -228,15 +226,8 @@
return false;
}
-class LayerTreeSettingsForCommonTest : public LayerTreeSettings {
- public:
- LayerTreeSettingsForCommonTest() {
- use_compositor_animation_timelines = true;
- }
-};
-
LayerTreeHostCommonTest::LayerTreeHostCommonTest()
- : LayerTreeHostCommonTestBase(LayerTreeSettingsForCommonTest()) {}
+ : LayerTreeHostCommonTestBase(LayerTreeSettings()) {}
LayerTreeHostCommonTest::LayerTreeHostCommonTest(
const LayerTreeSettings& settings)
diff --git a/cc/test/layer_tree_host_common_test.h b/cc/test/layer_tree_host_common_test.h
index 1717d13..9f6248c 100644
--- a/cc/test/layer_tree_host_common_test.h
+++ b/cc/test/layer_tree_host_common_test.h
@@ -10,7 +10,6 @@
#include "base/memory/scoped_ptr.h"
#include "cc/layers/layer_lists.h"
-#include "cc/layers/layer_settings.h"
#include "cc/test/fake_layer_tree_host_client.h"
#include "cc/test/layer_test_common.h"
#include "cc/test/test_task_graph_runner.h"
@@ -143,13 +142,10 @@
return render_surface_layer_list_count_;
}
- const LayerSettings& layer_settings() { return layer_settings_; }
-
private:
scoped_ptr<std::vector<LayerImpl*>> render_surface_layer_list_impl_;
LayerList update_layer_list_;
scoped_ptr<LayerImplList> update_layer_list_impl_;
- LayerSettings layer_settings_;
int render_surface_layer_list_count_;
};
diff --git a/cc/test/layer_tree_json_parser.cc b/cc/test/layer_tree_json_parser.cc
index 086e023..815700b 100644
--- a/cc/test/layer_tree_json_parser.cc
+++ b/cc/test/layer_tree_json_parser.cc
@@ -9,7 +9,6 @@
#include "base/test/values_test_util.h"
#include "base/values.h"
#include "cc/layers/layer.h"
-#include "cc/layers/layer_settings.h"
#include "cc/layers/nine_patch_layer.h"
#include "cc/layers/picture_layer.h"
#include "cc/layers/solid_color_layer.h"
@@ -40,11 +39,9 @@
bool draws_content;
success &= dict->GetBoolean("DrawsContent", &draws_content);
- LayerSettings layer_settings;
-
scoped_refptr<Layer> new_layer;
if (layer_type == "SolidColorLayer") {
- new_layer = SolidColorLayer::Create(layer_settings);
+ new_layer = SolidColorLayer::Create();
} else if (layer_type == "NinePatchLayer") {
success &= dict->GetList("ImageAperture", &list);
int aperture_x, aperture_y, aperture_width, aperture_height;
@@ -69,8 +66,7 @@
bool fill_center;
success &= dict->GetBoolean("FillCenter", &fill_center);
- scoped_refptr<NinePatchLayer> nine_patch_layer =
- NinePatchLayer::Create(layer_settings);
+ scoped_refptr<NinePatchLayer> nine_patch_layer = NinePatchLayer::Create();
SkBitmap bitmap;
bitmap.allocN32Pixels(image_width, image_height);
@@ -84,11 +80,11 @@
new_layer = nine_patch_layer;
} else if (layer_type == "TextureLayer") {
- new_layer = TextureLayer::CreateForMailbox(layer_settings, NULL);
+ new_layer = TextureLayer::CreateForMailbox(NULL);
} else if (layer_type == "PictureLayer") {
- new_layer = PictureLayer::Create(layer_settings, content_client);
+ new_layer = PictureLayer::Create(content_client);
} else { // Type "Layer" or "unknown"
- new_layer = Layer::Create(layer_settings);
+ new_layer = Layer::Create();
}
new_layer->SetPosition(gfx::PointF(position_x, position_y));
new_layer->SetBounds(gfx::Size(width, height));
diff --git a/cc/test/layer_tree_pixel_test.cc b/cc/test/layer_tree_pixel_test.cc
index 007cdad..82045a4 100644
--- a/cc/test/layer_tree_pixel_test.cc
+++ b/cc/test/layer_tree_pixel_test.cc
@@ -106,8 +106,7 @@
scoped_refptr<SolidColorLayer> LayerTreePixelTest::CreateSolidColorLayer(
const gfx::Rect& rect, SkColor color) {
- scoped_refptr<SolidColorLayer> layer =
- SolidColorLayer::Create(layer_settings());
+ scoped_refptr<SolidColorLayer> layer = SolidColorLayer::Create();
layer->SetIsDrawable(true);
layer->SetBounds(rect.size());
layer->SetPosition(gfx::PointF(rect.origin()));
@@ -197,7 +196,7 @@
}
void LayerTreePixelTest::SetupTree() {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(content_root_->bounds());
root->AddChild(content_root_);
layer_tree_host()->SetRootLayer(root);
diff --git a/cc/test/layer_tree_settings_for_testing.cc b/cc/test/layer_tree_settings_for_testing.cc
deleted file mode 100644
index dcc947d..0000000
--- a/cc/test/layer_tree_settings_for_testing.cc
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "cc/test/layer_tree_settings_for_testing.h"
-
-namespace cc {
-
-LayerTreeSettingsForTesting::LayerTreeSettingsForTesting()
- : LayerTreeSettings() {
- this->use_compositor_animation_timelines = true;
-}
-
-LayerTreeSettingsForTesting::~LayerTreeSettingsForTesting() {}
-
-} // namespace cc
diff --git a/cc/test/layer_tree_settings_for_testing.h b/cc/test/layer_tree_settings_for_testing.h
deleted file mode 100644
index cc44fbac..0000000
--- a/cc/test/layer_tree_settings_for_testing.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CC_TEST_LAYER_TREE_SETTINGS_FOR_TESTING_H_
-#define CC_TEST_LAYER_TREE_SETTINGS_FOR_TESTING_H_
-
-#include "cc/trees/layer_tree_settings.h"
-
-namespace cc {
-
-class LayerTreeSettingsForTesting : public LayerTreeSettings {
- public:
- LayerTreeSettingsForTesting();
- ~LayerTreeSettingsForTesting() override;
-};
-
-} // namespace cc
-
-#endif // CC_TEST_LAYER_TREE_SETTINGS_FOR_TESTING_H_
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc
index 9503c42..9605854 100644
--- a/cc/test/layer_tree_test.cc
+++ b/cc/test/layer_tree_test.cc
@@ -46,55 +46,44 @@
scoped_refptr<Layer> outer_scroll_layer,
const gfx::Size& inner_bounds,
const gfx::Size& outer_bounds,
- LayerTreeHost* host,
- const LayerSettings& layer_settings) {
- scoped_refptr<Layer> inner_viewport_container_layer =
- Layer::Create(layer_settings);
- scoped_refptr<Layer> inner_viewport_scroll_layer =
- Layer::Create(layer_settings);
- scoped_refptr<Layer> outer_viewport_container_layer =
- Layer::Create(layer_settings);
- scoped_refptr<Layer> page_scale_layer = Layer::Create(layer_settings);
+ LayerTreeHost* host) {
+ scoped_refptr<Layer> inner_viewport_container_layer = Layer::Create();
+ scoped_refptr<Layer> inner_viewport_scroll_layer = Layer::Create();
+ scoped_refptr<Layer> outer_viewport_container_layer = Layer::Create();
+ scoped_refptr<Layer> page_scale_layer = Layer::Create();
- root_layer->AddChild(inner_viewport_container_layer);
- inner_viewport_container_layer->AddChild(page_scale_layer);
- page_scale_layer->AddChild(inner_viewport_scroll_layer);
- inner_viewport_scroll_layer->AddChild(outer_viewport_container_layer);
- outer_viewport_container_layer->AddChild(outer_scroll_layer);
+ root_layer->AddChild(inner_viewport_container_layer);
+ inner_viewport_container_layer->AddChild(page_scale_layer);
+ page_scale_layer->AddChild(inner_viewport_scroll_layer);
+ inner_viewport_scroll_layer->AddChild(outer_viewport_container_layer);
+ outer_viewport_container_layer->AddChild(outer_scroll_layer);
- inner_viewport_scroll_layer->SetScrollClipLayerId(
- inner_viewport_container_layer->id());
- outer_scroll_layer->SetScrollClipLayerId(
- outer_viewport_container_layer->id());
+ inner_viewport_scroll_layer->SetScrollClipLayerId(
+ inner_viewport_container_layer->id());
+ outer_scroll_layer->SetScrollClipLayerId(
+ outer_viewport_container_layer->id());
- inner_viewport_container_layer->SetBounds(inner_bounds);
- inner_viewport_scroll_layer->SetBounds(outer_bounds);
- outer_viewport_container_layer->SetBounds(outer_bounds);
+ inner_viewport_container_layer->SetBounds(inner_bounds);
+ inner_viewport_scroll_layer->SetBounds(outer_bounds);
+ outer_viewport_container_layer->SetBounds(outer_bounds);
- inner_viewport_scroll_layer->SetIsContainerForFixedPositionLayers(true);
- outer_scroll_layer->SetIsContainerForFixedPositionLayers(true);
- host->RegisterViewportLayers(NULL, page_scale_layer,
- inner_viewport_scroll_layer,
- outer_scroll_layer);
+ inner_viewport_scroll_layer->SetIsContainerForFixedPositionLayers(true);
+ outer_scroll_layer->SetIsContainerForFixedPositionLayers(true);
+ host->RegisterViewportLayers(NULL, page_scale_layer,
+ inner_viewport_scroll_layer, outer_scroll_layer);
}
void CreateVirtualViewportLayers(Layer* root_layer,
const gfx::Size& inner_bounds,
const gfx::Size& outer_bounds,
const gfx::Size& scroll_bounds,
- LayerTreeHost* host,
- const LayerSettings& layer_settings) {
- scoped_refptr<Layer> outer_viewport_scroll_layer =
- Layer::Create(layer_settings);
+ LayerTreeHost* host) {
+ scoped_refptr<Layer> outer_viewport_scroll_layer = Layer::Create();
- outer_viewport_scroll_layer->SetBounds(scroll_bounds);
- outer_viewport_scroll_layer->SetIsDrawable(true);
- CreateVirtualViewportLayers(root_layer,
- outer_viewport_scroll_layer,
- inner_bounds,
- outer_bounds,
- host,
- layer_settings);
+ outer_viewport_scroll_layer->SetBounds(scroll_bounds);
+ outer_viewport_scroll_layer->SetIsDrawable(true);
+ CreateVirtualViewportLayers(root_layer, outer_viewport_scroll_layer,
+ inner_bounds, outer_bounds, host);
}
// Creates a SingleThreadProxy that notifies the supplied |test_hooks| of
@@ -746,7 +735,7 @@
void LayerTreeTest::SetupTree() {
if (!layer_tree_host_->root_layer()) {
- scoped_refptr<Layer> root_layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> root_layer = Layer::Create();
root_layer->SetBounds(gfx::Size(1, 1));
layer_tree_host_->SetRootLayer(root_layer);
}
@@ -877,7 +866,6 @@
settings_.renderer_settings.refresh_rate = 200.0;
settings_.background_animation_rate = 200.0;
InitializeSettings(&settings_);
- InitializeLayerSettings(&layer_settings_);
main_task_runner_->PostTask(
FROM_HERE,
diff --git a/cc/test/layer_tree_test.h b/cc/test/layer_tree_test.h
index 36a882c..8418f654 100644
--- a/cc/test/layer_tree_test.h
+++ b/cc/test/layer_tree_test.h
@@ -8,7 +8,6 @@
#include "base/memory/ref_counted.h"
#include "base/threading/thread.h"
#include "cc/animation/animation_delegate.h"
-#include "cc/layers/layer_settings.h"
#include "cc/test/proxy_impl_for_test.h"
#include "cc/test/proxy_main_for_test.h"
#include "cc/test/remote_proto_channel_bridge.h"
@@ -41,8 +40,7 @@
const gfx::Size& inner_bounds,
const gfx::Size& outer_bounds,
const gfx::Size& scroll_bounds,
- LayerTreeHost* host,
- const LayerSettings& layer_settings);
+ LayerTreeHost* host);
// Creates the virtual viewport layer hierarchy under the given root_layer.
// Uses the given scroll layer as the content "outer viewport scroll layer".
@@ -50,8 +48,7 @@
scoped_refptr<Layer> outer_scroll_layer,
const gfx::Size& outer_bounds,
const gfx::Size& scroll_bounds,
- LayerTreeHost* host,
- const LayerSettings& layer_settings);
+ LayerTreeHost* host);
class BeginTask;
class LayerTreeHostClientForTesting;
@@ -96,13 +93,10 @@
void DoBeginTest();
void Timeout();
- const LayerSettings& layer_settings() { return layer_settings_; }
-
protected:
LayerTreeTest();
virtual void InitializeSettings(LayerTreeSettings* settings) {}
- virtual void InitializeLayerSettings(LayerSettings* layer_settings) {}
void RealEndTest();
@@ -198,7 +192,6 @@
private:
LayerTreeSettings settings_;
- LayerSettings layer_settings_;
CompositorMode mode_;
diff --git a/cc/tiles/tile_manager_unittest.cc b/cc/tiles/tile_manager_unittest.cc
index 1060edc..d10b1ed0 100644
--- a/cc/tiles/tile_manager_unittest.cc
+++ b/cc/tiles/tile_manager_unittest.cc
@@ -21,7 +21,6 @@
#include "cc/test/fake_picture_layer_impl.h"
#include "cc/test/fake_picture_layer_tiling_client.h"
#include "cc/test/fake_tile_manager.h"
-#include "cc/test/layer_tree_settings_for_testing.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"
@@ -39,7 +38,7 @@
namespace cc {
namespace {
-class LowResTilingsSettings : public LayerTreeSettingsForTesting {
+class LowResTilingsSettings : public LayerTreeSettings {
public:
LowResTilingsSettings() {
create_low_res_tiling = true;
@@ -1134,7 +1133,7 @@
soon_rect.Inset(-inset, -inset);
client.SetTileSize(gfx::Size(30, 30));
- LayerTreeSettingsForTesting settings;
+ LayerTreeSettings settings;
scoped_ptr<PictureLayerTilingSet> tiling_set = PictureLayerTilingSet::Create(
ACTIVE_TREE, &client, settings.tiling_interest_area_padding,
@@ -1243,7 +1242,7 @@
gfx::Size layer_bounds(1000, 1000);
client.SetTileSize(gfx::Size(30, 30));
- LayerTreeSettingsForTesting settings;
+ LayerTreeSettings settings;
scoped_ptr<PictureLayerTilingSet> tiling_set = PictureLayerTilingSet::Create(
ACTIVE_TREE, &client, settings.tiling_interest_area_padding,
@@ -1518,7 +1517,7 @@
make_scoped_ptr(new SoftwareOutputDevice))) {}
void SetUp() override {
- LayerTreeSettingsForTesting settings;
+ LayerTreeSettings settings;
CustomizeSettings(&settings);
host_impl_.reset(new MockLayerTreeHostImpl(settings, &task_runner_provider_,
&shared_bitmap_manager_,
@@ -1583,7 +1582,7 @@
// MockLayerTreeHostImpl allows us to intercept tile manager callbacks.
class MockLayerTreeHostImpl : public FakeLayerTreeHostImpl {
public:
- MockLayerTreeHostImpl(const LayerTreeSettingsForTesting& settings,
+ MockLayerTreeHostImpl(const LayerTreeSettings& settings,
TaskRunnerProvider* task_runner_provider,
SharedBitmapManager* manager,
TaskGraphRunner* task_graph_runner)
@@ -1596,7 +1595,7 @@
};
// By default do no customization.
- virtual void CustomizeSettings(LayerTreeSettingsForTesting* settings) {}
+ virtual void CustomizeSettings(LayerTreeSettings* settings) {}
TestSharedBitmapManager shared_bitmap_manager_;
TestTaskGraphRunner task_graph_runner_;
@@ -1798,7 +1797,7 @@
class PartialRasterTileManagerTest : public TileManagerTest {
public:
- void CustomizeSettings(LayerTreeSettingsForTesting* settings) override {
+ void CustomizeSettings(LayerTreeSettings* settings) override {
settings->use_partial_raster = true;
}
};
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 5f21e91e..37bd256 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -37,7 +37,6 @@
#include "cc/layers/layer.h"
#include "cc/layers/layer_iterator.h"
#include "cc/layers/layer_proto_converter.h"
-#include "cc/layers/layer_settings.h"
#include "cc/layers/painted_scrollbar_layer.h"
#include "cc/proto/gfx_conversions.h"
#include "cc/proto/layer_tree_host.pb.h"
@@ -510,10 +509,7 @@
void LayerTreeHost::UpdateHudLayer() {
if (debug_state_.ShowHudInfo()) {
if (!hud_layer_.get()) {
- LayerSettings hud_layer_settings;
- hud_layer_settings.use_compositor_animation_timelines =
- settings_.use_compositor_animation_timelines;
- hud_layer_ = HeadsUpDisplayLayer::Create(hud_layer_settings);
+ hud_layer_ = HeadsUpDisplayLayer::Create();
}
if (root_layer_.get() && !hud_layer_->parent())
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index 85c4e7a5..054d3c93 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -53,8 +53,7 @@
class LayerWithForcedDrawsContent : public Layer {
public:
- explicit LayerWithForcedDrawsContent(const LayerSettings& settings)
- : Layer(settings) {}
+ LayerWithForcedDrawsContent() {}
bool DrawsContent() const override;
@@ -93,7 +92,6 @@
public:
LayerTreeSettingsScaleContent() {
layer_transforms_should_scale_layer_contents = true;
- use_compositor_animation_timelines = true;
}
};
@@ -109,9 +107,9 @@
// screen space transform, and the hierarchy passed on to children
// layers should also be identity transforms.
- scoped_refptr<Layer> parent = Layer::Create(layer_settings());
- scoped_refptr<Layer> child = Layer::Create(layer_settings());
- scoped_refptr<Layer> grand_child = Layer::Create(layer_settings());
+ scoped_refptr<Layer> parent = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
+ scoped_refptr<Layer> grand_child = Layer::Create();
parent->AddChild(child);
child->AddChild(grand_child);
@@ -210,9 +208,9 @@
TEST_F(LayerTreeHostCommonTest, TransformsForSingleLayer) {
gfx::Transform identity_matrix;
- scoped_refptr<Layer> layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> layer = Layer::Create();
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
SetLayerPropertiesForTesting(root.get(), identity_matrix, gfx::Point3F(),
gfx::PointF(), gfx::Size(1, 2), true, false);
root->AddChild(layer);
@@ -403,10 +401,10 @@
TEST_F(LayerTreeHostCommonTest, TransformsForSimpleHierarchy) {
gfx::Transform identity_matrix;
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
- scoped_refptr<Layer> parent = Layer::Create(layer_settings());
- scoped_refptr<Layer> child = Layer::Create(layer_settings());
- scoped_refptr<Layer> grand_child = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> parent = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
+ scoped_refptr<Layer> grand_child = Layer::Create();
root->AddChild(parent);
parent->AddChild(child);
child->AddChild(grand_child);
@@ -1006,10 +1004,10 @@
}
TEST_F(LayerTreeHostCommonTest, LayerFullyContainedWithinClipInTargetSpace) {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
- scoped_refptr<Layer> child = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
scoped_refptr<LayerWithForcedDrawsContent> grand_child =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
gfx::Transform child_transform;
child_transform.Translate(50.0, 50.0);
@@ -3065,10 +3063,10 @@
}
TEST_F(LayerTreeHostCommonTest, VisibleContentRectWithClippingAndScaling) {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
- scoped_refptr<Layer> child = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
scoped_refptr<LayerWithForcedDrawsContent> grand_child =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
root->AddChild(child);
child->AddChild(grand_child);
@@ -3560,9 +3558,9 @@
TEST_F(LayerTreeHostCommonTest,
SingularTransformDoesNotPreventClearingDrawProperties) {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
scoped_refptr<LayerWithForcedDrawsContent> child =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
root->AddChild(child);
host()->SetRootLayer(root);
@@ -3606,7 +3604,7 @@
TEST_F(LayerTreeHostCommonTest,
SingularNonAnimatingTransformDoesNotPreventClearingDrawProperties) {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
host()->SetRootLayer(root);
@@ -4210,27 +4208,27 @@
// "flattened" to each parent layer according to current W3C spec.
const gfx::Transform identity_matrix;
- scoped_refptr<Layer> parent = Layer::Create(layer_settings());
+ scoped_refptr<Layer> parent = Layer::Create();
scoped_refptr<LayerWithForcedDrawsContent> front_facing_child =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent> back_facing_child =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent> front_facing_surface =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent> back_facing_surface =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent>
front_facing_child_of_front_facing_surface =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent>
back_facing_child_of_front_facing_surface =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent>
front_facing_child_of_back_facing_surface =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent>
back_facing_child_of_back_facing_surface =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
parent->AddChild(front_facing_child);
parent->AddChild(back_facing_child);
@@ -4469,17 +4467,17 @@
// transforms should be treated as "unknown" so we can not be sure that their
// back face is really showing.
const gfx::Transform identity_matrix;
- scoped_refptr<Layer> parent = Layer::Create(layer_settings());
+ scoped_refptr<Layer> parent = Layer::Create();
scoped_refptr<LayerWithForcedDrawsContent> child =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent> animating_surface =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent> child_of_animating_surface =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent> animating_child =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent> child2 =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
parent->AddChild(child);
parent->AddChild(animating_surface);
@@ -4595,15 +4593,15 @@
// created when it flattens its subtree, and its parent has preserves-3d.
const gfx::Transform identity_matrix;
- scoped_refptr<Layer> parent = Layer::Create(layer_settings());
+ scoped_refptr<Layer> parent = Layer::Create();
scoped_refptr<LayerWithForcedDrawsContent> front_facing_surface =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent> back_facing_surface =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent> child1 =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent> child2 =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
parent->AddChild(front_facing_surface);
parent->AddChild(back_facing_surface);
@@ -5101,11 +5099,11 @@
}
TEST_F(LayerTreeHostCommonTest, SubtreeSearch) {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
- scoped_refptr<Layer> child = Layer::Create(layer_settings());
- scoped_refptr<Layer> grand_child = Layer::Create(layer_settings());
- scoped_refptr<Layer> mask_layer = Layer::Create(layer_settings());
- scoped_refptr<Layer> replica_layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
+ scoped_refptr<Layer> grand_child = Layer::Create();
+ scoped_refptr<Layer> mask_layer = Layer::Create();
+ scoped_refptr<Layer> replica_layer = Layer::Create();
grand_child->SetReplicaLayer(replica_layer.get());
child->AddChild(grand_child.get());
@@ -5133,10 +5131,10 @@
}
TEST_F(LayerTreeHostCommonTest, TransparentChildRenderSurfaceCreation) {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
- scoped_refptr<Layer> child = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
scoped_refptr<LayerWithForcedDrawsContent> grand_child =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
const gfx::Transform identity_matrix;
SetLayerPropertiesForTesting(root.get(),
@@ -5255,21 +5253,13 @@
EXPECT_TRUE(tree.ContributesToDrawnSurface(child_ptr->effect_tree_index()));
}
-class LayerTreeSettingsForLCDTextTest : public LayerTreeSettings {
- public:
- LayerTreeSettingsForLCDTextTest() {
- use_compositor_animation_timelines = true;
- }
-};
-
using LCDTextTestParam = std::tr1::tuple<bool, bool, bool>;
class LCDTextTest : public LayerTreeHostCommonTestBase,
public testing::TestWithParam<LCDTextTestParam> {
public:
LCDTextTest()
- : LayerTreeHostCommonTestBase(LayerTreeSettingsForLCDTextTest()),
- host_impl_(LayerTreeSettingsForLCDTextTest(),
- &task_runner_provider_,
+ : LayerTreeHostCommonTestBase(LayerTreeSettings()),
+ host_impl_(&task_runner_provider_,
&shared_bitmap_manager_,
&task_graph_runner_),
root_(nullptr),
@@ -5824,7 +5814,7 @@
host_impl.CreatePendingTree();
const gfx::Transform identity_matrix;
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
SetLayerPropertiesForTesting(root.get(),
identity_matrix,
gfx::Point3F(),
@@ -5835,7 +5825,7 @@
root->SetIsDrawable(true);
// The surface is moved slightly outside of the viewport.
- scoped_refptr<Layer> surface = Layer::Create(layer_settings());
+ scoped_refptr<Layer> surface = Layer::Create();
SetLayerPropertiesForTesting(surface.get(),
identity_matrix,
gfx::Point3F(),
@@ -5845,7 +5835,7 @@
false);
surface->SetForceRenderSurface(true);
- scoped_refptr<Layer> surface_child = Layer::Create(layer_settings());
+ scoped_refptr<Layer> surface_child = Layer::Create();
SetLayerPropertiesForTesting(surface_child.get(),
identity_matrix,
gfx::Point3F(),
@@ -6985,13 +6975,13 @@
// + fixed
// + child
//
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
scoped_refptr<LayerWithForcedDrawsContent> render_surface =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent> fixed =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent> child =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
root->AddChild(render_surface);
render_surface->AddChild(fixed);
@@ -8112,7 +8102,7 @@
}
TEST_F(LayerTreeHostCommonTest, VisibleContentRectInChildRenderSurface) {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
SetLayerPropertiesForTesting(root.get(),
gfx::Transform(),
gfx::Point3F(),
@@ -8122,7 +8112,7 @@
false);
root->SetIsDrawable(true);
- scoped_refptr<Layer> clip = Layer::Create(layer_settings());
+ scoped_refptr<Layer> clip = Layer::Create();
SetLayerPropertiesForTesting(clip.get(),
gfx::Transform(),
gfx::Point3F(),
@@ -8132,7 +8122,7 @@
false);
clip->SetMasksToBounds(true);
- scoped_refptr<Layer> content = Layer::Create(layer_settings());
+ scoped_refptr<Layer> content = Layer::Create();
SetLayerPropertiesForTesting(content.get(),
gfx::Transform(),
gfx::Point3F(),
@@ -8230,15 +8220,11 @@
}
TEST_F(LayerTreeHostCommonTest, NodesAffectedByBoundsDeltaGetUpdated) {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
- scoped_refptr<Layer> inner_viewport_container_layer =
- Layer::Create(layer_settings());
- scoped_refptr<Layer> inner_viewport_scroll_layer =
- Layer::Create(layer_settings());
- scoped_refptr<Layer> outer_viewport_container_layer =
- Layer::Create(layer_settings());
- scoped_refptr<Layer> outer_viewport_scroll_layer =
- Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> inner_viewport_container_layer = Layer::Create();
+ scoped_refptr<Layer> inner_viewport_scroll_layer = Layer::Create();
+ scoped_refptr<Layer> outer_viewport_container_layer = Layer::Create();
+ scoped_refptr<Layer> outer_viewport_scroll_layer = Layer::Create();
root->AddChild(inner_viewport_container_layer);
inner_viewport_container_layer->AddChild(inner_viewport_scroll_layer);
@@ -8257,8 +8243,8 @@
host()->RegisterViewportLayers(nullptr, root, inner_viewport_scroll_layer,
outer_viewport_scroll_layer);
- scoped_refptr<Layer> fixed_to_inner = Layer::Create(layer_settings());
- scoped_refptr<Layer> fixed_to_outer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> fixed_to_inner = Layer::Create();
+ scoped_refptr<Layer> fixed_to_outer = Layer::Create();
inner_viewport_scroll_layer->AddChild(fixed_to_inner);
outer_viewport_scroll_layer->AddChild(fixed_to_outer);
@@ -8293,9 +8279,9 @@
TEST_F(LayerTreeHostCommonTest, VisibleContentRectForAnimatedLayer) {
const gfx::Transform identity_matrix;
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
scoped_refptr<LayerWithForcedDrawsContent> animated =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
root->AddChild(animated);
@@ -8320,14 +8306,14 @@
TEST_F(LayerTreeHostCommonTest,
VisibleContentRectForAnimatedLayerWithSingularTransform) {
const gfx::Transform identity_matrix;
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
- scoped_refptr<Layer> clip = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> clip = Layer::Create();
scoped_refptr<LayerWithForcedDrawsContent> animated =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent> surface =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent> descendant_of_animation =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
root->AddChild(clip);
clip->AddChild(animated);
@@ -8394,9 +8380,9 @@
// Verify that having an animated filter (but no current filter, as these
// are mutually exclusive) correctly creates a render surface.
TEST_F(LayerTreeHostCommonTest, AnimatedFilterCreatesRenderSurface) {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
- scoped_refptr<Layer> child = Layer::Create(layer_settings());
- scoped_refptr<Layer> grandchild = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
+ scoped_refptr<Layer> grandchild = Layer::Create();
root->AddChild(child);
child->AddChild(grandchild);
@@ -8429,9 +8415,9 @@
// Verify that having a filter animation with a delayed start time creates a
// render surface.
TEST_F(LayerTreeHostCommonTest, DelayedFilterAnimationCreatesRenderSurface) {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
- scoped_refptr<Layer> child = Layer::Create(layer_settings());
- scoped_refptr<Layer> grandchild = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
+ scoped_refptr<Layer> grandchild = Layer::Create();
root->AddChild(child);
child->AddChild(grandchild);
@@ -8482,10 +8468,10 @@
// Ensures that the property tree code accounts for offsets between fixed
// position layers and their respective containers.
TEST_F(LayerTreeHostCommonTest, PropertyTreesAccountForFixedParentOffset) {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
- scoped_refptr<Layer> child = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
scoped_refptr<LayerWithForcedDrawsContent> grandchild =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
root->AddChild(child);
child->AddChild(grandchild);
@@ -8521,10 +8507,10 @@
// own transform tree node.
TEST_F(LayerTreeHostCommonTest,
PropertyTreesAccountForFixedParentOffsetWhenContainerIsParent) {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
- scoped_refptr<Layer> child = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
scoped_refptr<LayerWithForcedDrawsContent> grandchild =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
root->AddChild(child);
child->AddChild(grandchild);
@@ -8564,35 +8550,35 @@
rotate.Rotate(5);
gfx::Transform identity;
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(),
gfx::PointF(), gfx::Size(2500, 1500), true,
false);
- scoped_refptr<Layer> frame_clip = Layer::Create(layer_settings());
+ scoped_refptr<Layer> frame_clip = Layer::Create();
SetLayerPropertiesForTesting(frame_clip.get(), identity, gfx::Point3F(),
gfx::PointF(), gfx::Size(2500, 1500), true,
false);
frame_clip->SetMasksToBounds(true);
- scoped_refptr<Layer> rotated = Layer::Create(layer_settings());
+ scoped_refptr<Layer> rotated = Layer::Create();
SetLayerPropertiesForTesting(rotated.get(), rotate,
gfx::Point3F(1250, 250, 0), gfx::PointF(),
gfx::Size(2500, 500), true, false);
- scoped_refptr<Layer> surface = Layer::Create(layer_settings());
+ scoped_refptr<Layer> surface = Layer::Create();
SetLayerPropertiesForTesting(surface.get(), rotate, gfx::Point3F(),
gfx::PointF(), gfx::Size(2500, 500), true,
false);
surface->SetOpacity(0.5);
scoped_refptr<LayerWithForcedDrawsContent> container =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
SetLayerPropertiesForTesting(container.get(), identity, gfx::Point3F(),
gfx::PointF(), gfx::Size(300, 300), true, false);
scoped_refptr<LayerWithForcedDrawsContent> box =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
SetLayerPropertiesForTesting(box.get(), identity, gfx::Point3F(),
gfx::PointF(), gfx::Size(100, 100), true, false);
@@ -8612,19 +8598,19 @@
gfx::Transform translate_z;
translate_z.Translate3d(0, 0, 10);
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(),
gfx::PointF(), gfx::Size(800, 800), true, false);
root->SetIsContainerForFixedPositionLayers(true);
- scoped_refptr<Layer> frame_clip = Layer::Create(layer_settings());
+ scoped_refptr<Layer> frame_clip = Layer::Create();
SetLayerPropertiesForTesting(frame_clip.get(), translate_z, gfx::Point3F(),
gfx::PointF(500, 100), gfx::Size(100, 100), true,
false);
frame_clip->SetMasksToBounds(true);
scoped_refptr<LayerWithForcedDrawsContent> fixed =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
SetLayerPropertiesForTesting(fixed.get(), identity, gfx::Point3F(),
gfx::PointF(), gfx::Size(1000, 1000), true,
false);
@@ -8650,19 +8636,19 @@
gfx::Transform translate_z;
translate_z.Translate3d(0, 0, 10);
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(),
gfx::PointF(), gfx::Size(800, 800), true, false);
root->SetIsContainerForFixedPositionLayers(true);
- scoped_refptr<Layer> frame_clip = Layer::Create(layer_settings());
+ scoped_refptr<Layer> frame_clip = Layer::Create();
SetLayerPropertiesForTesting(frame_clip.get(), translate_z, gfx::Point3F(),
gfx::PointF(500, 100), gfx::Size(100, 100), true,
false);
frame_clip->SetMasksToBounds(true);
scoped_refptr<LayerWithForcedDrawsContent> scroller =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
SetLayerPropertiesForTesting(scroller.get(), identity, gfx::Point3F(),
gfx::PointF(), gfx::Size(1000, 1000), true,
false);
@@ -8672,7 +8658,7 @@
scroller->SetScrollClipLayerId(frame_clip->id());
scoped_refptr<LayerWithForcedDrawsContent> fixed =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
SetLayerPropertiesForTesting(fixed.get(), identity, gfx::Point3F(),
gfx::PointF(), gfx::Size(50, 50), true, false);
@@ -8681,7 +8667,7 @@
fixed->SetPositionConstraint(constraint);
scoped_refptr<LayerWithForcedDrawsContent> fixed_child =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
SetLayerPropertiesForTesting(fixed_child.get(), identity, gfx::Point3F(),
gfx::PointF(), gfx::Size(10, 10), true, false);
@@ -8706,19 +8692,19 @@
TEST_F(LayerTreeHostCommonTest, FixedClipsShouldBeAssociatedWithTheRightNode) {
gfx::Transform identity;
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(),
gfx::PointF(), gfx::Size(800, 800), true, false);
root->SetIsContainerForFixedPositionLayers(true);
- scoped_refptr<Layer> frame_clip = Layer::Create(layer_settings());
+ scoped_refptr<Layer> frame_clip = Layer::Create();
SetLayerPropertiesForTesting(frame_clip.get(), identity, gfx::Point3F(),
gfx::PointF(500, 100), gfx::Size(100, 100), true,
false);
frame_clip->SetMasksToBounds(true);
scoped_refptr<LayerWithForcedDrawsContent> scroller =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
SetLayerPropertiesForTesting(scroller.get(), identity, gfx::Point3F(),
gfx::PointF(), gfx::Size(1000, 1000), true,
false);
@@ -8727,7 +8713,7 @@
scroller->SetScrollClipLayerId(frame_clip->id());
scoped_refptr<LayerWithForcedDrawsContent> fixed =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
SetLayerPropertiesForTesting(fixed.get(), identity, gfx::Point3F(),
gfx::PointF(100, 100), gfx::Size(50, 50), true,
false);
@@ -8758,7 +8744,7 @@
translate.Translate(10, 10);
rotate.Rotate(45);
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(),
gfx::PointF(), gfx::Size(800, 800), true, false);
root->SetIsContainerForFixedPositionLayers(true);
@@ -8776,9 +8762,9 @@
}
TEST_F(LayerTreeHostCommonTest, ChangeTransformOrigin) {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
scoped_refptr<LayerWithForcedDrawsContent> child =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
root->AddChild(child);
host()->SetRootLayer(root);
@@ -8801,11 +8787,11 @@
}
TEST_F(LayerTreeHostCommonTest, UpdateScrollChildPosition) {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
scoped_refptr<LayerWithForcedDrawsContent> scroll_parent =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent> scroll_child =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
root->AddChild(scroll_child);
root->AddChild(scroll_parent);
@@ -8845,11 +8831,11 @@
// greater than or equal to the actual number of copy requests in the
// sub-layer_tree.
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
- scoped_refptr<Layer> child1 = Layer::Create(layer_settings());
- scoped_refptr<Layer> child2 = Layer::Create(layer_settings());
- scoped_refptr<Layer> grandchild = Layer::Create(layer_settings());
- scoped_refptr<Layer> greatgrandchild = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> child1 = Layer::Create();
+ scoped_refptr<Layer> child2 = Layer::Create();
+ scoped_refptr<Layer> grandchild = Layer::Create();
+ scoped_refptr<Layer> greatgrandchild = Layer::Create();
root->AddChild(child1);
root->AddChild(child2);
@@ -8873,15 +8859,15 @@
TEST_F(LayerTreeHostCommonTest, SkippingSubtreeMain) {
gfx::Transform identity;
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
FakeContentLayerClient client;
client.set_bounds(root->bounds());
scoped_refptr<LayerWithForcedDrawsContent> child =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<LayerWithForcedDrawsContent> grandchild =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
scoped_refptr<FakePictureLayer> greatgrandchild(
- FakePictureLayer::Create(layer_settings(), &client));
+ FakePictureLayer::Create(&client));
SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(),
gfx::PointF(), gfx::Size(100, 100), true, false);
SetLayerPropertiesForTesting(child.get(), identity, gfx::Point3F(),
@@ -9041,11 +9027,11 @@
TEST_F(LayerTreeHostCommonTest, SkippingLayer) {
gfx::Transform identity;
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
FakeContentLayerClient client;
client.set_bounds(root->bounds());
scoped_refptr<LayerWithForcedDrawsContent> child =
- make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings()));
+ make_scoped_refptr(new LayerWithForcedDrawsContent());
SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(),
gfx::PointF(), gfx::Size(100, 100), true, false);
SetLayerPropertiesForTesting(child.get(), identity, gfx::Point3F(),
@@ -9085,9 +9071,9 @@
TEST_F(LayerTreeHostCommonTest, LayerTreeRebuildTest) {
// Ensure that the treewalk in LayerTreeHostCommom::
// PreCalculateMetaInformation happens when its required.
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
- scoped_refptr<Layer> parent = Layer::Create(layer_settings());
- scoped_refptr<Layer> child = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> parent = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
root->AddChild(parent);
parent->AddChild(child);
@@ -9145,11 +9131,11 @@
gfx::Transform translate_z;
translate_z.Translate3d(0, 0, 10);
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(),
gfx::PointF(), gfx::Size(800, 800), true, false);
- scoped_refptr<Layer> child = Layer::Create(layer_settings());
+ scoped_refptr<Layer> child = Layer::Create();
SetLayerPropertiesForTesting(child.get(), translate_z, gfx::Point3F(),
gfx::PointF(), gfx::Size(100, 100), true, false);
@@ -9167,8 +9153,8 @@
}
TEST_F(LayerTreeHostCommonTest, ResetLayerDrawPropertiestest) {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
- scoped_refptr<Layer> child = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
root->AddChild(child);
gfx::Transform identity;
@@ -9924,19 +9910,19 @@
// parent4:1
// child9:1
// grand_child12:1
- scoped_refptr<Layer> root1 = Layer::Create(layer_settings());
- scoped_refptr<Layer> page_scale_layer = Layer::Create(layer_settings());
- scoped_refptr<Layer> parent2 = Layer::Create(layer_settings());
- scoped_refptr<Layer> parent3 = Layer::Create(layer_settings());
- scoped_refptr<Layer> parent4 = Layer::Create(layer_settings());
- scoped_refptr<Layer> parent5 = Layer::Create(layer_settings());
- scoped_refptr<Layer> child6 = Layer::Create(layer_settings());
- scoped_refptr<Layer> child7 = Layer::Create(layer_settings());
- scoped_refptr<Layer> child8 = Layer::Create(layer_settings());
- scoped_refptr<Layer> child9 = Layer::Create(layer_settings());
- scoped_refptr<Layer> grand_child10 = Layer::Create(layer_settings());
- scoped_refptr<Layer> grand_child11 = Layer::Create(layer_settings());
- scoped_refptr<Layer> grand_child12 = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root1 = Layer::Create();
+ scoped_refptr<Layer> page_scale_layer = Layer::Create();
+ scoped_refptr<Layer> parent2 = Layer::Create();
+ scoped_refptr<Layer> parent3 = Layer::Create();
+ scoped_refptr<Layer> parent4 = Layer::Create();
+ scoped_refptr<Layer> parent5 = Layer::Create();
+ scoped_refptr<Layer> child6 = Layer::Create();
+ scoped_refptr<Layer> child7 = Layer::Create();
+ scoped_refptr<Layer> child8 = Layer::Create();
+ scoped_refptr<Layer> child9 = Layer::Create();
+ scoped_refptr<Layer> grand_child10 = Layer::Create();
+ scoped_refptr<Layer> grand_child11 = Layer::Create();
+ scoped_refptr<Layer> grand_child12 = Layer::Create();
root1->AddChild(page_scale_layer);
page_scale_layer->AddChild(parent2);
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 43bcbe9..fcc856fd 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -111,7 +111,6 @@
settings.minimum_occlusion_tracking_size = gfx::Size();
settings.renderer_settings.texture_id_allocation_chunk_size = 1;
settings.gpu_rasterization_enabled = true;
- settings.use_compositor_animation_timelines = true;
return settings;
}
@@ -509,9 +508,7 @@
class LayerTreeHostImplTimelinesTest : public LayerTreeHostImplTest {
public:
void SetUp() override {
- LayerTreeSettings settings = DefaultSettings();
- settings.use_compositor_animation_timelines = true;
- CreateHostImpl(settings, CreateOutputSurface());
+ CreateHostImpl(DefaultSettings(), CreateOutputSurface());
}
};
diff --git a/cc/trees/layer_tree_host_pixeltest_blending.cc b/cc/trees/layer_tree_host_pixeltest_blending.cc
index 980d692..a53963ea 100644
--- a/cc/trees/layer_tree_host_pixeltest_blending.cc
+++ b/cc/trees/layer_tree_host_pixeltest_blending.cc
@@ -141,8 +141,7 @@
canvas->drawRect(
SkRect::MakeXYWH(0, i * kLaneHeight, kLaneWidth, kLaneHeight), paint);
}
- scoped_refptr<PictureImageLayer> layer =
- PictureImageLayer::Create(layer_settings());
+ scoped_refptr<PictureImageLayer> layer = PictureImageLayer::Create();
layer->SetIsDrawable(true);
layer->SetBounds(gfx::Size(width, height));
skia::RefPtr<const SkImage> image =
@@ -154,8 +153,7 @@
void SetupMaskLayer(scoped_refptr<Layer> layer) {
const int kMaskOffset = 2;
gfx::Size bounds = layer->bounds();
- scoped_refptr<PictureImageLayer> mask =
- PictureImageLayer::Create(layer_settings());
+ scoped_refptr<PictureImageLayer> mask = PictureImageLayer::Create();
mask->SetIsDrawable(true);
mask->SetIsMask(true);
mask->SetBounds(bounds);
diff --git a/cc/trees/layer_tree_host_pixeltest_masks.cc b/cc/trees/layer_tree_host_pixeltest_masks.cc
index a79186d..890e94a 100644
--- a/cc/trees/layer_tree_host_pixeltest_masks.cc
+++ b/cc/trees/layer_tree_host_pixeltest_masks.cc
@@ -81,8 +81,7 @@
gfx::Size mask_bounds(50, 50);
MaskContentLayerClient client(mask_bounds);
- scoped_refptr<PictureLayer> mask =
- PictureLayer::Create(layer_settings(), &client);
+ scoped_refptr<PictureLayer> mask = PictureLayer::Create(&client);
mask->SetBounds(mask_bounds);
mask->SetIsDrawable(true);
mask->SetIsMask(true);
@@ -98,8 +97,7 @@
gfx::Size mask_bounds(50, 50);
- scoped_refptr<PictureImageLayer> mask =
- PictureImageLayer::Create(layer_settings());
+ scoped_refptr<PictureImageLayer> mask = PictureImageLayer::Create();
mask->SetIsDrawable(true);
mask->SetIsMask(true);
mask->SetBounds(mask_bounds);
@@ -131,7 +129,7 @@
gfx::Rect(100, 100), SK_ColorWHITE);
// Clip to the top half of the green layer.
- scoped_refptr<Layer> clip = Layer::Create(layer_settings());
+ scoped_refptr<Layer> clip = Layer::Create();
clip->SetPosition(gfx::PointF());
clip->SetBounds(gfx::Size(100, 50));
clip->SetMasksToBounds(true);
@@ -143,8 +141,7 @@
gfx::Size mask_bounds(50, 50);
MaskContentLayerClient client(mask_bounds);
- scoped_refptr<PictureLayer> mask =
- PictureLayer::Create(layer_settings(), &client);
+ scoped_refptr<PictureLayer> mask = PictureLayer::Create(&client);
mask->SetBounds(mask_bounds);
mask->SetIsDrawable(true);
mask->SetIsMask(true);
@@ -161,8 +158,7 @@
gfx::Size mask_bounds(50, 50);
MaskContentLayerClient client(mask_bounds);
- scoped_refptr<PictureLayer> mask =
- PictureLayer::Create(layer_settings(), &client);
+ scoped_refptr<PictureLayer> mask = PictureLayer::Create(&client);
mask->SetBounds(mask_bounds);
mask->SetIsDrawable(true);
mask->SetIsMask(true);
@@ -175,7 +171,7 @@
gfx::Transform replica_transform;
replica_transform.Rotate(-90.0);
- scoped_refptr<Layer> replica = Layer::Create(layer_settings());
+ scoped_refptr<Layer> replica = Layer::Create();
replica->SetTransformOrigin(gfx::Point3F(25.f, 25.f, 0.f));
replica->SetPosition(gfx::PointF(50.f, 50.f));
replica->SetTransform(replica_transform);
@@ -191,15 +187,14 @@
gfx::Size mask_bounds(50, 50);
MaskContentLayerClient client(mask_bounds);
- scoped_refptr<PictureLayer> mask =
- PictureLayer::Create(layer_settings(), &client);
+ scoped_refptr<PictureLayer> mask = PictureLayer::Create(&client);
mask->SetBounds(mask_bounds);
mask->SetIsDrawable(true);
mask->SetIsMask(true);
// Clip to the bottom half of the green layer, and the left half of the
// replica.
- scoped_refptr<Layer> clip = Layer::Create(layer_settings());
+ scoped_refptr<Layer> clip = Layer::Create();
clip->SetPosition(gfx::PointF(0.f, 25.f));
clip->SetBounds(gfx::Size(75, 75));
clip->SetMasksToBounds(true);
@@ -213,7 +208,7 @@
gfx::Transform replica_transform;
replica_transform.Rotate(-90.0);
- scoped_refptr<Layer> replica = Layer::Create(layer_settings());
+ scoped_refptr<Layer> replica = Layer::Create();
replica->SetTransformOrigin(gfx::Point3F(25.f, 25.f, 0.f));
replica->SetPosition(gfx::PointF(50.f, 50.f));
replica->SetTransform(replica_transform);
@@ -230,8 +225,7 @@
gfx::Size mask_bounds(50, 50);
MaskContentLayerClient client(mask_bounds);
- scoped_refptr<PictureLayer> mask =
- PictureLayer::Create(layer_settings(), &client);
+ scoped_refptr<PictureLayer> mask = PictureLayer::Create(&client);
mask->SetBounds(mask_bounds);
mask->SetIsDrawable(true);
mask->SetIsMask(true);
@@ -248,7 +242,7 @@
replica_transform.Rotate(180.0);
replica_transform.Translate(50.0, 0.0);
- scoped_refptr<Layer> replica = Layer::Create(layer_settings());
+ scoped_refptr<Layer> replica = Layer::Create();
replica->SetTransformOrigin(gfx::Point3F(50.f, 50.f, 0.f));
replica->SetPosition(gfx::PointF());
replica->SetTransform(replica_transform);
@@ -265,14 +259,13 @@
gfx::Size mask_bounds(50, 50);
MaskContentLayerClient client(mask_bounds);
- scoped_refptr<PictureLayer> mask =
- PictureLayer::Create(layer_settings(), &client);
+ scoped_refptr<PictureLayer> mask = PictureLayer::Create(&client);
mask->SetBounds(mask_bounds);
mask->SetIsDrawable(true);
mask->SetIsMask(true);
// Clip to the bottom 3/4 of the green layer, and the top 3/4 of the replica.
- scoped_refptr<Layer> clip = Layer::Create(layer_settings());
+ scoped_refptr<Layer> clip = Layer::Create();
clip->SetPosition(gfx::PointF(0.f, 12.f));
clip->SetBounds(gfx::Size(100, 75));
clip->SetMasksToBounds(true);
@@ -290,7 +283,7 @@
replica_transform.Rotate(180.0);
replica_transform.Translate(50.0, 0.0);
- scoped_refptr<Layer> replica = Layer::Create(layer_settings());
+ scoped_refptr<Layer> replica = Layer::Create();
replica->SetTransformOrigin(gfx::Point3F(50.f, 50.f, 0.f));
replica->SetPosition(gfx::PointF());
replica->SetTransform(replica_transform);
@@ -405,8 +398,7 @@
gfx::Size picture_bounds(100, 100);
CheckerContentLayerClient picture_client(picture_bounds, SK_ColorGREEN, true);
- scoped_refptr<PictureLayer> picture =
- PictureLayer::Create(layer_settings(), &picture_client);
+ scoped_refptr<PictureLayer> picture = PictureLayer::Create(&picture_client);
picture->SetBounds(picture_bounds);
picture->SetIsDrawable(true);
@@ -421,8 +413,7 @@
gfx::Size mask_bounds(100, 100);
CircleContentLayerClient mask_client(mask_bounds);
- scoped_refptr<PictureLayer> mask =
- PictureLayer::Create(layer_settings(), &mask_client);
+ scoped_refptr<PictureLayer> mask = PictureLayer::Create(&mask_client);
mask->SetBounds(mask_bounds);
mask->SetIsDrawable(true);
mask->SetIsMask(true);
@@ -455,14 +446,14 @@
CheckerContentLayerClient picture_client_vertical(
picture_bounds, SK_ColorGREEN, true);
scoped_refptr<PictureLayer> picture_vertical =
- PictureLayer::Create(layer_settings(), &picture_client_vertical);
+ PictureLayer::Create(&picture_client_vertical);
picture_vertical->SetBounds(picture_bounds);
picture_vertical->SetIsDrawable(true);
CheckerContentLayerClient picture_client_horizontal(
picture_bounds, SK_ColorMAGENTA, false);
scoped_refptr<PictureLayer> picture_horizontal =
- PictureLayer::Create(layer_settings(), &picture_client_horizontal);
+ PictureLayer::Create(&picture_client_horizontal);
picture_horizontal->SetBounds(picture_bounds);
picture_horizontal->SetIsDrawable(true);
picture_horizontal->SetContentsOpaque(false);
@@ -473,8 +464,7 @@
gfx::Size mask_bounds(128, 128);
CircleContentLayerClient mask_client(mask_bounds);
- scoped_refptr<PictureLayer> mask =
- PictureLayer::Create(layer_settings(), &mask_client);
+ scoped_refptr<PictureLayer> mask = PictureLayer::Create(&mask_client);
mask->SetBounds(mask_bounds);
mask->SetIsDrawable(true);
mask->SetIsMask(true);
diff --git a/cc/trees/layer_tree_host_pixeltest_readback.cc b/cc/trees/layer_tree_host_pixeltest_readback.cc
index 6f21439..3b6dc81 100644
--- a/cc/trees/layer_tree_host_pixeltest_readback.cc
+++ b/cc/trees/layer_tree_host_pixeltest_readback.cc
@@ -486,18 +486,18 @@
TEST_P(LayerTreeHostReadbackDeviceScalePixelTest, ReadbackSubrect) {
scoped_refptr<FakePictureLayer> background =
- FakePictureLayer::Create(layer_settings(), &white_client_);
+ FakePictureLayer::Create(&white_client_);
background->SetBounds(gfx::Size(100, 100));
background->SetIsDrawable(true);
scoped_refptr<FakePictureLayer> green =
- FakePictureLayer::Create(layer_settings(), &green_client_);
+ FakePictureLayer::Create(&green_client_);
green->SetBounds(gfx::Size(100, 100));
green->SetIsDrawable(true);
background->AddChild(green);
scoped_refptr<FakePictureLayer> blue =
- FakePictureLayer::Create(layer_settings(), &blue_client_);
+ FakePictureLayer::Create(&blue_client_);
blue->SetPosition(gfx::PointF(50.f, 50.f));
blue->SetBounds(gfx::Size(25, 25));
blue->SetIsDrawable(true);
@@ -513,19 +513,19 @@
TEST_P(LayerTreeHostReadbackDeviceScalePixelTest, ReadbackNonRootLayerSubrect) {
scoped_refptr<FakePictureLayer> background =
- FakePictureLayer::Create(layer_settings(), &white_client_);
+ FakePictureLayer::Create(&white_client_);
background->SetBounds(gfx::Size(100, 100));
background->SetIsDrawable(true);
scoped_refptr<FakePictureLayer> green =
- FakePictureLayer::Create(layer_settings(), &green_client_);
+ FakePictureLayer::Create(&green_client_);
green->SetPosition(gfx::PointF(10.f, 20.f));
green->SetBounds(gfx::Size(90, 80));
green->SetIsDrawable(true);
background->AddChild(green);
scoped_refptr<FakePictureLayer> blue =
- FakePictureLayer::Create(layer_settings(), &blue_client_);
+ FakePictureLayer::Create(&blue_client_);
blue->SetPosition(gfx::PointF(50.f, 50.f));
blue->SetBounds(gfx::Size(25, 25));
blue->SetIsDrawable(true);
diff --git a/cc/trees/layer_tree_host_pixeltest_synchronous.cc b/cc/trees/layer_tree_host_pixeltest_synchronous.cc
index dbddedf..5561906 100644
--- a/cc/trees/layer_tree_host_pixeltest_synchronous.cc
+++ b/cc/trees/layer_tree_host_pixeltest_synchronous.cc
@@ -38,8 +38,7 @@
SkPaint green_paint;
green_paint.setColor(SkColorSetARGB(255, 0, 255, 0));
client.add_draw_rect(gfx::Rect(bounds), green_paint);
- scoped_refptr<PictureLayer> root =
- PictureLayer::Create(layer_settings(), &client);
+ scoped_refptr<PictureLayer> root = PictureLayer::Create(&client);
root->SetBounds(bounds);
root->SetIsDrawable(true);
@@ -70,8 +69,7 @@
SkPaint green_paint;
green_paint.setColor(SkColorSetARGB(255, 0, 255, 0));
client.add_draw_rect(gfx::Rect(bounds), green_paint);
- scoped_refptr<PictureLayer> root =
- PictureLayer::Create(layer_settings(), &client);
+ scoped_refptr<PictureLayer> root = PictureLayer::Create(&client);
root->SetBounds(bounds);
client.set_bounds(bounds);
root->SetIsDrawable(true);
diff --git a/cc/trees/layer_tree_host_pixeltest_tiles.cc b/cc/trees/layer_tree_host_pixeltest_tiles.cc
index fa31599..fecc47e 100644
--- a/cc/trees/layer_tree_host_pixeltest_tiles.cc
+++ b/cc/trees/layer_tree_host_pixeltest_tiles.cc
@@ -153,7 +153,7 @@
public:
LayerTreeHostTilesTestPartialInvalidation()
: client_(gfx::Size(200, 200)),
- picture_layer_(PictureLayer::Create(layer_settings(), &client_)) {
+ picture_layer_(PictureLayer::Create(&client_)) {
picture_layer_->SetBounds(gfx::Size(200, 200));
picture_layer_->SetIsDrawable(true);
}
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 33c3ff6..25548da 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -260,7 +260,7 @@
void SetupTree() override {
client_.set_fill_with_nonsolid_color(true);
scoped_refptr<FakePictureLayer> root_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
root_layer->SetBounds(gfx::Size(1024, 1024));
root_layer->SetIsDrawable(true);
@@ -331,7 +331,7 @@
void SetupTree() override {
client_.set_fill_with_nonsolid_color(true);
scoped_refptr<FakePictureLayer> root_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
root_layer->SetBounds(gfx::Size(1024, 1024));
root_layer->SetIsDrawable(true);
@@ -369,7 +369,7 @@
void SetupTree() override {
client_.set_fill_with_nonsolid_color(true);
scoped_refptr<FakePictureLayer> root_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
root_layer->SetBounds(gfx::Size(1024, 1024));
client_.set_bounds(root_layer->bounds());
root_layer->SetIsDrawable(true);
@@ -598,7 +598,7 @@
class LayerTreeHostTestPushPropertiesTo : public LayerTreeHostTest {
protected:
void SetupTree() override {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(10, 10));
layer_tree_host()->SetRootLayer(root);
LayerTreeHostTest::SetupTree();
@@ -691,7 +691,7 @@
class LayerTreeHostTestPropertyTreesChangedSync : public LayerTreeHostTest {
protected:
void SetupTree() override {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
layer_tree_host()->SetRootLayer(root);
LayerTreeHostTest::SetupTree();
}
@@ -796,7 +796,7 @@
: num_draws_(0), bounds_(50, 50), invalid_rect_(10, 10, 20, 20) {}
void BeginTest() override {
- root_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_layer_ = FakePictureLayer::Create(&client_);
root_layer_->SetIsDrawable(true);
root_layer_->SetBounds(bounds_);
layer_tree_host()->SetRootLayer(root_layer_);
@@ -855,7 +855,7 @@
void BeginTest() override {
client_.set_fill_with_nonsolid_color(true);
- root_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_layer_ = FakePictureLayer::Create(&client_);
root_layer_->SetIsDrawable(true);
gfx::Transform transform;
// Translate the layer out of the viewport to force it to not update its
@@ -933,10 +933,10 @@
}
void SetupTree() override {
- root_layer_ = Layer::Create(layer_settings());
+ root_layer_ = Layer::Create();
root_layer_->SetBounds(gfx::Size(10, 20));
- scaled_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ scaled_layer_ = FakePictureLayer::Create(&client_);
scaled_layer_->SetBounds(gfx::Size(1, 1));
root_layer_->AddChild(scaled_layer_);
@@ -984,13 +984,13 @@
}
void SetupTree() override {
- root_layer_ = Layer::Create(layer_settings());
+ root_layer_ = Layer::Create();
root_layer_->SetBounds(gfx::Size(10, 20));
bool paint_scrollbar = true;
bool has_thumb = false;
- scrollbar_ = FakePaintedScrollbarLayer::Create(
- layer_settings(), paint_scrollbar, has_thumb, root_layer_->id());
+ scrollbar_ = FakePaintedScrollbarLayer::Create(paint_scrollbar, has_thumb,
+ root_layer_->id());
scrollbar_->SetPosition(gfx::PointF(0.f, 10.f));
scrollbar_->SetBounds(gfx::Size(10, 10));
@@ -1042,10 +1042,10 @@
}
void SetupTree() override {
- root_layer_ = Layer::Create(layer_settings());
+ root_layer_ = Layer::Create();
root_layer_->SetBounds(gfx::Size(10, 20));
- child_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ child_layer_ = FakePictureLayer::Create(&client_);
child_layer_->SetBounds(gfx::Size(10, 10));
root_layer_->AddChild(child_layer_);
@@ -1105,7 +1105,7 @@
: num_draws_(0), bounds_(50, 50), invalid_rect_(10, 10, 20, 20) {}
void BeginTest() override {
- root_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_layer_ = FakePictureLayer::Create(&client_);
root_layer_->SetIsDrawable(true);
root_layer_->SetBounds(bounds_);
layer_tree_host()->SetRootLayer(root_layer_);
@@ -1198,19 +1198,19 @@
}
void SetupTree() override {
- root_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_layer_ = FakePictureLayer::Create(&client_);
root_layer_->SetIsDrawable(true);
root_layer_->SetBounds(gfx::Size(50, 50));
layer_tree_host()->SetRootLayer(root_layer_);
// The initially transparent layer has a larger child layer, which is
// not initially drawn because of the this (parent) layer.
- parent_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ parent_layer_ = FakePictureLayer::Create(&client_);
parent_layer_->SetBounds(gfx::Size(15, 15));
parent_layer_->SetOpacity(0.0f);
root_layer_->AddChild(parent_layer_);
- child_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ child_layer_ = FakePictureLayer::Create(&client_);
child_layer_->SetBounds(gfx::Size(25, 25));
parent_layer_->AddChild(child_layer_);
client_.set_bounds(root_layer_->bounds());
@@ -1295,12 +1295,12 @@
scoped_ptr<FakeDisplayListRecordingSource> recording(
new FakeDisplayListRecordingSource);
root_layer_ = FakePictureLayer::CreateWithRecordingSource(
- layer_settings(), &client_, std::move(recording));
+ &client_, std::move(recording));
root_layer_->SetBounds(gfx::Size(50, 50));
recording.reset(new FakeDisplayListRecordingSource);
child_layer_ = FakePictureLayer::CreateWithRecordingSource(
- layer_settings(), &client_, std::move(recording));
+ &client_, std::move(recording));
child_layer_->SetBounds(gfx::Size(25, 25));
child_layer_->SetIsDrawable(true);
child_layer_->SetContentsOpaque(true);
@@ -1543,8 +1543,7 @@
Layer* root_layer = layer_tree_host()->root_layer();
- scoped_refptr<FakePictureLayer> layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ scoped_refptr<FakePictureLayer> layer = FakePictureLayer::Create(&client_);
layer->set_always_update_resources(true);
scroll_layer_ = layer;
@@ -1552,12 +1551,8 @@
2 * root_layer->bounds().height()));
scroll_layer_->SetScrollOffset(gfx::ScrollOffset());
- CreateVirtualViewportLayers(root_layer,
- scroll_layer_,
- root_layer->bounds(),
- root_layer->bounds(),
- layer_tree_host(),
- layer_settings());
+ CreateVirtualViewportLayers(root_layer, scroll_layer_, root_layer->bounds(),
+ root_layer->bounds(), layer_tree_host());
layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 2.f);
client_.set_bounds(root_layer->bounds());
@@ -1677,8 +1672,8 @@
void SetupTree() override {
LayerTreeHostTest::SetupTree();
- update_check_picture_layer_ = FakePictureLayer::Create(
- layer_settings(), &test_opacity_change_delegate_);
+ update_check_picture_layer_ =
+ FakePictureLayer::Create(&test_opacity_change_delegate_);
test_opacity_change_delegate_.SetTestLayer(
update_check_picture_layer_.get());
layer_tree_host()->root_layer()->AddChild(update_check_picture_layer_);
@@ -1707,8 +1702,8 @@
void BeginTest() override {
client_.set_fill_with_nonsolid_color(true);
- root_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
- child_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_layer_ = FakePictureLayer::Create(&client_);
+ child_layer_ = FakePictureLayer::Create(&client_);
layer_tree_host()->SetViewportSize(gfx::Size(60, 60));
layer_tree_host()->SetDeviceScaleFactor(1.5);
@@ -1814,7 +1809,7 @@
layer_tree_host()->SetViewportSize(gfx::Size(10, 10));
layer_tree_host()->root_layer()->SetBounds(gfx::Size(10, 10));
- layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ layer_ = FakePictureLayer::Create(&client_);
layer_->SetBounds(gfx::Size(10, 10));
layer_->SetPosition(gfx::PointF(0.f, 0.f));
layer_->SetIsDrawable(true);
@@ -1989,8 +1984,7 @@
void SetupTree() override {
num_tiles_rastered_ = 0;
- scoped_refptr<Layer> root_layer =
- PictureLayer::Create(layer_settings(), &client_);
+ scoped_refptr<Layer> root_layer = PictureLayer::Create(&client_);
client_.set_fill_with_nonsolid_color(true);
root_layer->SetIsDrawable(true);
root_layer->SetBounds(gfx::Size(10, 10));
@@ -2228,8 +2222,7 @@
void SetupTree() override {
LayerTreeHostTest::SetupTree();
- scoped_refptr<Layer> layer =
- PictureLayer::Create(layer_settings(), &client_);
+ scoped_refptr<Layer> layer = PictureLayer::Create(&client_);
layer->SetTransform(gfx::Transform(0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
layer->SetBounds(gfx::Size(10, 10));
layer_tree_host()->root_layer()->AddChild(layer);
@@ -2281,8 +2274,7 @@
LayerTreeHostTestChangeLayerPropertiesInPaintContents() : num_commits_(0) {}
void SetupTree() override {
- scoped_refptr<PictureLayer> root_layer =
- PictureLayer::Create(layer_settings(), &client_);
+ scoped_refptr<PictureLayer> root_layer = PictureLayer::Create(&client_);
root_layer->SetIsDrawable(true);
root_layer->SetBounds(gfx::Size(1, 1));
client_.set_layer(root_layer.get());
@@ -2364,8 +2356,7 @@
io_surface_id_ = 9;
io_surface_size_ = gfx::Size(6, 7);
- scoped_refptr<IOSurfaceLayer> io_surface_layer =
- IOSurfaceLayer::Create(layer_settings());
+ scoped_refptr<IOSurfaceLayer> io_surface_layer = IOSurfaceLayer::Create();
io_surface_layer->SetBounds(gfx::Size(10, 10));
io_surface_layer->SetIsDrawable(true);
io_surface_layer->SetContentsOpaque(true);
@@ -2511,16 +2502,16 @@
}
void SetupTree() override {
- root_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_layer_ = FakePictureLayer::Create(&client_);
root_layer_->SetIsDrawable(true);
root_layer_->SetBounds(gfx::Size(50, 50));
- parent_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ parent_layer_ = FakePictureLayer::Create(&client_);
parent_layer_->SetIsDrawable(true);
parent_layer_->SetBounds(gfx::Size(50, 50));
parent_layer_->SetForceRenderSurface(true);
- child_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ child_layer_ = FakePictureLayer::Create(&client_);
child_layer_->SetIsDrawable(true);
child_layer_->SetBounds(gfx::Size(50, 50));
@@ -2739,9 +2730,8 @@
class PushPropertiesCountingLayer : public Layer {
public:
- static scoped_refptr<PushPropertiesCountingLayer> Create(
- const LayerSettings& settings) {
- return new PushPropertiesCountingLayer(settings);
+ static scoped_refptr<PushPropertiesCountingLayer> Create() {
+ return new PushPropertiesCountingLayer();
}
void PushPropertiesTo(LayerImpl* layer) override {
@@ -2768,10 +2758,8 @@
}
private:
- explicit PushPropertiesCountingLayer(const LayerSettings& settings)
- : Layer(settings),
- push_properties_count_(0),
- persist_needs_push_properties_(false) {
+ PushPropertiesCountingLayer()
+ : push_properties_count_(0), persist_needs_push_properties_(false) {
SetBounds(gfx::Size(1, 1));
}
~PushPropertiesCountingLayer() override {}
@@ -2794,12 +2782,11 @@
}
void SetupTree() override {
- root_ = PushPropertiesCountingLayer::Create(layer_settings());
- child_ = PushPropertiesCountingLayer::Create(layer_settings());
- child2_ = PushPropertiesCountingLayer::Create(layer_settings());
- grandchild_ = PushPropertiesCountingLayer::Create(layer_settings());
- leaf_always_pushing_layer_ =
- PushPropertiesCountingLayer::Create(layer_settings());
+ root_ = PushPropertiesCountingLayer::Create();
+ child_ = PushPropertiesCountingLayer::Create();
+ child2_ = PushPropertiesCountingLayer::Create();
+ grandchild_ = PushPropertiesCountingLayer::Create();
+ leaf_always_pushing_layer_ = PushPropertiesCountingLayer::Create();
leaf_always_pushing_layer_->set_persist_needs_push_properties(true);
root_->AddChild(child_);
@@ -2807,7 +2794,7 @@
child_->AddChild(grandchild_);
child2_->AddChild(leaf_always_pushing_layer_);
- other_root_ = PushPropertiesCountingLayer::Create(layer_settings());
+ other_root_ = PushPropertiesCountingLayer::Create();
// Don't set the root layer here.
LayerTreeHostTest::SetupTree();
@@ -3188,13 +3175,13 @@
void BeginTest() override { PostSetNeedsCommitToMainThread(); }
void SetupTree() override {
- root_ = Layer::Create(layer_settings());
+ root_ = Layer::Create();
root_->SetBounds(gfx::Size(1, 1));
bool paint_scrollbar = true;
bool has_thumb = false;
scrollbar_layer_ = FakePaintedScrollbarLayer::Create(
- layer_settings(), paint_scrollbar, has_thumb, root_->id());
+ paint_scrollbar, has_thumb, root_->id());
root_->AddChild(scrollbar_layer_);
@@ -3244,8 +3231,8 @@
void BeginTest() override { PostSetNeedsCommitToMainThread(); }
void SetupTree() override {
- root_ = PushPropertiesCountingLayer::Create(layer_settings());
- child_ = PushPropertiesCountingLayer::Create(layer_settings());
+ root_ = PushPropertiesCountingLayer::Create();
+ child_ = PushPropertiesCountingLayer::Create();
root_->AddChild(child_);
layer_tree_host()->SetRootLayer(root_);
@@ -3305,11 +3292,11 @@
}
void SetupTree() override {
- root_ = PushPropertiesCountingLayer::Create(layer_settings());
- child_ = PushPropertiesCountingLayer::Create(layer_settings());
- grandchild1_ = PushPropertiesCountingLayer::Create(layer_settings());
- grandchild2_ = PushPropertiesCountingLayer::Create(layer_settings());
- grandchild3_ = PushPropertiesCountingLayer::Create(layer_settings());
+ root_ = PushPropertiesCountingLayer::Create();
+ child_ = PushPropertiesCountingLayer::Create();
+ grandchild1_ = PushPropertiesCountingLayer::Create();
+ grandchild2_ = PushPropertiesCountingLayer::Create();
+ grandchild3_ = PushPropertiesCountingLayer::Create();
root_->AddChild(child_);
child_->AddChild(grandchild1_);
@@ -3806,8 +3793,8 @@
public:
void SetupTree() override {
LayerTreeHostTest::SetupTree();
- scoped_refptr<VideoLayer> video_layer = VideoLayer::Create(
- layer_settings(), &provider_, media::VIDEO_ROTATION_0);
+ scoped_refptr<VideoLayer> video_layer =
+ VideoLayer::Create(&provider_, media::VIDEO_ROTATION_0);
video_layer->SetBounds(gfx::Size(10, 10));
video_layer->SetIsDrawable(true);
layer_tree_host()->root_layer()->AddChild(video_layer);
@@ -3829,8 +3816,7 @@
public:
void SetupTree() override {
LayerTreeHostTest::SetupTree();
- scoped_refptr<IOSurfaceLayer> layer =
- IOSurfaceLayer::Create(layer_settings());
+ scoped_refptr<IOSurfaceLayer> layer = IOSurfaceLayer::Create();
layer->SetBounds(gfx::Size(10, 10));
uint32_t fake_io_surface_id = 7;
layer->SetIOSurfaceProperties(fake_io_surface_id, layer->bounds());
@@ -3846,17 +3832,17 @@
class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest {
protected:
void SetupTree() override {
- root_layer_ = Layer::Create(layer_settings());
+ root_layer_ = Layer::Create();
root_layer_->SetPosition(gfx::PointF());
root_layer_->SetBounds(gfx::Size(10, 10));
- parent_layer_ = SolidColorLayer::Create(layer_settings());
+ parent_layer_ = SolidColorLayer::Create();
parent_layer_->SetPosition(gfx::PointF());
parent_layer_->SetBounds(gfx::Size(10, 10));
parent_layer_->SetIsDrawable(true);
root_layer_->AddChild(parent_layer_);
- child_layer_ = SolidColorLayer::Create(layer_settings());
+ child_layer_ = SolidColorLayer::Create();
child_layer_->SetPosition(gfx::PointF());
child_layer_->SetBounds(gfx::Size(10, 10));
child_layer_->SetIsDrawable(true);
@@ -3912,7 +3898,7 @@
class LayerTreeHostTestUpdateLayerInEmptyViewport : public LayerTreeHostTest {
protected:
void SetupTree() override {
- root_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_layer_ = FakePictureLayer::Create(&client_);
root_layer_->SetBounds(gfx::Size(10, 10));
layer_tree_host()->SetRootLayer(root_layer_);
@@ -3952,17 +3938,14 @@
}
void SetupTree() override {
- root_layer_ = Layer::Create(layer_settings());
+ root_layer_ = Layer::Create();
root_layer_->SetBounds(gfx::Size(10, 10));
- scoped_refptr<Layer> inner_viewport_container_layer =
- Layer::Create(layer_settings());
+ scoped_refptr<Layer> inner_viewport_container_layer = Layer::Create();
inner_viewport_container_layer->SetBounds(gfx::Size(10, 10));
- scoped_refptr<Layer> overscroll_elasticity_layer =
- Layer::Create(layer_settings());
- scoped_refptr<Layer> page_scale_layer = Layer::Create(layer_settings());
- scoped_refptr<Layer> inner_viewport_scroll_layer =
- Layer::Create(layer_settings());
+ scoped_refptr<Layer> overscroll_elasticity_layer = Layer::Create();
+ scoped_refptr<Layer> page_scale_layer = Layer::Create();
+ scoped_refptr<Layer> inner_viewport_scroll_layer = Layer::Create();
inner_viewport_scroll_layer->SetScrollClipLayerId(
inner_viewport_container_layer->id());
inner_viewport_scroll_layer->SetIsContainerForFixedPositionLayers(true);
@@ -3972,8 +3955,7 @@
overscroll_elasticity_layer->AddChild(page_scale_layer);
page_scale_layer->AddChild(inner_viewport_scroll_layer);
- scoped_refptr<Layer> content_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ scoped_refptr<Layer> content_layer = FakePictureLayer::Create(&client_);
content_layer->SetBounds(gfx::Size(10, 10));
inner_viewport_scroll_layer->AddChild(content_layer);
@@ -4074,7 +4056,7 @@
}
void SetupTree() override {
- root_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_ = FakePictureLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
layer_tree_host()->SetRootLayer(root_);
LayerTreeHostTest::SetupTree();
@@ -4328,7 +4310,7 @@
LayerTreeHostTestKeepSwapPromise() {}
void BeginTest() override {
- layer_ = SolidColorLayer::Create(layer_settings());
+ layer_ = SolidColorLayer::Create();
layer_->SetIsDrawable(true);
layer_->SetBounds(gfx::Size(10, 10));
layer_tree_host()->SetRootLayer(layer_);
@@ -4648,7 +4630,7 @@
scoped_refptr<FakePictureLayer> layer =
FakePictureLayer::CreateWithRecordingSource(
- layer_settings(), &layer_client_, std::move(recording_source));
+ &layer_client_, std::move(recording_source));
layer_ = layer.get();
layer->SetBounds(gfx::Size(10, 10));
layer->SetIsDrawable(true);
@@ -4704,7 +4686,7 @@
scoped_refptr<FakePictureLayer> layer =
FakePictureLayer::CreateWithRecordingSource(
- layer_settings(), &layer_client_, std::move(recording_source));
+ &layer_client_, std::move(recording_source));
layer_ = layer.get();
layer->SetBounds(gfx::Size());
layer->SetIsDrawable(true);
@@ -4762,7 +4744,7 @@
scoped_refptr<FakePictureLayer> layer =
FakePictureLayer::CreateWithRecordingSource(
- layer_settings(), &layer_client_, std::move(recording_source));
+ &layer_client_, std::move(recording_source));
layer_ = layer.get();
layer->SetBounds(gfx::Size(10, 10));
layer->SetIsDrawable(true);
@@ -4832,7 +4814,7 @@
scoped_refptr<FakePictureLayer> layer =
FakePictureLayer::CreateWithRecordingSource(
- layer_settings(), &layer_client_, std::move(recording_source));
+ &layer_client_, std::move(recording_source));
layer_ = layer.get();
layer->SetBounds(gfx::Size(10, 10));
@@ -5261,12 +5243,12 @@
posted_ = false;
client_.set_fill_with_nonsolid_color(true);
- scoped_refptr<Layer> root_clip = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root_clip = Layer::Create();
root_clip->SetBounds(gfx::Size(500, 500));
- scoped_refptr<Layer> page_scale_layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> page_scale_layer = Layer::Create();
page_scale_layer->SetBounds(gfx::Size(500, 500));
- scoped_refptr<Layer> pinch = Layer::Create(layer_settings());
+ scoped_refptr<Layer> pinch = Layer::Create();
pinch->SetBounds(gfx::Size(500, 500));
pinch->SetScrollClipLayerId(root_clip->id());
pinch->SetIsContainerForFixedPositionLayers(true);
@@ -5277,7 +5259,7 @@
new FakeDisplayListRecordingSource);
recording->SetPlaybackAllowedEvent(&playback_allowed_event_);
scoped_refptr<FakePictureLayer> layer =
- FakePictureLayer::CreateWithRecordingSource(layer_settings(), &client_,
+ FakePictureLayer::CreateWithRecordingSource(&client_,
std::move(recording));
layer->SetBounds(gfx::Size(500, 500));
layer->SetContentsOpaque(true);
@@ -5475,14 +5457,14 @@
void SetupTree() override {
client_.set_fill_with_nonsolid_color(true);
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(500, 500));
client_.set_bounds(root->bounds());
scoped_ptr<FakeDisplayListRecordingSource> recording(
new FakeDisplayListRecordingSource);
scoped_refptr<FakePictureLayer> layer =
- FakePictureLayer::CreateWithRecordingSource(layer_settings(), &client_,
+ FakePictureLayer::CreateWithRecordingSource(&client_,
std::move(recording));
layer->SetBounds(gfx::Size(500, 500));
layer->SetContentsOpaque(true);
@@ -5524,7 +5506,7 @@
scoped_ptr<FakeDisplayListRecordingSource> recording(
new FakeDisplayListRecordingSource);
scoped_refptr<FakePictureLayer> root =
- FakePictureLayer::CreateWithRecordingSource(layer_settings(), &client_,
+ FakePictureLayer::CreateWithRecordingSource(&client_,
std::move(recording));
root->SetBounds(gfx::Size(10000, 10000));
client_.set_bounds(root->bounds());
@@ -5566,12 +5548,12 @@
continuous_draws_ = 0;
client_.set_fill_with_nonsolid_color(true);
- scoped_refptr<Layer> root_clip = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root_clip = Layer::Create();
root_clip->SetBounds(gfx::Size(500, 500));
- scoped_refptr<Layer> page_scale_layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> page_scale_layer = Layer::Create();
page_scale_layer->SetBounds(gfx::Size(500, 500));
- scoped_refptr<Layer> pinch = Layer::Create(layer_settings());
+ scoped_refptr<Layer> pinch = Layer::Create();
pinch->SetBounds(gfx::Size(500, 500));
pinch->SetScrollClipLayerId(root_clip->id());
pinch->SetIsContainerForFixedPositionLayers(true);
@@ -5582,7 +5564,7 @@
new FakeDisplayListRecordingSource);
recording->SetPlaybackAllowedEvent(&playback_allowed_event_);
scoped_refptr<FakePictureLayer> layer =
- FakePictureLayer::CreateWithRecordingSource(layer_settings(), &client_,
+ FakePictureLayer::CreateWithRecordingSource(&client_,
std::move(recording));
layer->SetBounds(gfx::Size(500, 500));
layer->SetContentsOpaque(true);
@@ -5743,7 +5725,7 @@
void SetupTree() override {
client_.set_fill_with_nonsolid_color(true);
scoped_refptr<FakePictureLayer> root_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
root_layer->SetBounds(gfx::Size(1500, 1500));
root_layer->SetIsDrawable(true);
@@ -5799,12 +5781,12 @@
void SetupTree() override {
scoped_refptr<FakePictureLayer> root_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
root_layer->SetBounds(gfx::Size(200, 200));
root_layer->SetIsDrawable(true);
scoped_refptr<FakePictureLayer> child_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
child_layer->SetBounds(gfx::Size(1500, 1500));
child_layer->SetIsDrawable(true);
@@ -5887,7 +5869,7 @@
void SetupTree() override {
client_.set_fill_with_nonsolid_color(true);
scoped_refptr<FakePictureLayer> root_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
root_layer->SetBounds(gfx::Size(150, 150));
root_layer->SetIsDrawable(true);
@@ -5966,8 +5948,8 @@
class LayerTreeHostTestUpdateCopyRequests : public LayerTreeHostTest {
protected:
void SetupTree() override {
- root = Layer::Create(layer_settings());
- child = Layer::Create(layer_settings());
+ root = Layer::Create();
+ child = Layer::Create();
root->AddChild(child);
layer_tree_host()->SetRootLayer(root);
LayerTreeHostTest::SetupTree();
@@ -6025,21 +6007,21 @@
// the surface bounds to be larger. It also has a parent that clips the
// masked layer and its surface.
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
- scoped_refptr<Layer> clipping_layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> clipping_layer = Layer::Create();
root->AddChild(clipping_layer);
scoped_refptr<FakePictureLayer> content_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
clipping_layer->AddChild(content_layer);
scoped_refptr<FakePictureLayer> content_child_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
content_layer->AddChild(content_child_layer);
scoped_refptr<FakePictureLayer> mask_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
content_layer->SetMaskLayer(mask_layer.get());
gfx::Size root_size(100, 100);
@@ -6122,17 +6104,17 @@
// +-- Content Layer
// +--Mask
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
- scoped_refptr<Layer> scaling_layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> scaling_layer = Layer::Create();
root->AddChild(scaling_layer);
scoped_refptr<FakePictureLayer> content_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
scaling_layer->AddChild(content_layer);
scoped_refptr<FakePictureLayer> mask_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
content_layer->SetMaskLayer(mask_layer.get());
gfx::Size root_size(100, 100);
@@ -6218,14 +6200,14 @@
// The mask layer has bounds 100x100 but is attached to a layer with bounds
// 50x50.
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
scoped_refptr<FakePictureLayer> content_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
root->AddChild(content_layer);
scoped_refptr<FakePictureLayer> mask_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
content_layer->SetMaskLayer(mask_layer.get());
gfx::Size root_size(100, 100);
@@ -6307,17 +6289,17 @@
// The replica's mask layer has bounds 100x100 but the replica is of a
// layer with bounds 50x50.
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
scoped_refptr<FakePictureLayer> content_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
root->AddChild(content_layer);
- scoped_refptr<Layer> replica_layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> replica_layer = Layer::Create();
content_layer->SetReplicaLayer(replica_layer.get());
scoped_refptr<FakePictureLayer> mask_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
replica_layer->SetMaskLayer(mask_layer.get());
gfx::Size root_size(100, 100);
@@ -6401,20 +6383,20 @@
// The replica is of a layer with bounds 50x50, but it has a child that
// causes the surface bounds to be larger.
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
scoped_refptr<FakePictureLayer> content_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
root->AddChild(content_layer);
- content_child_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ content_child_layer_ = FakePictureLayer::Create(&client_);
content_layer->AddChild(content_child_layer_);
- scoped_refptr<Layer> replica_layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> replica_layer = Layer::Create();
content_layer->SetReplicaLayer(replica_layer.get());
scoped_refptr<FakePictureLayer> mask_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
replica_layer->SetMaskLayer(mask_layer.get());
gfx::Size root_size(100, 100);
@@ -6506,14 +6488,13 @@
// -page scale child2
// -post page scale
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
- scoped_refptr<Layer> pre_page_scale = Layer::Create(layer_settings());
- scoped_refptr<Layer> page_scale = Layer::Create(layer_settings());
- scoped_refptr<Layer> page_scale_child1 = Layer::Create(layer_settings());
- scoped_refptr<Layer> page_scale_grandchild =
- Layer::Create(layer_settings());
- scoped_refptr<Layer> page_scale_child2 = Layer::Create(layer_settings());
- scoped_refptr<Layer> post_page_scale = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
+ scoped_refptr<Layer> pre_page_scale = Layer::Create();
+ scoped_refptr<Layer> page_scale = Layer::Create();
+ scoped_refptr<Layer> page_scale_child1 = Layer::Create();
+ scoped_refptr<Layer> page_scale_grandchild = Layer::Create();
+ scoped_refptr<Layer> page_scale_child2 = Layer::Create();
+ scoped_refptr<Layer> post_page_scale = Layer::Create();
root->AddChild(pre_page_scale);
root->AddChild(page_scale);
@@ -6575,10 +6556,9 @@
void SetupTree() override {
LayerTreeHostTest::SetupTree();
Layer* root_layer = layer_tree_host()->root_layer();
- scoped_refptr<Layer> scroll_layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> scroll_layer = Layer::Create();
CreateVirtualViewportLayers(root_layer, scroll_layer, root_layer->bounds(),
- root_layer->bounds(), layer_tree_host(),
- layer_settings());
+ root_layer->bounds(), layer_tree_host());
}
void BeginTest() override {
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc
index 54088ee..81957147 100644
--- a/cc/trees/layer_tree_host_unittest_animation.cc
+++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -43,14 +43,6 @@
player_->set_layer_animation_delegate(this);
}
- void InitializeSettings(LayerTreeSettings* settings) override {
- settings->use_compositor_animation_timelines = true;
- }
-
- void InitializeLayerSettings(LayerSettings* layer_settings) override {
- layer_settings->use_compositor_animation_timelines = true;
- }
-
void AttachPlayersToTimeline() {
layer_tree_host()->animation_host()->AddAnimationTimeline(timeline_.get());
timeline_->AttachPlayer(player_.get());
@@ -275,7 +267,7 @@
public:
void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
- picture_ = FakePictureLayer::Create(layer_settings(), &client_);
+ picture_ = FakePictureLayer::Create(&client_);
picture_->SetBounds(gfx::Size(4, 4));
client_.set_bounds(picture_->bounds());
layer_tree_host()->root_layer()->AddChild(picture_);
@@ -340,7 +332,7 @@
public:
void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
- picture_ = FakePictureLayer::Create(layer_settings(), &client_);
+ picture_ = FakePictureLayer::Create(&client_);
picture_->SetBounds(gfx::Size(4, 4));
client_.set_bounds(picture_->bounds());
@@ -433,7 +425,7 @@
: update_check_layer_() {}
void SetupTree() override {
- update_check_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ update_check_layer_ = FakePictureLayer::Create(&client_);
update_check_layer_->SetOpacity(0.f);
layer_tree_host()->SetRootLayer(update_check_layer_);
client_.set_bounds(update_check_layer_->bounds());
@@ -489,7 +481,7 @@
if (layer_tree_host()->source_frame_number() == 1) {
AttachPlayersToTimeline();
- scoped_refptr<Layer> layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> layer = Layer::Create();
player_->AttachLayer(layer->id());
player_->set_layer_animation_delegate(this);
@@ -635,7 +627,7 @@
: public LayerTreeHostAnimationTest {
void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
- picture_ = FakePictureLayer::Create(layer_settings(), &client_);
+ picture_ = FakePictureLayer::Create(&client_);
picture_->SetBounds(gfx::Size(4, 4));
client_.set_bounds(picture_->bounds());
layer_tree_host()->root_layer()->AddChild(picture_);
@@ -722,7 +714,7 @@
void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
- scroll_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ scroll_layer_ = FakePictureLayer::Create(&client_);
scroll_layer_->SetScrollClipLayerId(layer_tree_host()->root_layer()->id());
scroll_layer_->SetBounds(gfx::Size(1000, 1000));
client_.set_bounds(scroll_layer_->bounds());
@@ -783,7 +775,7 @@
void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
- scroll_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ scroll_layer_ = FakePictureLayer::Create(&client_);
scroll_layer_->SetScrollClipLayerId(layer_tree_host()->root_layer()->id());
scroll_layer_->SetBounds(gfx::Size(10000, 10000));
client_.set_bounds(scroll_layer_->bounds());
@@ -911,7 +903,7 @@
} else if (layer_tree_host()->source_frame_number() == 2) {
AddOpacityTransitionToPlayer(player_.get(), 1, 0.f, 0.5f, true);
- scoped_refptr<Layer> layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> layer = Layer::Create();
layer_tree_host()->root_layer()->AddChild(layer);
layer->SetBounds(gfx::Size(4, 4));
@@ -995,7 +987,7 @@
void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
- layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ layer_ = FakePictureLayer::Create(&client_);
layer_->SetBounds(gfx::Size(2, 2));
client_.set_bounds(layer_->bounds());
// Transform the layer to 4,4 to start.
@@ -1073,7 +1065,7 @@
public:
void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
- layer_ = Layer::Create(layer_settings());
+ layer_ = Layer::Create();
layer_->SetBounds(gfx::Size(4, 4));
layer_tree_host()->root_layer()->AddChild(layer_);
@@ -1170,7 +1162,7 @@
public:
void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
- layer_ = Layer::Create(layer_settings());
+ layer_ = Layer::Create();
layer_->SetBounds(gfx::Size(4, 4));
layer_tree_host()->root_layer()->AddChild(layer_);
@@ -1233,7 +1225,7 @@
public:
void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
- layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ layer_ = FakePictureLayer::Create(&client_);
layer_->SetBounds(gfx::Size(4, 4));
client_.set_bounds(layer_->bounds());
layer_tree_host()->root_layer()->AddChild(layer_);
@@ -1270,7 +1262,7 @@
// added/deleted when something triggers a rebuild. Adding a layer
// triggers a rebuild, and since the layer that had an animation before
// no longer has one, it doesn't get a transform node in the rebuild.
- layer_->AddChild(Layer::Create(layer_settings()));
+ layer_->AddChild(Layer::Create());
break;
}
}
@@ -1315,7 +1307,7 @@
public:
void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
- layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ layer_ = FakePictureLayer::Create(&client_);
layer_->SetBounds(gfx::Size(4, 4));
client_.set_bounds(layer_->bounds());
layer_tree_host()->root_layer()->AddChild(layer_);
@@ -1400,7 +1392,7 @@
void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
- layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ layer_ = FakePictureLayer::Create(&client_);
layer_->SetBounds(gfx::Size(4, 4));
client_.set_bounds(layer_->bounds());
layer_tree_host()->root_layer()->AddChild(layer_);
@@ -1476,7 +1468,7 @@
void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
- picture_ = FakePictureLayer::Create(layer_settings(), &client_);
+ picture_ = FakePictureLayer::Create(&client_);
picture_->SetBounds(gfx::Size(4, 4));
client_.set_bounds(picture_->bounds());
layer_tree_host()->root_layer()->AddChild(picture_);
@@ -1609,7 +1601,7 @@
public:
void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
- layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ layer_ = FakePictureLayer::Create(&client_);
layer_->SetBounds(gfx::Size(4, 4));
client_.set_bounds(layer_->bounds());
layer_tree_host()->root_layer()->AddChild(layer_);
diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
index 3e8cdef..34fc3139 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -617,7 +617,7 @@
: public LayerTreeHostContextTestLostContextSucceeds {
public:
void SetupTree() override {
- root_ = Layer::Create(layer_settings());
+ root_ = Layer::Create();
root_->SetBounds(gfx::Size(10, 10));
root_->SetIsDrawable(true);
@@ -626,7 +626,7 @@
paint.setColor(SkColorSetARGB(100, 80, 200, 200));
client_.add_draw_rect(gfx::Rect(5, 5), paint);
- layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ layer_ = FakePictureLayer::Create(&client_);
layer_->SetBounds(gfx::Size(10, 10));
layer_->SetIsDrawable(true);
@@ -706,7 +706,7 @@
client_.add_draw_rect(gfx::Rect(5, 5), paint);
scoped_refptr<FakePictureLayer> picture_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
picture_layer->SetBounds(gfx::Size(10, 20));
client_.set_bounds(picture_layer->bounds());
layer_tree_host()->SetRootLayer(picture_layer);
@@ -834,9 +834,9 @@
: LayerTreeHostContextTest(), num_commits_(0) {}
void SetupTree() override {
- root_ = FakePictureLayer::Create(layer_settings(), &client_);
- child_ = FakePictureLayer::Create(layer_settings(), &client_);
- grandchild_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_ = FakePictureLayer::Create(&client_);
+ child_ = FakePictureLayer::Create(&client_);
+ grandchild_ = FakePictureLayer::Create(&client_);
root_->AddChild(child_);
child_->AddChild(grandchild_);
@@ -954,18 +954,16 @@
gpu::SyncToken sync_token;
gl->GenSyncTokenCHROMIUM(fence_sync, sync_token.GetData());
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(10, 10));
root->SetIsDrawable(true);
- scoped_refptr<PictureLayer> layer =
- PictureLayer::Create(layer_settings(), &client_);
+ scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client_);
layer->SetBounds(gfx::Size(10, 10));
layer->SetIsDrawable(true);
root->AddChild(layer);
- scoped_refptr<TextureLayer> texture =
- TextureLayer::CreateForMailbox(layer_settings_, NULL);
+ scoped_refptr<TextureLayer> texture = TextureLayer::CreateForMailbox(NULL);
texture->SetBounds(gfx::Size(10, 10));
texture->SetIsDrawable(true);
texture->SetTextureMailbox(
@@ -975,32 +973,31 @@
EmptyReleaseCallback)));
root->AddChild(texture);
- scoped_refptr<PictureLayer> mask =
- PictureLayer::Create(layer_settings_, &client_);
+ scoped_refptr<PictureLayer> mask = PictureLayer::Create(&client_);
mask->SetBounds(gfx::Size(10, 10));
client_.set_bounds(mask->bounds());
scoped_refptr<PictureLayer> layer_with_mask =
- PictureLayer::Create(layer_settings_, &client_);
+ PictureLayer::Create(&client_);
layer_with_mask->SetBounds(gfx::Size(10, 10));
layer_with_mask->SetIsDrawable(true);
layer_with_mask->SetMaskLayer(mask.get());
root->AddChild(layer_with_mask);
- scoped_refptr<VideoLayer> video_color = VideoLayer::Create(
- layer_settings_, &color_frame_provider_, media::VIDEO_ROTATION_0);
+ scoped_refptr<VideoLayer> video_color =
+ VideoLayer::Create(&color_frame_provider_, media::VIDEO_ROTATION_0);
video_color->SetBounds(gfx::Size(10, 10));
video_color->SetIsDrawable(true);
root->AddChild(video_color);
- scoped_refptr<VideoLayer> video_hw = VideoLayer::Create(
- layer_settings_, &hw_frame_provider_, media::VIDEO_ROTATION_0);
+ scoped_refptr<VideoLayer> video_hw =
+ VideoLayer::Create(&hw_frame_provider_, media::VIDEO_ROTATION_0);
video_hw->SetBounds(gfx::Size(10, 10));
video_hw->SetIsDrawable(true);
root->AddChild(video_hw);
- scoped_refptr<VideoLayer> video_scaled_hw = VideoLayer::Create(
- layer_settings_, &scaled_hw_frame_provider_, media::VIDEO_ROTATION_0);
+ scoped_refptr<VideoLayer> video_scaled_hw =
+ VideoLayer::Create(&scaled_hw_frame_provider_, media::VIDEO_ROTATION_0);
video_scaled_hw->SetBounds(gfx::Size(10, 10));
video_scaled_hw->SetIsDrawable(true);
root->AddChild(video_scaled_hw);
@@ -1025,8 +1022,7 @@
hw_frame_provider_.set_frame(hw_video_frame_);
scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_);
- scoped_refptr<IOSurfaceLayer> io_surface =
- IOSurfaceLayer::Create(layer_settings_);
+ scoped_refptr<IOSurfaceLayer> io_surface = IOSurfaceLayer::Create();
io_surface->SetBounds(gfx::Size(10, 10));
io_surface->SetIsDrawable(true);
io_surface->SetIOSurfaceProperties(1, gfx::Size(10, 10));
@@ -1038,8 +1034,7 @@
layer_tree_host()->SetDebugState(debug_state);
scoped_refptr<PaintedScrollbarLayer> scrollbar =
- PaintedScrollbarLayer::Create(layer_settings_,
- scoped_ptr<Scrollbar>(new FakeScrollbar),
+ PaintedScrollbarLayer::Create(scoped_ptr<Scrollbar>(new FakeScrollbar),
layer->id());
scrollbar->SetBounds(gfx::Size(10, 10));
scrollbar->SetIsDrawable(true);
@@ -1113,8 +1108,6 @@
FakeVideoFrameProvider color_frame_provider_;
FakeVideoFrameProvider hw_frame_provider_;
FakeVideoFrameProvider scaled_hw_frame_provider_;
-
- LayerSettings layer_settings_;
};
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestDontUseLostResources);
@@ -1123,12 +1116,11 @@
: public LayerTreeHostContextTest {
public:
void SetupTree() override {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(10, 10));
root->SetIsDrawable(true);
- scoped_refptr<PictureLayer> picture =
- PictureLayer::Create(layer_settings(), &client_);
+ scoped_refptr<PictureLayer> picture = PictureLayer::Create(&client_);
picture->SetBounds(gfx::Size(10, 10));
client_.set_bounds(picture->bounds());
picture->SetIsDrawable(true);
@@ -1158,9 +1150,9 @@
ScrollbarLayerLostContext() : commits_(0) {}
void BeginTest() override {
- scoped_refptr<Layer> scroll_layer = Layer::Create(layer_settings());
- scrollbar_layer_ = FakePaintedScrollbarLayer::Create(
- layer_settings(), false, true, scroll_layer->id());
+ scoped_refptr<Layer> scroll_layer = Layer::Create();
+ scrollbar_layer_ =
+ FakePaintedScrollbarLayer::Create(false, true, scroll_layer->id());
scrollbar_layer_->SetBounds(gfx::Size(10, 100));
layer_tree_host()->root_layer()->AddChild(scrollbar_layer_);
layer_tree_host()->root_layer()->AddChild(scroll_layer);
diff --git a/cc/trees/layer_tree_host_unittest_copyrequest.cc b/cc/trees/layer_tree_host_unittest_copyrequest.cc
index 400488d7..186350e 100644
--- a/cc/trees/layer_tree_host_unittest_copyrequest.cc
+++ b/cc/trees/layer_tree_host_unittest_copyrequest.cc
@@ -25,14 +25,14 @@
: public LayerTreeHostCopyRequestTest {
protected:
void SetupTree() override {
- root = FakePictureLayer::Create(layer_settings(), &client_);
+ root = FakePictureLayer::Create(&client_);
root->SetBounds(gfx::Size(20, 20));
- child = FakePictureLayer::Create(layer_settings(), &client_);
+ child = FakePictureLayer::Create(&client_);
child->SetBounds(gfx::Size(10, 10));
root->AddChild(child);
- grand_child = FakePictureLayer::Create(layer_settings(), &client_);
+ grand_child = FakePictureLayer::Create(&client_);
grand_child->SetBounds(gfx::Size(5, 5));
child->AddChild(grand_child);
@@ -189,10 +189,10 @@
: public LayerTreeHostCopyRequestTest {
protected:
void SetupTree() override {
- root_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_ = FakePictureLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
- layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ layer_ = FakePictureLayer::Create(&client_);
layer_->SetBounds(gfx::Size(15, 15));
root_->AddChild(layer_);
@@ -241,14 +241,14 @@
: public LayerTreeHostCopyRequestTest {
protected:
void SetupTree() override {
- root_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_ = FakePictureLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
- main_destroyed_ = FakePictureLayer::Create(layer_settings(), &client_);
+ main_destroyed_ = FakePictureLayer::Create(&client_);
main_destroyed_->SetBounds(gfx::Size(15, 15));
root_->AddChild(main_destroyed_);
- impl_destroyed_ = FakePictureLayer::Create(layer_settings(), &client_);
+ impl_destroyed_ = FakePictureLayer::Create(&client_);
impl_destroyed_->SetBounds(gfx::Size(10, 10));
root_->AddChild(impl_destroyed_);
@@ -334,20 +334,20 @@
: public LayerTreeHostCopyRequestTest {
protected:
void SetupTree() override {
- root_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_ = FakePictureLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
- grand_parent_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ grand_parent_layer_ = FakePictureLayer::Create(&client_);
grand_parent_layer_->SetBounds(gfx::Size(15, 15));
root_->AddChild(grand_parent_layer_);
// parent_layer_ owns a render surface.
- parent_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ parent_layer_ = FakePictureLayer::Create(&client_);
parent_layer_->SetBounds(gfx::Size(15, 15));
parent_layer_->SetForceRenderSurface(true);
grand_parent_layer_->AddChild(parent_layer_);
- copy_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ copy_layer_ = FakePictureLayer::Create(&client_);
copy_layer_->SetBounds(gfx::Size(10, 10));
parent_layer_->AddChild(copy_layer_);
@@ -434,21 +434,21 @@
: public LayerTreeHostCopyRequestTest {
protected:
void SetupTree() override {
- root_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_ = FakePictureLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
- grand_parent_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ grand_parent_layer_ = FakePictureLayer::Create(&client_);
grand_parent_layer_->SetBounds(gfx::Size(15, 15));
grand_parent_layer_->SetHideLayerAndSubtree(true);
root_->AddChild(grand_parent_layer_);
// parent_layer_ owns a render surface.
- parent_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ parent_layer_ = FakePictureLayer::Create(&client_);
parent_layer_->SetBounds(gfx::Size(15, 15));
parent_layer_->SetForceRenderSurface(true);
grand_parent_layer_->AddChild(parent_layer_);
- copy_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ copy_layer_ = FakePictureLayer::Create(&client_);
copy_layer_->SetBounds(gfx::Size(10, 10));
parent_layer_->AddChild(copy_layer_);
@@ -519,15 +519,15 @@
: public LayerTreeHostCopyRequestTest {
protected:
void SetupTree() override {
- root_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_ = FakePictureLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
- parent_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ parent_layer_ = FakePictureLayer::Create(&client_);
parent_layer_->SetBounds(gfx::Size(15, 15));
parent_layer_->SetMasksToBounds(true);
root_->AddChild(parent_layer_);
- copy_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ copy_layer_ = FakePictureLayer::Create(&client_);
copy_layer_->SetPosition(gfx::PointF(15.f, 15.f));
copy_layer_->SetBounds(gfx::Size(10, 10));
parent_layer_->AddChild(copy_layer_);
@@ -568,18 +568,18 @@
: public LayerTreeHostCopyRequestTest {
protected:
void SetupTree() override {
- root_ = Layer::Create(layer_settings());
+ root_ = Layer::Create();
root_->SetBounds(gfx::Size(20, 20));
gfx::Transform scale;
scale.Scale(2, 2);
- copy_layer_ = Layer::Create(layer_settings());
+ copy_layer_ = Layer::Create();
copy_layer_->SetBounds(gfx::Size(10, 10));
copy_layer_->SetTransform(scale);
root_->AddChild(copy_layer_);
- child_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ child_layer_ = FakePictureLayer::Create(&client_);
child_layer_->SetBounds(gfx::Size(10, 10));
copy_layer_->AddChild(child_layer_);
@@ -621,10 +621,10 @@
: public LayerTreeHostCopyRequestTest {
protected:
void SetupTree() override {
- root_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_ = FakePictureLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
- copy_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ copy_layer_ = FakePictureLayer::Create(&client_);
copy_layer_->SetBounds(gfx::Size(10, 10));
root_->AddChild(copy_layer_);
@@ -717,10 +717,10 @@
}
void SetupTree() override {
- root_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_ = FakePictureLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
- copy_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ copy_layer_ = FakePictureLayer::Create(&client_);
copy_layer_->SetBounds(gfx::Size(10, 10));
root_->AddChild(copy_layer_);
@@ -847,10 +847,10 @@
void SetupTree() override {
client_.set_fill_with_nonsolid_color(true);
- root_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_ = FakePictureLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
- copy_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ copy_layer_ = FakePictureLayer::Create(&client_);
copy_layer_->SetBounds(gfx::Size(10, 10));
root_->AddChild(copy_layer_);
@@ -1006,10 +1006,10 @@
: public LayerTreeHostCopyRequestTest {
protected:
void SetupTree() override {
- root_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_ = FakePictureLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
- copy_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ copy_layer_ = FakePictureLayer::Create(&client_);
copy_layer_->SetBounds(gfx::Size(10, 10));
root_->AddChild(copy_layer_);
@@ -1084,10 +1084,10 @@
: public LayerTreeHostCopyRequestTest {
protected:
void SetupTree() override {
- root_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_ = FakePictureLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
- copy_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ copy_layer_ = FakePictureLayer::Create(&client_);
copy_layer_->SetBounds(gfx::Size(10, 10));
root_->AddChild(copy_layer_);
@@ -1156,11 +1156,10 @@
: public LayerTreeHostCopyRequestTest {
protected:
void SetupTree() override {
- scoped_refptr<FakePictureLayer> root =
- FakePictureLayer::Create(layer_settings(), &client_);
+ scoped_refptr<FakePictureLayer> root = FakePictureLayer::Create(&client_);
root->SetBounds(gfx::Size(20, 20));
- child_ = FakePictureLayer::Create(layer_settings(), &client_);
+ child_ = FakePictureLayer::Create(&client_);
child_->SetBounds(gfx::Size(10, 10));
root->AddChild(child_);
child_->SetHideLayerAndSubtree(true);
diff --git a/cc/trees/layer_tree_host_unittest_damage.cc b/cc/trees/layer_tree_host_unittest_damage.cc
index a1c4cdf..fdb3e17 100644
--- a/cc/trees/layer_tree_host_unittest_damage.cc
+++ b/cc/trees/layer_tree_host_unittest_damage.cc
@@ -27,8 +27,7 @@
: public LayerTreeHostDamageTest {
void SetupTree() override {
// Viewport is 10x10.
- scoped_refptr<FakePictureLayer> root =
- FakePictureLayer::Create(layer_settings(), &client_);
+ scoped_refptr<FakePictureLayer> root = FakePictureLayer::Create(&client_);
root->SetBounds(gfx::Size(10, 10));
layer_tree_host()->SetRootLayer(root);
@@ -90,8 +89,7 @@
: public LayerTreeHostDamageTest {
void SetupTree() override {
// Viewport is 10x10.
- scoped_refptr<FakePictureLayer> root =
- FakePictureLayer::Create(layer_settings(), &client_);
+ scoped_refptr<FakePictureLayer> root = FakePictureLayer::Create(&client_);
root->SetBounds(gfx::Size(10, 10));
layer_tree_host()->SetRootLayer(root);
@@ -158,12 +156,11 @@
}
void SetupTree() override {
- scoped_refptr<FakePictureLayer> root =
- FakePictureLayer::Create(layer_settings(), &client_);
+ scoped_refptr<FakePictureLayer> root = FakePictureLayer::Create(&client_);
root->SetBounds(gfx::Size(10, 10));
// Most of the layer isn't visible.
- content_ = FakePictureLayer::Create(layer_settings(), &client_);
+ content_ = FakePictureLayer::Create(&client_);
content_->SetBounds(gfx::Size(2000, 100));
root->AddChild(content_);
@@ -244,8 +241,8 @@
void BeginTest() override { PostSetNeedsCommitToMainThread(); }
void SetupTree() override {
- root_ = FakePictureLayer::Create(layer_settings(), &client_);
- child_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_ = FakePictureLayer::Create(&client_);
+ child_ = FakePictureLayer::Create(&client_);
root_->SetBounds(gfx::Size(500, 500));
child_->SetPosition(gfx::PointF(100.f, 100.f));
@@ -335,14 +332,13 @@
class LayerTreeHostScrollbarDamageTest : public LayerTreeHostDamageTest {
void SetupTree() override {
- scoped_refptr<Layer> root_layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root_layer = Layer::Create();
root_layer->SetBounds(gfx::Size(400, 400));
root_layer->SetMasksToBounds(true);
layer_tree_host()->SetRootLayer(root_layer);
- scoped_refptr<Layer> scroll_clip_layer = Layer::Create(layer_settings());
- scoped_refptr<Layer> content_layer =
- FakePictureLayer::Create(layer_settings(), &client_);
+ scoped_refptr<Layer> scroll_clip_layer = Layer::Create();
+ scoped_refptr<Layer> content_layer = FakePictureLayer::Create(&client_);
content_layer->SetScrollClipLayerId(scroll_clip_layer->id());
content_layer->SetScrollOffset(gfx::ScrollOffset(10, 20));
content_layer->SetBounds(gfx::Size(100, 200));
@@ -353,8 +349,8 @@
scroll_clip_layer->AddChild(content_layer);
root_layer->AddChild(scroll_clip_layer);
- scoped_refptr<Layer> scrollbar_layer = FakePaintedScrollbarLayer::Create(
- layer_settings(), false, true, content_layer->id());
+ scoped_refptr<Layer> scrollbar_layer =
+ FakePaintedScrollbarLayer::Create(false, true, content_layer->id());
scrollbar_layer->SetPosition(gfx::PointF(300.f, 300.f));
scrollbar_layer->SetBounds(gfx::Size(10, 100));
scrollbar_layer->ToScrollbarLayer()->SetScrollLayer(content_layer->id());
diff --git a/cc/trees/layer_tree_host_unittest_occlusion.cc b/cc/trees/layer_tree_host_unittest_occlusion.cc
index fb8ef47..679128a2 100644
--- a/cc/trees/layer_tree_host_unittest_occlusion.cc
+++ b/cc/trees/layer_tree_host_unittest_occlusion.cc
@@ -30,11 +30,11 @@
: public LayerTreeHostOcclusionTest {
public:
void SetupTree() override {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(100, 100));
root->SetIsDrawable(true);
- scoped_refptr<Layer> child = Layer::Create(layer_settings());
+ scoped_refptr<Layer> child = Layer::Create();
child->SetBounds(gfx::Size(50, 60));
child->SetPosition(gfx::PointF(10.f, 5.5f));
child->SetContentsOpaque(true);
@@ -76,18 +76,18 @@
: public LayerTreeHostOcclusionTest {
public:
void SetupTree() override {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(100, 100));
root->SetIsDrawable(true);
- scoped_refptr<Layer> child = Layer::Create(layer_settings());
+ scoped_refptr<Layer> child = Layer::Create();
child->SetBounds(gfx::Size(1, 1));
child->SetPosition(gfx::PointF(10.f, 5.5f));
child->SetIsDrawable(true);
child->SetForceRenderSurface(true);
root->AddChild(child);
- scoped_refptr<Layer> child2 = Layer::Create(layer_settings());
+ scoped_refptr<Layer> child2 = Layer::Create();
child2->SetBounds(gfx::Size(10, 12));
child2->SetPosition(gfx::PointF(13.f, 8.5f));
child2->SetContentsOpaque(true);
@@ -128,29 +128,28 @@
: public LayerTreeHostOcclusionTest {
public:
void SetupTree() override {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(100, 100));
root->SetIsDrawable(true);
- scoped_refptr<Layer> child = Layer::Create(layer_settings());
+ scoped_refptr<Layer> child = Layer::Create();
child->SetBounds(gfx::Size(30, 40));
child->SetPosition(gfx::PointF(10.f, 5.5f));
child->SetIsDrawable(true);
root->AddChild(child);
- scoped_refptr<Layer> make_surface_bigger = Layer::Create(layer_settings());
+ scoped_refptr<Layer> make_surface_bigger = Layer::Create();
make_surface_bigger->SetBounds(gfx::Size(100, 100));
make_surface_bigger->SetPosition(gfx::PointF(-10.f, -15.f));
make_surface_bigger->SetIsDrawable(true);
child->AddChild(make_surface_bigger);
- scoped_refptr<Layer> mask =
- PictureLayer::Create(layer_settings(), &client_);
+ scoped_refptr<Layer> mask = PictureLayer::Create(&client_);
mask->SetBounds(gfx::Size(30, 40));
mask->SetIsDrawable(true);
child->SetMaskLayer(mask.get());
- scoped_refptr<Layer> child2 = Layer::Create(layer_settings());
+ scoped_refptr<Layer> child2 = Layer::Create();
child2->SetBounds(gfx::Size(10, 12));
child2->SetPosition(gfx::PointF(13.f, 8.5f));
child2->SetContentsOpaque(true);
@@ -197,31 +196,30 @@
: public LayerTreeHostOcclusionTest {
public:
void SetupTree() override {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(100, 100));
root->SetIsDrawable(true);
gfx::Transform scale;
scale.Scale(2, 2);
- scoped_refptr<Layer> child = Layer::Create(layer_settings());
+ scoped_refptr<Layer> child = Layer::Create();
child->SetBounds(gfx::Size(30, 40));
child->SetTransform(scale);
root->AddChild(child);
- scoped_refptr<Layer> grand_child = Layer::Create(layer_settings());
+ scoped_refptr<Layer> grand_child = Layer::Create();
grand_child->SetBounds(gfx::Size(100, 100));
grand_child->SetPosition(gfx::PointF(-10.f, -15.f));
grand_child->SetIsDrawable(true);
child->AddChild(grand_child);
- scoped_refptr<Layer> mask =
- PictureLayer::Create(layer_settings(), &client_);
+ scoped_refptr<Layer> mask = PictureLayer::Create(&client_);
mask->SetBounds(gfx::Size(30, 40));
mask->SetIsDrawable(true);
child->SetMaskLayer(mask.get());
- scoped_refptr<Layer> child2 = Layer::Create(layer_settings());
+ scoped_refptr<Layer> child2 = Layer::Create();
child2->SetBounds(gfx::Size(10, 11));
child2->SetPosition(gfx::PointF(13.f, 15.f));
child2->SetContentsOpaque(true);
@@ -266,30 +264,29 @@
: public LayerTreeHostOcclusionTest {
public:
void SetupTree() override {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(100, 100));
root->SetIsDrawable(true);
- scoped_refptr<Layer> child = Layer::Create(layer_settings());
+ scoped_refptr<Layer> child = Layer::Create();
child->SetBounds(gfx::Size(1, 1));
child->SetPosition(gfx::PointF(10.f, 5.5f));
child->SetIsDrawable(true);
child->SetForceRenderSurface(true);
root->AddChild(child);
- scoped_refptr<Layer> replica = Layer::Create(layer_settings());
+ scoped_refptr<Layer> replica = Layer::Create();
gfx::Transform translate;
translate.Translate(20.f, 4.f);
replica->SetTransform(translate);
child->SetReplicaLayer(replica.get());
- scoped_refptr<Layer> mask =
- PictureLayer::Create(layer_settings(), &client_);
+ scoped_refptr<Layer> mask = PictureLayer::Create(&client_);
mask->SetBounds(gfx::Size(30, 40));
mask->SetIsDrawable(true);
child->SetMaskLayer(mask.get());
- scoped_refptr<Layer> child2 = Layer::Create(layer_settings());
+ scoped_refptr<Layer> child2 = Layer::Create();
child2->SetBounds(gfx::Size(10, 12));
child2->SetPosition(gfx::PointF(13.f, 8.5f));
child2->SetContentsOpaque(true);
diff --git a/cc/trees/layer_tree_host_unittest_picture.cc b/cc/trees/layer_tree_host_unittest_picture.cc
index f949650f..df4a3c9 100644
--- a/cc/trees/layer_tree_host_unittest_picture.cc
+++ b/cc/trees/layer_tree_host_unittest_picture.cc
@@ -17,10 +17,10 @@
class LayerTreeHostPictureTest : public LayerTreeTest {
protected:
void SetupTreeWithSinglePictureLayer(const gfx::Size& size) {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(size);
- root_picture_layer_ = FakePictureLayer::Create(layer_settings(), &client_);
+ root_picture_layer_ = FakePictureLayer::Create(&client_);
root_picture_layer_->SetBounds(size);
root->AddChild(root_picture_layer_);
@@ -58,7 +58,7 @@
// Add a new picture layer so the activate will have a pending layer
// without an active twin.
scoped_refptr<FakePictureLayer> picture =
- FakePictureLayer::Create(layer_settings(), &client_);
+ FakePictureLayer::Create(&client_);
layer_tree_host()->root_layer()->AddChild(picture);
break;
}
@@ -141,11 +141,11 @@
}
void SetupTree() override {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(768, 960));
client_.set_bounds(root->bounds());
client_.set_fill_with_nonsolid_color(true);
- picture_ = FakePictureLayer::Create(layer_settings(), &client_);
+ picture_ = FakePictureLayer::Create(&client_);
picture_->SetBounds(gfx::Size(768, 960));
root->AddChild(picture_);
@@ -204,12 +204,12 @@
frame_ = 0;
did_post_commit_ = false;
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(100, 100));
// The layer is big enough that the live tiles rect won't cover the full
// layer.
client_.set_fill_with_nonsolid_color(true);
- picture_ = FakePictureLayer::Create(layer_settings(), &client_);
+ picture_ = FakePictureLayer::Create(&client_);
picture_->SetBounds(gfx::Size(100, 100000));
root->AddChild(picture_);
@@ -308,16 +308,16 @@
class LayerTreeHostPictureTestRSLLMembership : public LayerTreeHostPictureTest {
void SetupTree() override {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(100, 100));
client_.set_bounds(root->bounds());
- child_ = Layer::Create(layer_settings());
+ child_ = Layer::Create();
root->AddChild(child_);
// Don't be solid color so the layer has tilings/tiles.
client_.set_fill_with_nonsolid_color(true);
- picture_ = FakePictureLayer::Create(layer_settings(), &client_);
+ picture_ = FakePictureLayer::Create(&client_);
picture_->SetBounds(gfx::Size(100, 100));
child_->AddChild(picture_);
@@ -398,12 +398,12 @@
class LayerTreeHostPictureTestRSLLMembershipWithScale
: public LayerTreeHostPictureTest {
void SetupTree() override {
- scoped_refptr<Layer> root_clip = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root_clip = Layer::Create();
root_clip->SetBounds(gfx::Size(100, 100));
- scoped_refptr<Layer> page_scale_layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> page_scale_layer = Layer::Create();
page_scale_layer->SetBounds(gfx::Size(100, 100));
- pinch_ = Layer::Create(layer_settings());
+ pinch_ = Layer::Create();
pinch_->SetBounds(gfx::Size(500, 500));
pinch_->SetScrollClipLayerId(root_clip->id());
pinch_->SetIsContainerForFixedPositionLayers(true);
@@ -412,7 +412,7 @@
// Don't be solid color so the layer has tilings/tiles.
client_.set_fill_with_nonsolid_color(true);
- picture_ = FakePictureLayer::Create(layer_settings(), &client_);
+ picture_ = FakePictureLayer::Create(&client_);
picture_->SetBounds(gfx::Size(100, 100));
pinch_->AddChild(picture_);
diff --git a/cc/trees/layer_tree_host_unittest_proxy.cc b/cc/trees/layer_tree_host_unittest_proxy.cc
index 586a31d..46a2d36 100644
--- a/cc/trees/layer_tree_host_unittest_proxy.cc
+++ b/cc/trees/layer_tree_host_unittest_proxy.cc
@@ -77,8 +77,7 @@
class ProxyMainThreaded : public ProxyTest {
protected:
ProxyMainThreaded()
- : update_check_layer_(
- FakePictureLayer::Create(layer_settings(), &client_)) {}
+ : update_check_layer_(FakePictureLayer::Create(&client_)) {}
~ProxyMainThreaded() override {}
void SetupTree() override {
diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc
index 8abb9ee..6648f15 100644
--- a/cc/trees/layer_tree_host_unittest_scroll.cc
+++ b/cc/trees/layer_tree_host_unittest_scroll.cc
@@ -70,12 +70,9 @@
gfx::Size scroll_layer_bounds(root_layer->bounds().width() + 100,
root_layer->bounds().height() + 100);
- CreateVirtualViewportLayers(root_layer,
- root_layer->bounds(),
- root_layer->bounds(),
- scroll_layer_bounds,
- layer_tree_host(),
- layer_settings());
+ CreateVirtualViewportLayers(root_layer, root_layer->bounds(),
+ root_layer->bounds(), scroll_layer_bounds,
+ layer_tree_host());
}
};
@@ -506,25 +503,19 @@
void SetupTree() override {
layer_tree_host()->SetDeviceScaleFactor(device_scale_factor_);
- scoped_refptr<Layer> root_layer = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root_layer = Layer::Create();
root_layer->SetBounds(gfx::Size(10, 10));
- root_scroll_layer_ =
- FakePictureLayer::Create(layer_settings(), &fake_content_layer_client_);
+ root_scroll_layer_ = FakePictureLayer::Create(&fake_content_layer_client_);
root_scroll_layer_->SetBounds(gfx::Size(110, 110));
root_scroll_layer_->SetPosition(gfx::PointF());
root_scroll_layer_->SetIsDrawable(true);
- CreateVirtualViewportLayers(root_layer.get(),
- root_scroll_layer_,
- root_layer->bounds(),
- root_layer->bounds(),
- layer_tree_host(),
- layer_settings());
+ CreateVirtualViewportLayers(root_layer.get(), root_scroll_layer_,
+ root_layer->bounds(), root_layer->bounds(),
+ layer_tree_host());
-
- child_layer_ =
- FakePictureLayer::Create(layer_settings(), &fake_content_layer_client_);
+ child_layer_ = FakePictureLayer::Create(&fake_content_layer_client_);
child_layer_->set_did_scroll_callback(
base::Bind(&LayerTreeHostScrollTestCaseWithChild::DidScroll,
base::Unretained(this)));
@@ -1335,12 +1326,9 @@
Layer* root_layer = layer_tree_host()->root_layer();
root_layer->SetBounds(gfx::Size(10, 10));
- CreateVirtualViewportLayers(root_layer,
- root_layer->bounds(),
- root_layer->bounds(),
- root_layer->bounds(),
- layer_tree_host(),
- layer_settings());
+ CreateVirtualViewportLayers(root_layer, root_layer->bounds(),
+ root_layer->bounds(), root_layer->bounds(),
+ layer_tree_host());
Layer* outer_scroll_layer =
layer_tree_host()->outer_viewport_scroll_layer();
@@ -1394,7 +1382,7 @@
Layer* CreateScrollLayer(Layer* parent, FakeLayerScrollClient* client) {
scoped_refptr<PictureLayer> scroll_layer =
- PictureLayer::Create(layer_settings(), &fake_content_layer_client_);
+ PictureLayer::Create(&fake_content_layer_client_);
scroll_layer->SetBounds(gfx::Size(110, 110));
scroll_layer->SetPosition(gfx::PointF());
scroll_layer->SetIsDrawable(true);
diff --git a/cc/trees/layer_tree_host_unittest_serialization.cc b/cc/trees/layer_tree_host_unittest_serialization.cc
index 66d1242..db166ed 100644
--- a/cc/trees/layer_tree_host_unittest_serialization.cc
+++ b/cc/trees/layer_tree_host_unittest_serialization.cc
@@ -6,7 +6,6 @@
#include "cc/layers/heads_up_display_layer.h"
#include "cc/layers/layer.h"
-#include "cc/layers/layer_settings.h"
#include "cc/proto/layer.pb.h"
#include "cc/proto/layer_tree_host.pb.h"
#include "cc/test/fake_layer_tree_host.h"
@@ -175,9 +174,9 @@
layer_tree_host_src_->meta_information_sequence_number_ *= 3;
// Just fake setup a layer for both source and dest.
- scoped_refptr<Layer> root_layer_src = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> root_layer_src = Layer::Create();
layer_tree_host_src_->SetRootLayer(root_layer_src);
- layer_tree_host_dst_->SetRootLayer(Layer::Create(LayerSettings()));
+ layer_tree_host_dst_->SetRootLayer(Layer::Create());
root_layer_src->SetDoubleSided(!root_layer_src->double_sided());
layer_tree_host_src_->debug_state_.show_replica_screen_space_rects =
@@ -211,21 +210,17 @@
layer_tree_host_src_->next_commit_forces_redraw_ =
!layer_tree_host_src_->next_commit_forces_redraw_;
- layer_tree_host_src_->hud_layer_ =
- HeadsUpDisplayLayer::Create(LayerSettings());
+ layer_tree_host_src_->hud_layer_ = HeadsUpDisplayLayer::Create();
root_layer_src->AddChild(layer_tree_host_src_->hud_layer_);
- layer_tree_host_src_->overscroll_elasticity_layer_ =
- Layer::Create(LayerSettings());
+ layer_tree_host_src_->overscroll_elasticity_layer_ = Layer::Create();
root_layer_src->AddChild(
layer_tree_host_src_->overscroll_elasticity_layer_);
- layer_tree_host_src_->page_scale_layer_ = Layer::Create(LayerSettings());
+ layer_tree_host_src_->page_scale_layer_ = Layer::Create();
root_layer_src->AddChild(layer_tree_host_src_->page_scale_layer_);
- layer_tree_host_src_->inner_viewport_scroll_layer_ =
- Layer::Create(LayerSettings());
+ layer_tree_host_src_->inner_viewport_scroll_layer_ = Layer::Create();
root_layer_src->AddChild(
layer_tree_host_src_->inner_viewport_scroll_layer_);
- layer_tree_host_src_->outer_viewport_scroll_layer_ =
- Layer::Create(LayerSettings());
+ layer_tree_host_src_->outer_viewport_scroll_layer_ = Layer::Create();
root_layer_src->AddChild(
layer_tree_host_src_->outer_viewport_scroll_layer_);
@@ -253,15 +248,14 @@
void RunLayersChangedTest() {
// Just fake setup a layer for both source and dest.
- scoped_refptr<Layer> root_layer_src = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> root_layer_src = Layer::Create();
layer_tree_host_src_->SetRootLayer(root_layer_src);
- layer_tree_host_dst_->SetRootLayer(Layer::Create(LayerSettings()));
+ layer_tree_host_dst_->SetRootLayer(Layer::Create());
root_layer_src->SetDoubleSided(!root_layer_src->double_sided());
// No HUD layer or |overscroll_elasticity_layer_|, or the inner/outer
// viewport scroll layers.
- layer_tree_host_src_->overscroll_elasticity_layer_ =
- Layer::Create(LayerSettings());
+ layer_tree_host_src_->overscroll_elasticity_layer_ = Layer::Create();
root_layer_src->AddChild(
layer_tree_host_src_->overscroll_elasticity_layer_);
@@ -270,28 +264,24 @@
void LayersChangedMultipleSerializations() {
// Just fake setup a layer for both source and dest.
- scoped_refptr<Layer> root_layer_src = Layer::Create(LayerSettings());
+ scoped_refptr<Layer> root_layer_src = Layer::Create();
layer_tree_host_src_->SetRootLayer(root_layer_src);
- layer_tree_host_dst_->SetRootLayer(Layer::Create(LayerSettings()));
+ layer_tree_host_dst_->SetRootLayer(Layer::Create());
root_layer_src->SetDoubleSided(!root_layer_src->double_sided());
// Ensure that all the layers work correctly for multiple rounds of
// serialization and deserialization.
- layer_tree_host_src_->hud_layer_ =
- HeadsUpDisplayLayer::Create(LayerSettings());
+ layer_tree_host_src_->hud_layer_ = HeadsUpDisplayLayer::Create();
root_layer_src->AddChild(layer_tree_host_src_->hud_layer_);
- layer_tree_host_src_->overscroll_elasticity_layer_ =
- Layer::Create(LayerSettings());
+ layer_tree_host_src_->overscroll_elasticity_layer_ = Layer::Create();
root_layer_src->AddChild(
layer_tree_host_src_->overscroll_elasticity_layer_);
- layer_tree_host_src_->page_scale_layer_ = Layer::Create(LayerSettings());
+ layer_tree_host_src_->page_scale_layer_ = Layer::Create();
root_layer_src->AddChild(layer_tree_host_src_->page_scale_layer_);
- layer_tree_host_src_->inner_viewport_scroll_layer_ =
- Layer::Create(LayerSettings());
+ layer_tree_host_src_->inner_viewport_scroll_layer_ = Layer::Create();
root_layer_src->AddChild(
layer_tree_host_src_->inner_viewport_scroll_layer_);
- layer_tree_host_src_->outer_viewport_scroll_layer_ =
- Layer::Create(LayerSettings());
+ layer_tree_host_src_->outer_viewport_scroll_layer_ = Layer::Create();
root_layer_src->AddChild(
layer_tree_host_src_->outer_viewport_scroll_layer_);
diff --git a/cc/trees/layer_tree_host_unittest_video.cc b/cc/trees/layer_tree_host_unittest_video.cc
index c1c3cb4d..46b8757 100644
--- a/cc/trees/layer_tree_host_unittest_video.cc
+++ b/cc/trees/layer_tree_host_unittest_video.cc
@@ -22,12 +22,12 @@
: public LayerTreeHostVideoTest {
public:
void SetupTree() override {
- scoped_refptr<Layer> root = Layer::Create(layer_settings());
+ scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(10, 10));
root->SetIsDrawable(true);
- scoped_refptr<VideoLayer> video = VideoLayer::Create(
- layer_settings(), &video_frame_provider_, media::VIDEO_ROTATION_90);
+ scoped_refptr<VideoLayer> video =
+ VideoLayer::Create(&video_frame_provider_, media::VIDEO_ROTATION_90);
video->SetPosition(gfx::PointF(3.f, 3.f));
video->SetBounds(gfx::Size(4, 5));
video->SetIsDrawable(true);
diff --git a/cc/trees/layer_tree_settings.cc b/cc/trees/layer_tree_settings.cc
index d9062e3..eb2a649d 100644
--- a/cc/trees/layer_tree_settings.cc
+++ b/cc/trees/layer_tree_settings.cc
@@ -99,7 +99,6 @@
scheduled_raster_task_limit(32),
use_occlusion_for_tile_prioritization(false),
image_decode_tasks_enabled(false),
- use_compositor_animation_timelines(true),
wait_for_beginframe_interval(true),
abort_commit_before_output_surface_creation(true),
use_mouse_wheel_gestures(false),
@@ -168,8 +167,6 @@
use_occlusion_for_tile_prioritization ==
other.use_occlusion_for_tile_prioritization &&
image_decode_tasks_enabled == other.image_decode_tasks_enabled &&
- use_compositor_animation_timelines ==
- other.use_compositor_animation_timelines &&
wait_for_beginframe_interval == other.wait_for_beginframe_interval &&
use_mouse_wheel_gestures == other.use_mouse_wheel_gestures &&
max_staging_buffer_usage_in_bytes ==
@@ -231,8 +228,6 @@
proto->set_use_occlusion_for_tile_prioritization(
use_occlusion_for_tile_prioritization);
proto->set_image_decode_tasks_enabled(image_decode_tasks_enabled);
- proto->set_use_compositor_animation_timelines(
- use_compositor_animation_timelines);
proto->set_wait_for_beginframe_interval(wait_for_beginframe_interval);
proto->set_use_mouse_wheel_gestures(use_mouse_wheel_gestures);
proto->set_max_staging_buffer_usage_in_bytes(
@@ -298,8 +293,6 @@
use_occlusion_for_tile_prioritization =
proto.use_occlusion_for_tile_prioritization();
image_decode_tasks_enabled = proto.image_decode_tasks_enabled();
- use_compositor_animation_timelines =
- proto.use_compositor_animation_timelines();
wait_for_beginframe_interval = proto.wait_for_beginframe_interval();
use_mouse_wheel_gestures = proto.use_mouse_wheel_gestures();
max_staging_buffer_usage_in_bytes = proto.max_staging_buffer_usage_in_bytes();
diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h
index bee3d8ef..3343c37 100644
--- a/cc/trees/layer_tree_settings.h
+++ b/cc/trees/layer_tree_settings.h
@@ -85,7 +85,6 @@
size_t scheduled_raster_task_limit;
bool use_occlusion_for_tile_prioritization;
bool image_decode_tasks_enabled;
- bool use_compositor_animation_timelines;
bool wait_for_beginframe_interval;
bool abort_commit_before_output_surface_creation;
bool use_mouse_wheel_gestures;
diff --git a/cc/trees/layer_tree_settings_unittest.cc b/cc/trees/layer_tree_settings_unittest.cc
index 1466b9f..2d48596 100644
--- a/cc/trees/layer_tree_settings_unittest.cc
+++ b/cc/trees/layer_tree_settings_unittest.cc
@@ -88,8 +88,6 @@
settings.scheduled_raster_task_limit * 3 + 1;
settings.use_occlusion_for_tile_prioritization =
!settings.use_occlusion_for_tile_prioritization;
- settings.use_compositor_animation_timelines =
- !settings.use_compositor_animation_timelines;
settings.wait_for_beginframe_interval =
!settings.wait_for_beginframe_interval;
settings.max_staging_buffer_usage_in_bytes =
@@ -148,7 +146,6 @@
settings.ignore_root_layer_flings = true;
settings.scheduled_raster_task_limit = 41;
settings.use_occlusion_for_tile_prioritization = true;
- settings.use_compositor_animation_timelines = true;
settings.wait_for_beginframe_interval = true;
settings.max_staging_buffer_usage_in_bytes = 70;
settings.memory_policy_ = ManagedMemoryPolicy(
diff --git a/cc/trees/tree_synchronizer_unittest.cc b/cc/trees/tree_synchronizer_unittest.cc
index 174dd80..5b2f95c 100644
--- a/cc/trees/tree_synchronizer_unittest.cc
+++ b/cc/trees/tree_synchronizer_unittest.cc
@@ -15,7 +15,6 @@
#include "cc/animation/layer_animation_controller.h"
#include "cc/layers/layer.h"
#include "cc/layers/layer_impl.h"
-#include "cc/layers/layer_settings.h"
#include "cc/test/animation_test_common.h"
#include "cc/test/fake_impl_task_runner_provider.h"
#include "cc/test/fake_layer_tree_host.h"
@@ -55,10 +54,8 @@
class MockLayer : public Layer {
public:
static scoped_refptr<MockLayer> Create(
- const LayerSettings& settings,
std::vector<int>* layer_impl_destruction_list) {
- return make_scoped_refptr(
- new MockLayer(settings, layer_impl_destruction_list));
+ return make_scoped_refptr(new MockLayer(layer_impl_destruction_list));
}
scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override {
@@ -73,10 +70,8 @@
}
private:
- explicit MockLayer(const LayerSettings& settings,
- std::vector<int>* layer_impl_destruction_list)
- : Layer(settings),
- layer_impl_destruction_list_(layer_impl_destruction_list) {}
+ explicit MockLayer(std::vector<int>* layer_impl_destruction_list)
+ : layer_impl_destruction_list_(layer_impl_destruction_list) {}
~MockLayer() override {}
std::vector<int>* layer_impl_destruction_list_;
@@ -170,30 +165,16 @@
}
}
-class LayerTreeSettingsForTreeSynchronizerTest : public LayerTreeSettings {
- public:
- LayerTreeSettingsForTreeSynchronizerTest() {
- use_compositor_animation_timelines = true;
- }
-};
-
class TreeSynchronizerTest : public testing::Test {
public:
TreeSynchronizerTest()
: client_(FakeLayerTreeHostClient::DIRECT_3D),
- host_(FakeLayerTreeHost::Create(
- &client_,
- &task_graph_runner_,
- LayerTreeSettingsForTreeSynchronizerTest())) {
- layer_settings_.use_compositor_animation_timelines =
- host_->settings().use_compositor_animation_timelines;
- }
+ host_(FakeLayerTreeHost::Create(&client_, &task_graph_runner_)) {}
protected:
FakeLayerTreeHostClient client_;
TestTaskGraphRunner task_graph_runner_;
scoped_ptr<FakeLayerTreeHost> host_;
- LayerSettings layer_settings_;
bool is_equal(ScrollTree::ScrollOffsetMap map,
ScrollTree::ScrollOffsetMap other) {
@@ -227,9 +208,9 @@
// Constructs a very simple tree and synchronizes it without trying to reuse any
// preexisting layers.
TEST_F(TreeSynchronizerTest, SyncSimpleTreeFromEmpty) {
- scoped_refptr<Layer> layer_tree_root = Layer::Create(layer_settings_);
- layer_tree_root->AddChild(Layer::Create(layer_settings_));
- layer_tree_root->AddChild(Layer::Create(layer_settings_));
+ scoped_refptr<Layer> layer_tree_root = Layer::Create();
+ layer_tree_root->AddChild(Layer::Create());
+ layer_tree_root->AddChild(Layer::Create());
host_->SetRootLayer(layer_tree_root);
@@ -248,11 +229,9 @@
std::vector<int> layer_impl_destruction_list;
scoped_refptr<Layer> layer_tree_root =
- MockLayer::Create(layer_settings_, &layer_impl_destruction_list);
- layer_tree_root->AddChild(
- MockLayer::Create(layer_settings_, &layer_impl_destruction_list));
- layer_tree_root->AddChild(
- MockLayer::Create(layer_settings_, &layer_impl_destruction_list));
+ MockLayer::Create(&layer_impl_destruction_list);
+ layer_tree_root->AddChild(MockLayer::Create(&layer_impl_destruction_list));
+ layer_tree_root->AddChild(MockLayer::Create(&layer_impl_destruction_list));
host_->SetRootLayer(layer_tree_root);
@@ -269,7 +248,7 @@
// Add a new layer to the Layer side
layer_tree_root->children()[0]->AddChild(
- MockLayer::Create(layer_settings_, &layer_impl_destruction_list));
+ MockLayer::Create(&layer_impl_destruction_list));
// Remove one.
layer_tree_root->children()[1]->RemoveFromParent();
int second_layer_impl_id = layer_impl_tree_root->children()[1]->id();
@@ -295,11 +274,9 @@
// Set up the tree and sync once. child2 needs to be synced here, too, even
// though we remove it to set up the intended scenario.
scoped_refptr<Layer> layer_tree_root =
- MockLayer::Create(layer_settings_, &layer_impl_destruction_list);
- scoped_refptr<Layer> child2 =
- MockLayer::Create(layer_settings_, &layer_impl_destruction_list);
- layer_tree_root->AddChild(
- MockLayer::Create(layer_settings_, &layer_impl_destruction_list));
+ MockLayer::Create(&layer_impl_destruction_list);
+ scoped_refptr<Layer> child2 = MockLayer::Create(&layer_impl_destruction_list);
+ layer_tree_root->AddChild(MockLayer::Create(&layer_impl_destruction_list));
layer_tree_root->AddChild(child2);
host_->SetRootLayer(layer_tree_root);
@@ -336,9 +313,9 @@
}
TEST_F(TreeSynchronizerTest, SyncSimpleTreeAndProperties) {
- scoped_refptr<Layer> layer_tree_root = Layer::Create(layer_settings_);
- layer_tree_root->AddChild(Layer::Create(layer_settings_));
- layer_tree_root->AddChild(Layer::Create(layer_settings_));
+ scoped_refptr<Layer> layer_tree_root = Layer::Create();
+ layer_tree_root->AddChild(Layer::Create());
+ layer_tree_root->AddChild(Layer::Create());
host_->SetRootLayer(layer_tree_root);
@@ -389,21 +366,17 @@
// |
// +--- D
scoped_refptr<Layer> layer_tree_root =
- MockLayer::Create(layer_settings_, &layer_impl_destruction_list);
- layer_tree_root->AddChild(
- MockLayer::Create(layer_settings_, &layer_impl_destruction_list));
+ MockLayer::Create(&layer_impl_destruction_list);
+ layer_tree_root->AddChild(MockLayer::Create(&layer_impl_destruction_list));
scoped_refptr<Layer> layer_a = layer_tree_root->children()[0].get();
- layer_a->AddChild(
- MockLayer::Create(layer_settings_, &layer_impl_destruction_list));
+ layer_a->AddChild(MockLayer::Create(&layer_impl_destruction_list));
scoped_refptr<Layer> layer_b = layer_a->children()[0].get();
- layer_b->AddChild(
- MockLayer::Create(layer_settings_, &layer_impl_destruction_list));
+ layer_b->AddChild(MockLayer::Create(&layer_impl_destruction_list));
scoped_refptr<Layer> layer_c = layer_b->children()[0].get();
- layer_b->AddChild(
- MockLayer::Create(layer_settings_, &layer_impl_destruction_list));
+ layer_b->AddChild(MockLayer::Create(&layer_impl_destruction_list));
scoped_refptr<Layer> layer_d = layer_b->children()[1].get();
host_->SetRootLayer(layer_tree_root);
@@ -451,11 +424,11 @@
std::vector<int> layer_impl_destruction_list;
scoped_refptr<Layer> old_layer_tree_root =
- MockLayer::Create(layer_settings_, &layer_impl_destruction_list);
+ MockLayer::Create(&layer_impl_destruction_list);
old_layer_tree_root->AddChild(
- MockLayer::Create(layer_settings_, &layer_impl_destruction_list));
+ MockLayer::Create(&layer_impl_destruction_list));
old_layer_tree_root->AddChild(
- MockLayer::Create(layer_settings_, &layer_impl_destruction_list));
+ MockLayer::Create(&layer_impl_destruction_list));
host_->SetRootLayer(old_layer_tree_root);
@@ -479,7 +452,7 @@
// Synchronize again. After the sync all LayerImpls from the old tree should
// be deleted.
- scoped_refptr<Layer> new_layer_tree_root = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> new_layer_tree_root = Layer::Create();
host_->SetRootLayer(new_layer_tree_root);
layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees(
new_layer_tree_root.get(), std::move(layer_impl_tree_root),
@@ -506,22 +479,22 @@
// Constructs+syncs a tree with mask, replica, and replica mask layers.
TEST_F(TreeSynchronizerTest, SyncMaskReplicaAndReplicaMaskLayers) {
- scoped_refptr<Layer> layer_tree_root = Layer::Create(layer_settings_);
- layer_tree_root->AddChild(Layer::Create(layer_settings_));
- layer_tree_root->AddChild(Layer::Create(layer_settings_));
- layer_tree_root->AddChild(Layer::Create(layer_settings_));
+ scoped_refptr<Layer> layer_tree_root = Layer::Create();
+ layer_tree_root->AddChild(Layer::Create());
+ layer_tree_root->AddChild(Layer::Create());
+ layer_tree_root->AddChild(Layer::Create());
// First child gets a mask layer.
- scoped_refptr<Layer> mask_layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> mask_layer = Layer::Create();
layer_tree_root->children()[0]->SetMaskLayer(mask_layer.get());
// Second child gets a replica layer.
- scoped_refptr<Layer> replica_layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> replica_layer = Layer::Create();
layer_tree_root->children()[1]->SetReplicaLayer(replica_layer.get());
// Third child gets a replica layer with a mask layer.
- scoped_refptr<Layer> replica_layer_with_mask = Layer::Create(layer_settings_);
- scoped_refptr<Layer> replica_mask_layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> replica_layer_with_mask = Layer::Create();
+ scoped_refptr<Layer> replica_mask_layer = Layer::Create();
replica_layer_with_mask->SetMaskLayer(replica_mask_layer.get());
layer_tree_root->children()[2]->
SetReplicaLayer(replica_layer_with_mask.get());
@@ -574,11 +547,11 @@
settings, nullptr, &task_runner_provider, &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_);
+ scoped_refptr<Layer> layer_tree_root = Layer::Create();
+ scoped_refptr<Layer> scroll_parent = Layer::Create();
layer_tree_root->AddChild(scroll_parent);
- layer_tree_root->AddChild(Layer::Create(layer_settings_));
- layer_tree_root->AddChild(Layer::Create(layer_settings_));
+ layer_tree_root->AddChild(Layer::Create());
+ layer_tree_root->AddChild(Layer::Create());
host_->SetRootLayer(layer_tree_root);
@@ -613,7 +586,7 @@
}
// Add an additional scroll layer.
- scoped_refptr<Layer> additional_scroll_child = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> additional_scroll_child = Layer::Create();
layer_tree_root->AddChild(additional_scroll_child);
additional_scroll_child->SetScrollParent(scroll_parent.get());
layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees(
@@ -639,11 +612,11 @@
settings, nullptr, &task_runner_provider, &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_);
- scoped_refptr<Layer> intervening = Layer::Create(layer_settings_);
- scoped_refptr<Layer> clip_child1 = Layer::Create(layer_settings_);
- scoped_refptr<Layer> clip_child2 = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> layer_tree_root = Layer::Create();
+ scoped_refptr<Layer> clip_parent = Layer::Create();
+ scoped_refptr<Layer> intervening = Layer::Create();
+ scoped_refptr<Layer> clip_child1 = Layer::Create();
+ scoped_refptr<Layer> clip_child2 = Layer::Create();
layer_tree_root->AddChild(clip_parent);
clip_parent->AddChild(intervening);
intervening->AddChild(clip_child1);
@@ -678,7 +651,7 @@
host_impl->active_tree());
// Add an additional clip child.
- scoped_refptr<Layer> additional_clip_child = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> additional_clip_child = Layer::Create();
intervening->AddChild(additional_clip_child);
additional_clip_child->SetClipParent(clip_parent.get());
layer_impl_tree_root = TreeSynchronizer::SynchronizeTrees(
@@ -718,12 +691,11 @@
FakeLayerTreeHostImpl* host_impl = host_->host_impl();
host_impl->CreatePendingTree();
- scoped_refptr<Layer> layer_tree_root = Layer::Create(layer_settings_);
- scoped_refptr<Layer> scroll_clip_layer = Layer::Create(layer_settings_);
- scoped_refptr<Layer> scroll_layer = Layer::Create(layer_settings_);
- scoped_refptr<Layer> transient_scroll_clip_layer =
- Layer::Create(layer_settings_);
- scoped_refptr<Layer> transient_scroll_layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> layer_tree_root = Layer::Create();
+ scoped_refptr<Layer> scroll_clip_layer = Layer::Create();
+ scoped_refptr<Layer> scroll_layer = Layer::Create();
+ scoped_refptr<Layer> transient_scroll_clip_layer = Layer::Create();
+ scoped_refptr<Layer> transient_scroll_layer = Layer::Create();
layer_tree_root->AddChild(transient_scroll_clip_layer);
transient_scroll_clip_layer->AddChild(transient_scroll_layer);
@@ -767,12 +739,11 @@
FakeLayerTreeHostImpl* host_impl = host_->host_impl();
host_impl->CreatePendingTree();
- scoped_refptr<Layer> layer_tree_root = Layer::Create(layer_settings_);
- scoped_refptr<Layer> scroll_clip_layer = Layer::Create(layer_settings_);
- scoped_refptr<Layer> scroll_layer = Layer::Create(layer_settings_);
- scoped_refptr<Layer> transient_scroll_clip_layer =
- Layer::Create(layer_settings_);
- scoped_refptr<Layer> transient_scroll_layer = Layer::Create(layer_settings_);
+ scoped_refptr<Layer> layer_tree_root = Layer::Create();
+ scoped_refptr<Layer> scroll_clip_layer = Layer::Create();
+ scoped_refptr<Layer> scroll_layer = Layer::Create();
+ scoped_refptr<Layer> transient_scroll_clip_layer = Layer::Create();
+ scoped_refptr<Layer> transient_scroll_layer = Layer::Create();
layer_tree_root->AddChild(transient_scroll_clip_layer);
transient_scroll_clip_layer->AddChild(transient_scroll_layer);