| Index: cc/layer_tree_host_impl_unittest.cc
|
| diff --git a/cc/layer_tree_host_impl_unittest.cc b/cc/layer_tree_host_impl_unittest.cc
|
| index 08324260393eed876e30e0af2aa4515397cafb33..d439760e929e0a51805d9c482ea7ee3d8ba2826d 100644
|
| --- a/cc/layer_tree_host_impl_unittest.cc
|
| +++ b/cc/layer_tree_host_impl_unittest.cc
|
| @@ -3140,103 +3140,6 @@ public:
|
| using GLRenderer::releaseRenderPassTextures;
|
| };
|
|
|
| -TEST_P(LayerTreeHostImplTest, textureCachingWithClipping)
|
| -{
|
| - LayerTreeSettings settings;
|
| - settings.minimumOcclusionTrackingSize = gfx::Size();
|
| - settings.partialSwapEnabled = true;
|
| - scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
|
| -
|
| - LayerImpl* rootPtr;
|
| - LayerImpl* surfaceLayerPtr;
|
| -
|
| - scoped_ptr<OutputSurface> outputSurface = FakeOutputSurface::Create3d(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<OutputSurface>();
|
| -
|
| - gfx::Size rootSize(100, 100);
|
| -
|
| - myHostImpl->initializeRenderer(outputSurface.Pass());
|
| - myHostImpl->setViewportSize(gfx::Size(rootSize.width(), rootSize.height()), gfx::Size(rootSize.width(), rootSize.height()));
|
| -
|
| - scoped_ptr<LayerImpl> root = LayerImpl::create(myHostImpl->activeTree(), 1);
|
| - rootPtr = root.get();
|
| -
|
| - root->setAnchorPoint(gfx::PointF(0, 0));
|
| - root->setPosition(gfx::PointF(0, 0));
|
| - root->setBounds(rootSize);
|
| - root->setContentBounds(rootSize);
|
| - root->setDrawsContent(true);
|
| - root->setMasksToBounds(true);
|
| - myHostImpl->setRootLayer(root.Pass());
|
| -
|
| - addDrawingLayerTo(rootPtr, 3, gfx::Rect(0, 0, rootSize.width(), rootSize.height()), &surfaceLayerPtr);
|
| - surfaceLayerPtr->setDrawsContent(false);
|
| -
|
| - // Surface layer is the layer that changes its opacity
|
| - // It will contain other layers that draw content.
|
| - surfaceLayerPtr->setOpacity(0.5f);
|
| - surfaceLayerPtr->setForceRenderSurface(true); // This will cause it to have a surface
|
| -
|
| - addDrawingLayerTo(surfaceLayerPtr, 4, gfx::Rect(0, 0, 100, 3), 0);
|
| - addDrawingLayerTo(surfaceLayerPtr, 5, gfx::Rect(0, 97, 100, 3), 0);
|
| -
|
| - // Rotation will put part of the child ouside the bounds of the root layer.
|
| - // Nevertheless, the child layers should be drawn.
|
| - gfx::Transform transform = surfaceLayerPtr->transform();
|
| - transform.Translate(50, 50);
|
| - transform.Rotate(35);
|
| - transform.Translate(-50, -50);
|
| - surfaceLayerPtr->setTransform(transform);
|
| -
|
| - {
|
| - LayerTreeHostImpl::FrameData frame;
|
| - EXPECT_TRUE(myHostImpl->prepareToDraw(frame));
|
| -
|
| - // Must receive two render passes, each with one quad
|
| - ASSERT_EQ(2U, frame.renderPasses.size());
|
| - EXPECT_EQ(2U, frame.renderPasses[0]->quad_list.size());
|
| - ASSERT_EQ(1U, frame.renderPasses[1]->quad_list.size());
|
| -
|
| - // Verify that the child layers are being clipped.
|
| - gfx::Rect quadVisibleRect = frame.renderPasses[0]->quad_list[0]->visible_rect;
|
| - EXPECT_LT(quadVisibleRect.width(), 100);
|
| -
|
| - quadVisibleRect = frame.renderPasses[0]->quad_list[1]->visible_rect;
|
| - EXPECT_LT(quadVisibleRect.width(), 100);
|
| -
|
| - // Verify that the render surface texture is *not* clipped.
|
| - EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), frame.renderPasses[0]->output_rect);
|
| -
|
| - EXPECT_EQ(DrawQuad::RENDER_PASS, frame.renderPasses[1]->quad_list[0]->material);
|
| - const RenderPassDrawQuad* quad = RenderPassDrawQuad::MaterialCast(frame.renderPasses[1]->quad_list[0]);
|
| - EXPECT_FALSE(quad->contents_changed_since_last_frame.IsEmpty());
|
| -
|
| - myHostImpl->drawLayers(frame);
|
| - myHostImpl->didDrawAllLayers(frame);
|
| - }
|
| -
|
| - transform = surfaceLayerPtr->transform();
|
| - transform.Translate(50, 50);
|
| - transform.Rotate(-35);
|
| - transform.Translate(-50, -50);
|
| - surfaceLayerPtr->setTransform(transform);
|
| -
|
| - // The surface is now aligned again, and the clipped parts are exposed.
|
| - // Since the layers were clipped, even though the render surface size
|
| - // was not changed, the texture should not be saved.
|
| - {
|
| - LayerTreeHostImpl::FrameData frame;
|
| - EXPECT_TRUE(myHostImpl->prepareToDraw(frame));
|
| -
|
| - // Must receive two render passes, each with one quad
|
| - ASSERT_EQ(2U, frame.renderPasses.size());
|
| - EXPECT_EQ(2U, frame.renderPasses[0]->quad_list.size());
|
| - ASSERT_EQ(1U, frame.renderPasses[1]->quad_list.size());
|
| -
|
| - myHostImpl->drawLayers(frame);
|
| - myHostImpl->didDrawAllLayers(frame);
|
| - }
|
| -}
|
| -
|
| TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusion)
|
| {
|
| LayerTreeSettings settings;
|
|
|