| Index: cc/layers/render_surface_impl_unittest.cc
|
| diff --git a/cc/layers/io_surface_layer_impl_unittest.cc b/cc/layers/render_surface_impl_unittest.cc
|
| similarity index 62%
|
| copy from cc/layers/io_surface_layer_impl_unittest.cc
|
| copy to cc/layers/render_surface_impl_unittest.cc
|
| index 9a09bbd75fc4c3fbdb4cab5ae372b0e3de919108..20c2afbc84bc2e00b122ad142e365ade77602993 100644
|
| --- a/cc/layers/io_surface_layer_impl_unittest.cc
|
| +++ b/cc/layers/render_surface_impl_unittest.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "cc/layers/io_surface_layer_impl.h"
|
| +#include "cc/layers/render_surface_impl.h"
|
|
|
| #include "cc/test/layer_test_common.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| @@ -10,25 +10,28 @@
|
| namespace cc {
|
| namespace {
|
|
|
| -TEST(IOSurfaceLayerImplTest, Occlusion) {
|
| +TEST(RenderSurfaceLayerImplTest, Occlusion) {
|
| gfx::Size layer_size(1000, 1000);
|
| gfx::Size viewport_size(1000, 1000);
|
|
|
| LayerTestCommon::LayerImplTest impl;
|
|
|
| - IOSurfaceLayerImpl* io_surface_layer_impl =
|
| - impl.AddChildToRoot<IOSurfaceLayerImpl>();
|
| - io_surface_layer_impl->SetAnchorPoint(gfx::PointF());
|
| - io_surface_layer_impl->SetBounds(layer_size);
|
| - io_surface_layer_impl->SetContentBounds(layer_size);
|
| - io_surface_layer_impl->SetDrawsContent(true);
|
| + LayerImpl* owning_layer_impl = impl.AddChildToRoot<LayerImpl>();
|
| + owning_layer_impl->SetAnchorPoint(gfx::PointF());
|
| + owning_layer_impl->SetBounds(layer_size);
|
| + owning_layer_impl->SetContentBounds(layer_size);
|
| + owning_layer_impl->SetDrawsContent(true);
|
| + owning_layer_impl->SetForceRenderSurface(true);
|
|
|
| impl.CalcDrawProps(viewport_size);
|
|
|
| + RenderSurfaceImpl* render_surface_impl = owning_layer_impl->render_surface();
|
| + ASSERT_TRUE(render_surface_impl);
|
| +
|
| {
|
| SCOPED_TRACE("No occlusion");
|
| gfx::Rect occluded;
|
| - impl.AppendQuadsWithOcclusion(io_surface_layer_impl, occluded);
|
| + impl.AppendSurfaceQuadsWithOcclusion(render_surface_impl, occluded);
|
|
|
| LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(),
|
| gfx::Rect(layer_size));
|
| @@ -37,8 +40,8 @@ TEST(IOSurfaceLayerImplTest, Occlusion) {
|
|
|
| {
|
| SCOPED_TRACE("Full occlusion");
|
| - gfx::Rect occluded(io_surface_layer_impl->visible_content_rect());
|
| - impl.AppendQuadsWithOcclusion(io_surface_layer_impl, occluded);
|
| + gfx::Rect occluded(owning_layer_impl->visible_content_rect());
|
| + impl.AppendSurfaceQuadsWithOcclusion(render_surface_impl, occluded);
|
|
|
| LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect());
|
| EXPECT_EQ(impl.quad_list().size(), 0u);
|
| @@ -47,7 +50,7 @@ TEST(IOSurfaceLayerImplTest, Occlusion) {
|
| {
|
| SCOPED_TRACE("Partial occlusion");
|
| gfx::Rect occluded(200, 0, 800, 1000);
|
| - impl.AppendQuadsWithOcclusion(io_surface_layer_impl, occluded);
|
| + impl.AppendSurfaceQuadsWithOcclusion(render_surface_impl, occluded);
|
|
|
| size_t partially_occluded_count = 0;
|
| LayerTestCommon::VerifyQuadsCoverRectWithOcclusion(
|
|
|