| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "cc/layers/append_quads_data.h" | 9 #include "cc/layers/append_quads_data.h" |
| 10 #include "cc/quads/render_pass_draw_quad.h" | 10 #include "cc/quads/render_pass_draw_quad.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect()); | 50 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect()); |
| 51 EXPECT_EQ(impl.quad_list().size(), 0u); | 51 EXPECT_EQ(impl.quad_list().size(), 0u); |
| 52 } | 52 } |
| 53 | 53 |
| 54 { | 54 { |
| 55 SCOPED_TRACE("Partial occlusion"); | 55 SCOPED_TRACE("Partial occlusion"); |
| 56 gfx::Rect occluded(200, 0, 800, 1000); | 56 gfx::Rect occluded(200, 0, 800, 1000); |
| 57 impl.AppendSurfaceQuadsWithOcclusion(render_surface_impl, occluded); | 57 impl.AppendSurfaceQuadsWithOcclusion(render_surface_impl, occluded); |
| 58 | 58 |
| 59 size_t partially_occluded_count = 0; | 59 size_t partially_occluded_count = 0; |
| 60 LayerTestCommon::VerifyQuadsAreOccluded( | 60 LayerTestCommon::VerifyQuadsAreOccluded(impl.quad_list(), occluded, false, |
| 61 impl.quad_list(), occluded, &partially_occluded_count); | 61 &partially_occluded_count); |
| 62 // The layer outputs one quad, which is partially occluded. | 62 // The layer outputs one quad, which is partially occluded. |
| 63 EXPECT_EQ(1u, impl.quad_list().size()); | 63 EXPECT_EQ(1u, impl.quad_list().size()); |
| 64 EXPECT_EQ(1u, partially_occluded_count); | 64 EXPECT_EQ(1u, partially_occluded_count); |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 | 67 |
| 68 TEST(RenderSurfaceLayerImplTest, AppendQuadsWithScaledMask) { | 68 TEST(RenderSurfaceLayerImplTest, AppendQuadsWithScaledMask) { |
| 69 gfx::Size layer_size(1000, 1000); | 69 gfx::Size layer_size(1000, 1000); |
| 70 gfx::Size viewport_size(1000, 1000); | 70 gfx::Size viewport_size(1000, 1000); |
| 71 float scale_factor = 2; | 71 float scale_factor = 2; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 120 |
| 121 DCHECK(render_pass->quad_list.front()); | 121 DCHECK(render_pass->quad_list.front()); |
| 122 const RenderPassDrawQuad* quad = | 122 const RenderPassDrawQuad* quad = |
| 123 RenderPassDrawQuad::MaterialCast(render_pass->quad_list.front()); | 123 RenderPassDrawQuad::MaterialCast(render_pass->quad_list.front()); |
| 124 EXPECT_EQ(gfx::RectF(0, 0, 1, 1), quad->mask_uv_rect); | 124 EXPECT_EQ(gfx::RectF(0, 0, 1, 1), quad->mask_uv_rect); |
| 125 EXPECT_EQ(gfx::Vector2dF(2.f, 2.f), quad->filters_scale); | 125 EXPECT_EQ(gfx::Vector2dF(2.f, 2.f), quad->filters_scale); |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace | 128 } // namespace |
| 129 } // namespace cc | 129 } // namespace cc |
| OLD | NEW |