| Index: cc/trees/layer_tree_host_impl_unittest.cc
|
| diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
|
| index fa301937b5564c47127e0aedcc3d2b793b24c7f0..22615b2c462d19f88546c31b3b205135866e9a55 100644
|
| --- a/cc/trees/layer_tree_host_impl_unittest.cc
|
| +++ b/cc/trees/layer_tree_host_impl_unittest.cc
|
| @@ -49,6 +49,7 @@
|
| #include "cc/test/fake_video_frame_provider.h"
|
| #include "cc/test/geometry_test_utils.h"
|
| #include "cc/test/layer_test_common.h"
|
| +#include "cc/test/layer_tree_test.h"
|
| #include "cc/test/render_pass_test_common.h"
|
| #include "cc/test/test_shared_bitmap_manager.h"
|
| #include "cc/test/test_web_graphics_context_3d.h"
|
| @@ -187,6 +188,7 @@ class LayerTreeHostImplTest : public testing::Test,
|
| root->SetContentBounds(gfx::Size(10, 10));
|
| root->SetDrawsContent(true);
|
| root->draw_properties().visible_content_rect = gfx::Rect(0, 0, 10, 10);
|
| + root->CreateRenderSurface();
|
| host_impl_->active_tree()->SetRootLayer(root.Pass());
|
| }
|
|
|
| @@ -233,6 +235,7 @@ class LayerTreeHostImplTest : public testing::Test,
|
| root->SetBounds(content_size);
|
| root->SetContentBounds(content_size);
|
| root->SetPosition(gfx::PointF());
|
| + root->CreateRenderSurface();
|
|
|
| scoped_ptr<LayerImpl> scroll =
|
| LayerImpl::Create(layer_tree_impl, kInnerViewportScrollLayerId);
|
| @@ -570,7 +573,7 @@ TEST_F(LayerTreeHostImplTest, ClearRootRenderSurfaceAndScroll) {
|
|
|
| // We should be able to scroll even if the root layer loses its render surface
|
| // after the most recent render.
|
| - host_impl_->active_tree()->root_layer()->ClearRenderSurface();
|
| + host_impl_->active_tree()->root_layer()->SetRenderSurfaceActive(false);
|
| host_impl_->active_tree()->set_needs_update_draw_properties();
|
|
|
| EXPECT_EQ(InputHandler::ScrollStarted,
|
| @@ -889,7 +892,7 @@ TEST_F(LayerTreeHostImplTest,
|
|
|
| // We should be able to hit test for touch event handlers even if the root
|
| // layer loses its render surface after the most recent render.
|
| - host_impl_->active_tree()->root_layer()->ClearRenderSurface();
|
| + host_impl_->active_tree()->root_layer()->SetRenderSurfaceActive(false);
|
| host_impl_->active_tree()->set_needs_update_draw_properties();
|
|
|
| EXPECT_EQ(host_impl_->HaveTouchEventHandlersAt(gfx::Point()), false);
|
| @@ -1328,6 +1331,7 @@ class LayerTreeHostImplOverridePhysicalTime : public LayerTreeHostImpl {
|
| \
|
| scroll->AddChild(contents.Pass()); \
|
| root->AddChild(scroll.Pass()); \
|
| + root->CreateRenderSurface(); \
|
| scrollbar->SetScrollLayerAndClipLayerByIds(2, 1); \
|
| root->AddChild(scrollbar.PassAs<LayerImpl>()); \
|
| \
|
| @@ -1465,6 +1469,7 @@ void LayerTreeHostImplTest::SetupMouseMoveAtWithDeviceScale(
|
| scoped_ptr<LayerImpl> root =
|
| LayerImpl::Create(host_impl_->active_tree(), 1);
|
| root->SetBounds(viewport_size);
|
| + root->CreateRenderSurface();
|
|
|
| scoped_ptr<LayerImpl> scroll =
|
| LayerImpl::Create(host_impl_->active_tree(), 2);
|
| @@ -1669,6 +1674,7 @@ TEST_F(LayerTreeHostImplTest, WillDrawReturningFalseDoesNotCall) {
|
| host_impl_->active_tree()->root_layer());
|
|
|
| root->AddChild(DidDrawCheckLayer::Create(host_impl_->active_tree(), 2));
|
| + root->CreateRenderSurface();
|
| DidDrawCheckLayer* layer =
|
| static_cast<DidDrawCheckLayer*>(root->children()[0]);
|
|
|
| @@ -1709,7 +1715,7 @@ TEST_F(LayerTreeHostImplTest, DidDrawNotCalledOnHiddenLayer) {
|
| DidDrawCheckLayer* root = static_cast<DidDrawCheckLayer*>(
|
| host_impl_->active_tree()->root_layer());
|
| root->SetMasksToBounds(true);
|
| -
|
| + root->CreateRenderSurface();
|
| root->AddChild(DidDrawCheckLayer::Create(host_impl_->active_tree(), 2));
|
| DidDrawCheckLayer* layer =
|
| static_cast<DidDrawCheckLayer*>(root->children()[0]);
|
| @@ -1762,6 +1768,7 @@ TEST_F(LayerTreeHostImplTest, WillDrawNotCalledOnOccludedLayer) {
|
| static_cast<DidDrawCheckLayer*>(root->children()[0]);
|
|
|
| root->AddChild(DidDrawCheckLayer::Create(host_impl_->active_tree(), 3));
|
| + root->CreateRenderSurface();
|
| DidDrawCheckLayer* top_layer =
|
| static_cast<DidDrawCheckLayer*>(root->children()[1]);
|
| // This layer covers the occluded_layer above. Make this layer large so it can
|
| @@ -1794,6 +1801,7 @@ TEST_F(LayerTreeHostImplTest, DidDrawCalledOnAllLayers) {
|
| static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
|
|
|
| root->AddChild(DidDrawCheckLayer::Create(host_impl_->active_tree(), 2));
|
| + root->CreateRenderSurface();
|
| DidDrawCheckLayer* layer1 =
|
| static_cast<DidDrawCheckLayer*>(root->children()[0]);
|
|
|
| @@ -1802,6 +1810,7 @@ TEST_F(LayerTreeHostImplTest, DidDrawCalledOnAllLayers) {
|
| static_cast<DidDrawCheckLayer*>(layer1->children()[0]);
|
|
|
| layer1->SetOpacity(0.3f);
|
| + layer1->CreateRenderSurface();
|
| layer1->SetShouldFlattenTransform(true);
|
|
|
| EXPECT_FALSE(root->did_draw_called());
|
| @@ -1873,7 +1882,7 @@ TEST_F(LayerTreeHostImplTest, PrepareToDrawSucceedsOnDefault) {
|
| DidDrawCheckLayer::Create(host_impl_->active_tree(), 1));
|
| DidDrawCheckLayer* root =
|
| static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
|
| -
|
| + root->CreateRenderSurface();
|
| bool tile_missing = false;
|
| bool had_incomplete_tile = false;
|
| bool is_animating = false;
|
| @@ -1897,6 +1906,7 @@ TEST_F(LayerTreeHostImplTest, PrepareToDrawSucceedsWithAnimatedLayer) {
|
| DidDrawCheckLayer::Create(host_impl_->active_tree(), 1));
|
| DidDrawCheckLayer* root =
|
| static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
|
| + root->CreateRenderSurface();
|
| bool tile_missing = false;
|
| bool had_incomplete_tile = false;
|
| bool is_animating = true;
|
| @@ -1920,6 +1930,7 @@ TEST_F(LayerTreeHostImplTest, PrepareToDrawSucceedsWithMissingTiles) {
|
| DidDrawCheckLayer::Create(host_impl_->active_tree(), 3));
|
| DidDrawCheckLayer* root =
|
| static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
|
| + root->CreateRenderSurface();
|
|
|
| bool tile_missing = true;
|
| bool had_incomplete_tile = false;
|
| @@ -1942,6 +1953,7 @@ TEST_F(LayerTreeHostImplTest, PrepareToDrawSucceedsWithIncompleteTile) {
|
| DidDrawCheckLayer::Create(host_impl_->active_tree(), 3));
|
| DidDrawCheckLayer* root =
|
| static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
|
| + root->CreateRenderSurface();
|
|
|
| bool tile_missing = false;
|
| bool had_incomplete_tile = true;
|
| @@ -1965,6 +1977,7 @@ TEST_F(LayerTreeHostImplTest,
|
| DidDrawCheckLayer::Create(host_impl_->active_tree(), 5));
|
| DidDrawCheckLayer* root =
|
| static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
|
| + root->CreateRenderSurface();
|
| bool tile_missing = true;
|
| bool had_incomplete_tile = false;
|
| bool is_animating = true;
|
| @@ -1988,6 +2001,7 @@ TEST_F(LayerTreeHostImplTest,
|
| DidDrawCheckLayer::Create(host_impl_->active_tree(), 5));
|
| DidDrawCheckLayer* root =
|
| static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
|
| + root->CreateRenderSurface();
|
| bool tile_missing = false;
|
| bool had_incomplete_tile = true;
|
| bool is_animating = true;
|
| @@ -2009,6 +2023,7 @@ TEST_F(LayerTreeHostImplTest, PrepareToDrawSucceedsWhenHighResRequired) {
|
| DidDrawCheckLayer::Create(host_impl_->active_tree(), 7));
|
| DidDrawCheckLayer* root =
|
| static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
|
| + root->CreateRenderSurface();
|
| bool tile_missing = false;
|
| bool had_incomplete_tile = false;
|
| bool is_animating = false;
|
| @@ -2032,6 +2047,7 @@ TEST_F(LayerTreeHostImplTest,
|
| DidDrawCheckLayer::Create(host_impl_->active_tree(), 7));
|
| DidDrawCheckLayer* root =
|
| static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
|
| + root->CreateRenderSurface();
|
| bool tile_missing = false;
|
| bool had_incomplete_tile = true;
|
| bool is_animating = false;
|
| @@ -2056,6 +2072,7 @@ TEST_F(LayerTreeHostImplTest,
|
| DidDrawCheckLayer::Create(host_impl_->active_tree(), 7));
|
| DidDrawCheckLayer* root =
|
| static_cast<DidDrawCheckLayer*>(host_impl_->active_tree()->root_layer());
|
| + root->CreateRenderSurface();
|
| bool tile_missing = true;
|
| bool had_incomplete_tile = false;
|
| bool is_animating = false;
|
| @@ -2077,6 +2094,7 @@ TEST_F(LayerTreeHostImplTest,
|
| TEST_F(LayerTreeHostImplTest, ScrollRootIgnored) {
|
| scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1);
|
| root->SetScrollClipLayer(Layer::INVALID_ID);
|
| + root->CreateRenderSurface();
|
| host_impl_->active_tree()->SetRootLayer(root.Pass());
|
| DrawFrame();
|
|
|
| @@ -2119,6 +2137,7 @@ class LayerTreeHostImplTopControlsTest : public LayerTreeHostImplTest {
|
| int inner_viewport_scroll_layer_id = root->id();
|
| int page_scale_layer_id = root_clip->id();
|
| root_clip->AddChild(root.Pass());
|
| + root_clip->CreateRenderSurface();
|
| host_impl_->active_tree()->SetRootLayer(root_clip.Pass());
|
| host_impl_->active_tree()->SetViewportLayersFromIds(
|
| page_scale_layer_id, inner_viewport_scroll_layer_id, Layer::INVALID_ID);
|
| @@ -2270,6 +2289,7 @@ TEST_F(LayerTreeHostImplTest, ScrollNonCompositedRoot) {
|
| scroll_layer->AddChild(content_layer.Pass());
|
| scroll_clip_layer->AddChild(scroll_layer.Pass());
|
|
|
| + scroll_clip_layer->CreateRenderSurface();
|
| host_impl_->active_tree()->SetRootLayer(scroll_clip_layer.Pass());
|
| host_impl_->SetViewportSize(surface_size);
|
| DrawFrame();
|
| @@ -2290,6 +2310,7 @@ TEST_F(LayerTreeHostImplTest, ScrollChildCallsCommitAndRedraw) {
|
| root->SetBounds(surface_size);
|
| root->SetContentBounds(contents_size);
|
| root->AddChild(CreateScrollableLayer(2, contents_size, root.get()));
|
| + root->CreateRenderSurface();
|
| host_impl_->active_tree()->SetRootLayer(root.Pass());
|
| host_impl_->SetViewportSize(surface_size);
|
| DrawFrame();
|
| @@ -2307,6 +2328,7 @@ TEST_F(LayerTreeHostImplTest, ScrollMissesChild) {
|
| gfx::Size surface_size(10, 10);
|
| scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1);
|
| root->AddChild(CreateScrollableLayer(2, surface_size, root.get()));
|
| + root->CreateRenderSurface();
|
| host_impl_->active_tree()->SetRootLayer(root.Pass());
|
| host_impl_->SetViewportSize(surface_size);
|
| DrawFrame();
|
| @@ -2323,6 +2345,7 @@ TEST_F(LayerTreeHostImplTest, ScrollMissesChild) {
|
| TEST_F(LayerTreeHostImplTest, ScrollMissesBackfacingChild) {
|
| gfx::Size surface_size(10, 10);
|
| scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1);
|
| + root->CreateRenderSurface();
|
| scoped_ptr<LayerImpl> child =
|
| CreateScrollableLayer(2, surface_size, root.get());
|
| host_impl_->SetViewportSize(surface_size);
|
| @@ -2360,6 +2383,7 @@ TEST_F(LayerTreeHostImplTest, ScrollBlockedByContentLayer) {
|
| CreateScrollableLayer(2, surface_size, clip_layer.get());
|
| scroll_layer->AddChild(content_layer.Pass());
|
| clip_layer->AddChild(scroll_layer.Pass());
|
| + clip_layer->CreateRenderSurface();
|
|
|
| host_impl_->active_tree()->SetRootLayer(clip_layer.Pass());
|
| host_impl_->SetViewportSize(surface_size);
|
| @@ -2385,6 +2409,7 @@ TEST_F(LayerTreeHostImplTest, ScrollRootAndChangePageScaleOnMainThread) {
|
| root_scrolling->SetIsContainerForFixedPositionLayers(true);
|
| root_clip->AddChild(root_scrolling.Pass());
|
| root->AddChild(root_clip.Pass());
|
| + root->CreateRenderSurface();
|
| host_impl_->active_tree()->SetRootLayer(root.Pass());
|
| // The behaviour in this test assumes the page scale is applied at a layer
|
| // above the clip layer.
|
| @@ -2435,6 +2460,7 @@ TEST_F(LayerTreeHostImplTest, ScrollRootAndChangePageScaleOnImplThread) {
|
| root_scrolling->SetIsContainerForFixedPositionLayers(true);
|
| root_clip->AddChild(root_scrolling.Pass());
|
| root->AddChild(root_clip.Pass());
|
| + root->CreateRenderSurface();
|
| host_impl_->active_tree()->SetRootLayer(root.Pass());
|
| // The behaviour in this test assumes the page scale is applied at a layer
|
| // above the clip layer.
|
| @@ -2539,6 +2565,7 @@ TEST_F(LayerTreeHostImplTest, ScrollChildAndChangePageScaleOnMainThread) {
|
| gfx::Size surface_size(30, 30);
|
| scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1);
|
| root->SetBounds(gfx::Size(5, 5));
|
| + root->CreateRenderSurface();
|
| scoped_ptr<LayerImpl> root_scrolling =
|
| LayerImpl::Create(host_impl_->active_tree(), 2);
|
| root_scrolling->SetBounds(surface_size);
|
| @@ -2594,7 +2621,7 @@ TEST_F(LayerTreeHostImplTest, ScrollChildBeyondLimit) {
|
| gfx::Size content_size(20, 20);
|
| scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1);
|
| root->SetBounds(surface_size);
|
| -
|
| + root->CreateRenderSurface();
|
| scoped_ptr<LayerImpl> grand_child =
|
| CreateScrollableLayer(3, content_size, root.get());
|
|
|
| @@ -2639,6 +2666,7 @@ TEST_F(LayerTreeHostImplTest, ScrollWithoutBubbling) {
|
| gfx::Size surface_size(20, 20);
|
| gfx::Size viewport_size(10, 10);
|
| scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1);
|
| + root->CreateRenderSurface();
|
| scoped_ptr<LayerImpl> root_scrolling =
|
| CreateScrollableLayer(2, surface_size, root.get());
|
| root_scrolling->SetIsContainerForFixedPositionLayers(true);
|
| @@ -2747,6 +2775,7 @@ TEST_F(LayerTreeHostImplTest, ScrollEventBubbling) {
|
| gfx::Size content_size(20, 20);
|
| scoped_ptr<LayerImpl> root_clip =
|
| LayerImpl::Create(host_impl_->active_tree(), 3);
|
| + root_clip->CreateRenderSurface();
|
| scoped_ptr<LayerImpl> root =
|
| CreateScrollableLayer(1, content_size, root_clip.get());
|
| // Make 'root' the clip layer for child: since they have the same sizes the
|
| @@ -2789,6 +2818,7 @@ TEST_F(LayerTreeHostImplTest, ScrollBeforeRedraw) {
|
| scoped_ptr<LayerImpl> root_scroll =
|
| CreateScrollableLayer(2, surface_size, root_clip.get());
|
| root_scroll->SetIsContainerForFixedPositionLayers(true);
|
| + root_clip->CreateRenderSurface();
|
| root_clip->AddChild(root_scroll.Pass());
|
| host_impl_->active_tree()->SetRootLayer(root_clip.Pass());
|
| host_impl_->active_tree()->SetViewportLayersFromIds(1, 2, Layer::INVALID_ID);
|
| @@ -2805,6 +2835,7 @@ TEST_F(LayerTreeHostImplTest, ScrollBeforeRedraw) {
|
| CreateScrollableLayer(4, surface_size, root_clip2.get());
|
| root_scroll2->SetIsContainerForFixedPositionLayers(true);
|
| root_clip2->AddChild(root_scroll2.Pass());
|
| + root_clip2->CreateRenderSurface();
|
| host_impl_->active_tree()->SetRootLayer(root_clip2.Pass());
|
| host_impl_->active_tree()->SetViewportLayersFromIds(3, 4, Layer::INVALID_ID);
|
| host_impl_->active_tree()->DidBecomeActive();
|
| @@ -3246,6 +3277,8 @@ TEST_F(LayerTreeHostImplTest, OverscrollChildWithoutBubbling) {
|
| gfx::Size surface_size(10, 10);
|
| scoped_ptr<LayerImpl> root_clip =
|
| LayerImpl::Create(host_impl_->active_tree(), 4);
|
| + root_clip->CreateRenderSurface();
|
| +
|
| scoped_ptr<LayerImpl> root =
|
| CreateScrollableLayer(1, surface_size, root_clip.get());
|
|
|
| @@ -3310,6 +3343,8 @@ TEST_F(LayerTreeHostImplTest, OverscrollChildEventBubbling) {
|
| gfx::Size content_size(20, 20);
|
| scoped_ptr<LayerImpl> root_clip =
|
| LayerImpl::Create(host_impl_->active_tree(), 3);
|
| + root_clip->CreateRenderSurface();
|
| +
|
| scoped_ptr<LayerImpl> root =
|
| CreateScrollableLayer(1, content_size, root_clip.get());
|
| root->SetIsContainerForFixedPositionLayers(true);
|
| @@ -3365,6 +3400,8 @@ TEST_F(LayerTreeHostImplTest, NoOverscrollOnFractionalDeviceScale) {
|
| float device_scale_factor = 1.5f;
|
| scoped_ptr<LayerImpl> root_clip =
|
| LayerImpl::Create(host_impl_->active_tree(), 3);
|
| + root_clip->CreateRenderSurface();
|
| +
|
| scoped_ptr<LayerImpl> root =
|
| CreateScrollableLayer(1, content_size, root_clip.get());
|
| root->SetIsContainerForFixedPositionLayers(true);
|
| @@ -3403,6 +3440,8 @@ TEST_F(LayerTreeHostImplTest, NoOverscrollWhenNotAtEdge) {
|
| gfx::Size content_size(200, 200);
|
| scoped_ptr<LayerImpl> root_clip =
|
| LayerImpl::Create(host_impl_->active_tree(), 3);
|
| + root_clip->CreateRenderSurface();
|
| +
|
| scoped_ptr<LayerImpl> root =
|
| CreateScrollableLayer(1, content_size, root_clip.get());
|
| root->SetIsContainerForFixedPositionLayers(true);
|
| @@ -3548,6 +3587,7 @@ TEST_F(LayerTreeHostImplTest, BlendingOffWhenDrawingOpaqueLayers) {
|
| root->SetBounds(gfx::Size(10, 10));
|
| root->SetContentBounds(root->bounds());
|
| root->SetDrawsContent(false);
|
| + root->CreateRenderSurface();
|
| host_impl_->active_tree()->SetRootLayer(root.Pass());
|
| }
|
| LayerImpl* root = host_impl_->active_tree()->root_layer();
|
| @@ -3657,6 +3697,7 @@ TEST_F(LayerTreeHostImplTest, BlendingOffWhenDrawingOpaqueLayers) {
|
| // carries the inherited opacity).
|
| layer1->SetContentsOpaque(true);
|
| layer1->SetOpacity(0.5f);
|
| + layer1->CreateRenderSurface();
|
| layer1->SetExpectation(false, true);
|
| layer1->SetUpdateRect(gfx::RectF(layer1->content_bounds()));
|
| layer2->SetExpectation(false, false);
|
| @@ -3668,6 +3709,7 @@ TEST_F(LayerTreeHostImplTest, BlendingOffWhenDrawingOpaqueLayers) {
|
| EXPECT_TRUE(layer1->quads_appended());
|
| EXPECT_TRUE(layer2->quads_appended());
|
| host_impl_->DidDrawAllLayers(frame);
|
| + layer1->ClearRenderSurface();
|
|
|
| // Draw again, but with child non-opaque, to make sure
|
| // layer1 not culled.
|
| @@ -3785,6 +3827,7 @@ class LayerTreeHostImplViewportCoveredTest : public LayerTreeHostImplTest {
|
| host_impl_->active_tree()->set_background_color(SK_ColorGRAY);
|
| host_impl_->active_tree()->SetRootLayer(
|
| LayerImpl::Create(host_impl_->active_tree(), 1));
|
| + host_impl_->active_tree()->root_layer()->CreateRenderSurface();
|
| host_impl_->active_tree()->root_layer()->AddChild(
|
| BlendStateCheckLayer::Create(host_impl_->active_tree(),
|
| 2,
|
| @@ -4076,6 +4119,7 @@ TEST_F(LayerTreeHostImplTest, ReshapeNotCalledUntilDraw) {
|
| root->SetBounds(gfx::Size(10, 10));
|
| root->SetContentBounds(gfx::Size(10, 10));
|
| root->SetDrawsContent(true);
|
| + root->CreateRenderSurface();
|
| host_impl_->active_tree()->SetRootLayer(root.Pass());
|
| EXPECT_FALSE(provider->TestContext3d()->reshape_called());
|
| provider->TestContext3d()->clear_reshape_called();
|
| @@ -4142,6 +4186,7 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) {
|
|
|
| scoped_ptr<LayerImpl> root =
|
| FakeDrawableLayerImpl::Create(layer_tree_host_impl->active_tree(), 1);
|
| + root->CreateRenderSurface();
|
| scoped_ptr<LayerImpl> child =
|
| FakeDrawableLayerImpl::Create(layer_tree_host_impl->active_tree(), 2);
|
| child->SetPosition(gfx::PointF(12.f, 13.f));
|
| @@ -4209,7 +4254,7 @@ TEST_F(LayerTreeHostImplTest, RootLayerDoesntCreateExtraSurface) {
|
| root->SetBounds(gfx::Size(10, 10));
|
| root->SetContentBounds(gfx::Size(10, 10));
|
| root->SetDrawsContent(true);
|
| - root->SetForceRenderSurface(true);
|
| + root->CreateRenderSurface();
|
| root->AddChild(child.Pass());
|
|
|
| host_impl_->active_tree()->SetRootLayer(root.Pass());
|
| @@ -4476,7 +4521,7 @@ static scoped_ptr<LayerTreeHostImpl> SetupLayersForOpacity(
|
| child->SetContentBounds(child->bounds());
|
| child->draw_properties().visible_content_rect = child_rect;
|
| child->SetDrawsContent(false);
|
| - child->SetForceRenderSurface(true);
|
| + child->CreateRenderSurface();
|
|
|
| grand_child->SetPosition(grand_child_rect.origin());
|
| grand_child->SetBounds(grand_child_rect.size());
|
| @@ -4556,6 +4601,7 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) {
|
| scoped_ptr<LayerImpl> root_layer =
|
| LayerImpl::Create(host_impl_->active_tree(), 1);
|
| root_layer->SetBounds(gfx::Size(10, 10));
|
| + root_layer->CreateRenderSurface();
|
|
|
| scoped_refptr<VideoFrame> softwareFrame =
|
| media::VideoFrame::CreateColorFrame(
|
| @@ -4732,6 +4778,7 @@ TEST_F(LayerTreeHostImplTestWithDelegatingRenderer, FrameIncludesDamageRect) {
|
| root->SetBounds(gfx::Size(10, 10));
|
| root->SetContentBounds(gfx::Size(10, 10));
|
| root->SetDrawsContent(true);
|
| + root->CreateRenderSurface();
|
|
|
| // Child layer is in the bottom right corner.
|
| scoped_ptr<SolidColorLayerImpl> child =
|
| @@ -4797,6 +4844,7 @@ TEST_F(LayerTreeHostImplTest, MaskLayerWithScaling) {
|
| scoped_ptr<LayerImpl> scoped_root =
|
| LayerImpl::Create(host_impl_->active_tree(), 1);
|
| LayerImpl* root = scoped_root.get();
|
| + root->CreateRenderSurface();
|
| host_impl_->active_tree()->SetRootLayer(scoped_root.Pass());
|
|
|
| scoped_ptr<LayerImpl> scoped_scaling_layer =
|
| @@ -4813,6 +4861,7 @@ TEST_F(LayerTreeHostImplTest, MaskLayerWithScaling) {
|
| FakeMaskLayerImpl::Create(host_impl_->active_tree(), 4);
|
| FakeMaskLayerImpl* mask_layer = scoped_mask_layer.get();
|
| content_layer->SetMaskLayer(scoped_mask_layer.PassAs<LayerImpl>());
|
| + content_layer->CreateRenderSurface();
|
|
|
| gfx::Size root_size(100, 100);
|
| root->SetBounds(root_size);
|
| @@ -4928,6 +4977,8 @@ TEST_F(LayerTreeHostImplTest, MaskLayerWithDifferentBounds) {
|
| scoped_ptr<LayerImpl> scoped_root =
|
| LayerImpl::Create(host_impl_->active_tree(), 1);
|
| LayerImpl* root = scoped_root.get();
|
| + root->CreateRenderSurface();
|
| +
|
| host_impl_->active_tree()->SetRootLayer(scoped_root.Pass());
|
|
|
| scoped_ptr<LayerImpl> scoped_content_layer =
|
| @@ -4939,6 +4990,7 @@ TEST_F(LayerTreeHostImplTest, MaskLayerWithDifferentBounds) {
|
| FakeMaskLayerImpl::Create(host_impl_->active_tree(), 4);
|
| FakeMaskLayerImpl* mask_layer = scoped_mask_layer.get();
|
| content_layer->SetMaskLayer(scoped_mask_layer.PassAs<LayerImpl>());
|
| + content_layer->CreateRenderSurface();
|
|
|
| gfx::Size root_size(100, 100);
|
| root->SetBounds(root_size);
|
| @@ -5070,6 +5122,8 @@ TEST_F(LayerTreeHostImplTest, ReflectionMaskLayerWithDifferentBounds) {
|
| scoped_ptr<LayerImpl> scoped_root =
|
| LayerImpl::Create(host_impl_->active_tree(), 1);
|
| LayerImpl* root = scoped_root.get();
|
| + root->CreateRenderSurface();
|
| +
|
| host_impl_->active_tree()->SetRootLayer(scoped_root.Pass());
|
|
|
| scoped_ptr<LayerImpl> scoped_content_layer =
|
| @@ -5081,11 +5135,13 @@ TEST_F(LayerTreeHostImplTest, ReflectionMaskLayerWithDifferentBounds) {
|
| LayerImpl::Create(host_impl_->active_tree(), 2);
|
| LayerImpl* replica_layer = scoped_replica_layer.get();
|
| content_layer->SetReplicaLayer(scoped_replica_layer.Pass());
|
| + content_layer->CreateRenderSurface();
|
|
|
| scoped_ptr<FakeMaskLayerImpl> scoped_mask_layer =
|
| FakeMaskLayerImpl::Create(host_impl_->active_tree(), 4);
|
| FakeMaskLayerImpl* mask_layer = scoped_mask_layer.get();
|
| replica_layer->SetMaskLayer(scoped_mask_layer.PassAs<LayerImpl>());
|
| + replica_layer->CreateRenderSurface();
|
|
|
| gfx::Size root_size(100, 100);
|
| root->SetBounds(root_size);
|
| @@ -5217,6 +5273,7 @@ TEST_F(LayerTreeHostImplTest, ReflectionMaskLayerForSurfaceWithUnclippedChild) {
|
| scoped_ptr<LayerImpl> scoped_root =
|
| LayerImpl::Create(host_impl_->active_tree(), 1);
|
| LayerImpl* root = scoped_root.get();
|
| + root->CreateRenderSurface();
|
| host_impl_->active_tree()->SetRootLayer(scoped_root.Pass());
|
|
|
| scoped_ptr<LayerImpl> scoped_content_layer =
|
| @@ -5233,11 +5290,13 @@ TEST_F(LayerTreeHostImplTest, ReflectionMaskLayerForSurfaceWithUnclippedChild) {
|
| LayerImpl::Create(host_impl_->active_tree(), 4);
|
| LayerImpl* replica_layer = scoped_replica_layer.get();
|
| content_layer->SetReplicaLayer(scoped_replica_layer.Pass());
|
| + content_layer->CreateRenderSurface();
|
|
|
| scoped_ptr<FakeMaskLayerImpl> scoped_mask_layer =
|
| FakeMaskLayerImpl::Create(host_impl_->active_tree(), 5);
|
| FakeMaskLayerImpl* mask_layer = scoped_mask_layer.get();
|
| replica_layer->SetMaskLayer(scoped_mask_layer.PassAs<LayerImpl>());
|
| + replica_layer->CreateRenderSurface();
|
|
|
| gfx::Size root_size(100, 100);
|
| root->SetBounds(root_size);
|
| @@ -5335,6 +5394,8 @@ TEST_F(LayerTreeHostImplTest, MaskLayerForSurfaceWithClippedLayer) {
|
| scoped_ptr<LayerImpl> scoped_root =
|
| LayerImpl::Create(host_impl_->active_tree(), 1);
|
| LayerImpl* root = scoped_root.get();
|
| + root->CreateRenderSurface();
|
| +
|
| host_impl_->active_tree()->SetRootLayer(scoped_root.Pass());
|
|
|
| scoped_ptr<LayerImpl> scoped_clipping_layer =
|
| @@ -5356,7 +5417,7 @@ TEST_F(LayerTreeHostImplTest, MaskLayerForSurfaceWithClippedLayer) {
|
| FakeMaskLayerImpl::Create(host_impl_->active_tree(), 6);
|
| FakeMaskLayerImpl* mask_layer = scoped_mask_layer.get();
|
| content_layer->SetMaskLayer(scoped_mask_layer.PassAs<LayerImpl>());
|
| -
|
| + content_layer->CreateRenderSurface();
|
| gfx::Size root_size(100, 100);
|
| root->SetBounds(root_size);
|
| root->SetContentBounds(root_size);
|
| @@ -5439,6 +5500,7 @@ TEST_F(LayerTreeHostImplTest, FarAwayQuadsDontNeedAA) {
|
| scoped_ptr<LayerImpl> scoped_root =
|
| LayerImpl::Create(host_impl_->pending_tree(), 1);
|
| LayerImpl* root = scoped_root.get();
|
| + root->CreateRenderSurface();
|
|
|
| host_impl_->pending_tree()->SetRootLayer(scoped_root.Pass());
|
|
|
| @@ -5937,6 +5999,8 @@ TEST_F(LayerTreeHostImplTest, TouchFlingShouldNotBubble) {
|
| gfx::Size content_size(20, 20);
|
| scoped_ptr<LayerImpl> root_clip =
|
| LayerImpl::Create(host_impl_->active_tree(), 3);
|
| + root_clip->CreateRenderSurface();
|
| +
|
| scoped_ptr<LayerImpl> root =
|
| CreateScrollableLayer(1, content_size, root_clip.get());
|
| root->SetIsContainerForFixedPositionLayers(true);
|
| @@ -5980,6 +6044,7 @@ TEST_F(LayerTreeHostImplTest, TouchFlingShouldLockToFirstScrolledLayer) {
|
| // the scroll doesn't bubble up to the parent layer.
|
| gfx::Size surface_size(10, 10);
|
| scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->active_tree(), 1);
|
| + root->CreateRenderSurface();
|
| scoped_ptr<LayerImpl> root_scrolling =
|
| CreateScrollableLayer(2, surface_size, root.get());
|
|
|
| @@ -6050,6 +6115,7 @@ TEST_F(LayerTreeHostImplTest, WheelFlingShouldBubble) {
|
| gfx::Size content_size(20, 20);
|
| scoped_ptr<LayerImpl> root_clip =
|
| LayerImpl::Create(host_impl_->active_tree(), 3);
|
| + root_clip->CreateRenderSurface();
|
| scoped_ptr<LayerImpl> root_scroll =
|
| CreateScrollableLayer(1, content_size, root_clip.get());
|
| int root_scroll_id = root_scroll->id();
|
| @@ -6253,6 +6319,7 @@ TEST_F(LayerTreeHostImplTest, LatencyInfoPassedToCompositorFrameMetadata) {
|
| root->SetBounds(gfx::Size(10, 10));
|
| root->SetContentBounds(gfx::Size(10, 10));
|
| root->SetDrawsContent(true);
|
| + root->CreateRenderSurface();
|
|
|
| host_impl_->active_tree()->SetRootLayer(root.PassAs<LayerImpl>());
|
|
|
| @@ -6293,6 +6360,7 @@ TEST_F(LayerTreeHostImplTest, SelectionBoundsPassedToCompositorFrameMetadata) {
|
| root->SetBounds(gfx::Size(10, 10));
|
| root->SetContentBounds(gfx::Size(10, 10));
|
| root->SetDrawsContent(true);
|
| + root->CreateRenderSurface();
|
|
|
| host_impl_->active_tree()->SetRootLayer(root.PassAs<LayerImpl>());
|
|
|
| @@ -6717,6 +6785,7 @@ class LayerTreeHostImplVirtualViewportTest : public LayerTreeHostImplTest {
|
| page_scale->AddChild(inner_scroll.Pass());
|
| inner_clip->AddChild(page_scale.Pass());
|
|
|
| + inner_clip->CreateRenderSurface();
|
| layer_tree_impl->SetRootLayer(inner_clip.Pass());
|
| layer_tree_impl->SetViewportLayersFromIds(kPageScaleLayerId,
|
| kInnerViewportScrollLayerId, kOuterViewportScrollLayerId);
|
|
|