| Index: cc/trees/layer_tree_host_unittest_scroll.cc
|
| diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc
|
| index 499f2d63108575fe2aa28cd89231f70ee8e1dcd3..e1eb884faa665cd2a6e40ce1fdd1eab6e9c6a127 100644
|
| --- a/cc/trees/layer_tree_host_unittest_scroll.cc
|
| +++ b/cc/trees/layer_tree_host_unittest_scroll.cc
|
| @@ -5,11 +5,13 @@
|
| #include "cc/trees/layer_tree_host.h"
|
|
|
| #include "base/memory/weak_ptr.h"
|
| -#include "cc/layers/content_layer.h"
|
| #include "cc/layers/layer.h"
|
| #include "cc/layers/layer_impl.h"
|
| +#include "cc/layers/picture_layer.h"
|
| #include "cc/test/fake_content_layer_client.h"
|
| #include "cc/test/fake_layer_tree_host_client.h"
|
| +#include "cc/test/fake_picture_layer.h"
|
| +#include "cc/test/fake_picture_layer_impl.h"
|
| #include "cc/test/geometry_test_utils.h"
|
| #include "cc/test/layer_tree_test.h"
|
| #include "cc/test/test_shared_bitmap_manager.h"
|
| @@ -449,7 +451,7 @@ class LayerTreeHostScrollTestCaseWithChild : public LayerTreeHostScrollTest {
|
| scoped_refptr<Layer> root_layer = Layer::Create();
|
| root_layer->SetBounds(gfx::Size(10, 10));
|
|
|
| - root_scroll_layer_ = ContentLayer::Create(&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::Point());
|
| @@ -459,7 +461,7 @@ class LayerTreeHostScrollTestCaseWithChild : public LayerTreeHostScrollTest {
|
| root_scroll_layer_->SetIsContainerForFixedPositionLayers(true);
|
| root_layer->AddChild(root_scroll_layer_);
|
|
|
| - child_layer_ = ContentLayer::Create(&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)));
|
| @@ -540,8 +542,10 @@ class LayerTreeHostScrollTestCaseWithChild : public LayerTreeHostScrollTest {
|
|
|
| virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
|
| LayerImpl* root_impl = impl->active_tree()->root_layer();
|
| - LayerImpl* root_scroll_layer_impl = root_impl->children()[0];
|
| - LayerImpl* child_layer_impl = root_scroll_layer_impl->children()[0];
|
| + FakePictureLayerImpl* root_scroll_layer_impl =
|
| + static_cast<FakePictureLayerImpl*>(root_impl->children()[0]);
|
| + FakePictureLayerImpl* child_layer_impl = static_cast<FakePictureLayerImpl*>(
|
| + root_scroll_layer_impl->children()[0]);
|
|
|
| LayerImpl* expected_scroll_layer_impl = NULL;
|
| LayerImpl* expected_no_scroll_layer_impl = NULL;
|
| @@ -558,14 +562,11 @@ class LayerTreeHostScrollTestCaseWithChild : public LayerTreeHostScrollTest {
|
| expected_no_scroll_layer_impl->ScrollDelta());
|
|
|
| // Ensure device scale factor is affecting the layers.
|
| - gfx::Size expected_content_bounds = gfx::ToCeiledSize(
|
| - gfx::ScaleSize(root_scroll_layer_impl->bounds(), device_scale_factor_));
|
| - EXPECT_SIZE_EQ(expected_content_bounds,
|
| - root_scroll_layer_->content_bounds());
|
| + EXPECT_FLOAT_EQ(device_scale_factor_,
|
| + root_scroll_layer_impl->HighResTiling()->contents_scale());
|
|
|
| - expected_content_bounds = gfx::ToCeiledSize(
|
| - gfx::ScaleSize(child_layer_impl->bounds(), device_scale_factor_));
|
| - EXPECT_SIZE_EQ(expected_content_bounds, child_layer_->content_bounds());
|
| + EXPECT_FLOAT_EQ(device_scale_factor_,
|
| + child_layer_impl->HighResTiling()->contents_scale());
|
|
|
| switch (impl->active_tree()->source_frame_number()) {
|
| case 0: {
|
| @@ -644,28 +645,14 @@ class LayerTreeHostScrollTestCaseWithChild : public LayerTreeHostScrollTest {
|
| };
|
|
|
| TEST_F(LayerTreeHostScrollTestCaseWithChild,
|
| - DeviceScaleFactor1_ScrollChild_DirectRenderer_MainThreadPaint) {
|
| - device_scale_factor_ = 1.f;
|
| - scroll_child_layer_ = true;
|
| - RunTest(true, false, false);
|
| -}
|
| -
|
| -TEST_F(LayerTreeHostScrollTestCaseWithChild,
|
| - DeviceScaleFactor1_ScrollChild_DirectRenderer_ImplSidePaint) {
|
| + DeviceScaleFactor1_ScrollChild_DirectRenderer) {
|
| device_scale_factor_ = 1.f;
|
| scroll_child_layer_ = true;
|
| RunTest(true, false, true);
|
| }
|
|
|
| TEST_F(LayerTreeHostScrollTestCaseWithChild,
|
| - DeviceScaleFactor1_ScrollChild_DelegatingRenderer_MainThreadPaint) {
|
| - device_scale_factor_ = 1.f;
|
| - scroll_child_layer_ = true;
|
| - RunTest(true, true, false);
|
| -}
|
| -
|
| -TEST_F(LayerTreeHostScrollTestCaseWithChild,
|
| - DeviceScaleFactor1_ScrollChild_DelegatingRenderer_ImplSidePaint) {
|
| + DeviceScaleFactor1_ScrollChild_DelegatingRenderer) {
|
| device_scale_factor_ = 1.f;
|
| scroll_child_layer_ = true;
|
| RunTest(true, true, true);
|
| @@ -728,14 +715,7 @@ TEST_F(LayerTreeHostScrollTestCaseWithChild,
|
| }
|
|
|
| TEST_F(LayerTreeHostScrollTestCaseWithChild,
|
| - DeviceScaleFactor2_ScrollRootScrollLayer_DirectRenderer_MainSidePaint) {
|
| - device_scale_factor_ = 2.f;
|
| - scroll_child_layer_ = false;
|
| - RunTest(true, false, false);
|
| -}
|
| -
|
| -TEST_F(LayerTreeHostScrollTestCaseWithChild,
|
| - DeviceScaleFactor2_ScrollRootScrollLayer_DirectRenderer_ImplSidePaint) {
|
| + DeviceScaleFactor2_ScrollRootScrollLayer_DirectRenderer) {
|
| device_scale_factor_ = 2.f;
|
| scroll_child_layer_ = false;
|
| RunTest(true, false, true);
|
| @@ -1204,8 +1184,8 @@ class LayerTreeHostScrollTestLayerStructureChange
|
| };
|
|
|
| Layer* CreateScrollLayer(Layer* parent, FakeLayerScrollClient* client) {
|
| - scoped_refptr<Layer> scroll_layer =
|
| - ContentLayer::Create(&fake_content_layer_client_);
|
| + scoped_refptr<PictureLayer> scroll_layer =
|
| + PictureLayer::Create(&fake_content_layer_client_);
|
| scroll_layer->SetBounds(gfx::Size(110, 110));
|
| scroll_layer->SetPosition(gfx::Point(0, 0));
|
| scroll_layer->SetIsDrawable(true);
|
| @@ -1230,12 +1210,12 @@ class LayerTreeHostScrollTestLayerStructureChange
|
| };
|
|
|
| TEST_F(LayerTreeHostScrollTestLayerStructureChange, ScrollDestroyLayer) {
|
| - RunTest(true, false, false);
|
| + RunTest(true, false, true);
|
| }
|
|
|
| TEST_F(LayerTreeHostScrollTestLayerStructureChange, ScrollDestroyWholeTree) {
|
| - scroll_destroy_whole_tree_ = true;
|
| - RunTest(true, false, false);
|
| + scroll_destroy_whole_tree_ = true;
|
| + RunTest(true, false, true);
|
| }
|
|
|
| } // namespace
|
|
|