| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/layers/render_surface_impl.h" | 5 #include "cc/layers/render_surface_impl.h" |
| 6 | 6 |
| 7 #include "cc/layers/append_quads_data.h" | 7 #include "cc/layers/append_quads_data.h" |
| 8 #include "cc/quads/render_pass_draw_quad.h" | 8 #include "cc/quads/render_pass_draw_quad.h" |
| 9 #include "cc/test/fake_mask_layer_impl.h" | 9 #include "cc/test/fake_mask_layer_impl.h" |
| 10 #include "cc/test/layer_test_common.h" | 10 #include "cc/test/layer_test_common.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 TEST(RenderSurfaceLayerImplTest, Occlusion) { | 16 TEST(RenderSurfaceLayerImplTest, Occlusion) { |
| 17 gfx::Size layer_size(1000, 1000); | 17 gfx::Size layer_size(1000, 1000); |
| 18 gfx::Size viewport_size(1000, 1000); | 18 gfx::Size viewport_size(1000, 1000); |
| 19 | 19 |
| 20 LayerTestCommon::LayerImplTest impl; | 20 LayerTestCommon::LayerImplTest impl; |
| 21 | 21 |
| 22 LayerImpl* owning_layer_impl = impl.AddChildToRoot<LayerImpl>(); | 22 LayerImpl* owning_layer_impl = impl.AddChildToRoot<LayerImpl>(); |
| 23 owning_layer_impl->SetBounds(layer_size); | 23 owning_layer_impl->SetBounds(layer_size); |
| 24 owning_layer_impl->SetDrawsContent(true); | 24 owning_layer_impl->SetDrawsContent(true); |
| 25 owning_layer_impl->SetHasRenderSurface(true); | 25 owning_layer_impl->SetForceRenderSurface(true); |
| 26 | 26 |
| 27 impl.CalcDrawProps(viewport_size); | 27 impl.CalcDrawProps(viewport_size); |
| 28 | 28 |
| 29 RenderSurfaceImpl* render_surface_impl = owning_layer_impl->render_surface(); | 29 RenderSurfaceImpl* render_surface_impl = owning_layer_impl->render_surface(); |
| 30 ASSERT_TRUE(render_surface_impl); | 30 ASSERT_TRUE(render_surface_impl); |
| 31 | 31 |
| 32 { | 32 { |
| 33 SCOPED_TRACE("No occlusion"); | 33 SCOPED_TRACE("No occlusion"); |
| 34 gfx::Rect occluded; | 34 gfx::Rect occluded; |
| 35 impl.AppendSurfaceQuadsWithOcclusion(render_surface_impl, occluded); | 35 impl.AppendSurfaceQuadsWithOcclusion(render_surface_impl, occluded); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 RenderPassId(1, 1)); | 108 RenderPassId(1, 1)); |
| 109 | 109 |
| 110 const RenderPassDrawQuad* quad = | 110 const RenderPassDrawQuad* quad = |
| 111 RenderPassDrawQuad::MaterialCast(render_pass->quad_list.front()); | 111 RenderPassDrawQuad::MaterialCast(render_pass->quad_list.front()); |
| 112 EXPECT_EQ(gfx::Vector2dF(1.f, 1.f), quad->mask_uv_scale); | 112 EXPECT_EQ(gfx::Vector2dF(1.f, 1.f), quad->mask_uv_scale); |
| 113 EXPECT_EQ(gfx::Vector2dF(2.f, 2.f), quad->filters_scale); | 113 EXPECT_EQ(gfx::Vector2dF(2.f, 2.f), quad->filters_scale); |
| 114 } | 114 } |
| 115 | 115 |
| 116 } // namespace | 116 } // namespace |
| 117 } // namespace cc | 117 } // namespace cc |
| OLD | NEW |