| 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 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 LayerTestCommon::LayerImplTest impl; | 23 LayerTestCommon::LayerImplTest impl; |
| 24 | 24 |
| 25 LayerImpl* owning_layer_impl = impl.AddChildToRoot<LayerImpl>(); | 25 LayerImpl* owning_layer_impl = impl.AddChildToRoot<LayerImpl>(); |
| 26 owning_layer_impl->SetBounds(layer_size); | 26 owning_layer_impl->SetBounds(layer_size); |
| 27 owning_layer_impl->SetDrawsContent(true); | 27 owning_layer_impl->SetDrawsContent(true); |
| 28 owning_layer_impl->test_properties()->force_render_surface = true; | 28 owning_layer_impl->test_properties()->force_render_surface = true; |
| 29 | 29 |
| 30 impl.CalcDrawProps(viewport_size); | 30 impl.CalcDrawProps(viewport_size); |
| 31 | 31 |
| 32 RenderSurfaceImpl* render_surface_impl = | 32 RenderSurfaceImpl* render_surface_impl = GetRenderSurface(owning_layer_impl); |
| 33 owning_layer_impl->GetRenderSurface(); | |
| 34 ASSERT_TRUE(render_surface_impl); | 33 ASSERT_TRUE(render_surface_impl); |
| 35 | 34 |
| 36 { | 35 { |
| 37 SCOPED_TRACE("No occlusion"); | 36 SCOPED_TRACE("No occlusion"); |
| 38 gfx::Rect occluded; | 37 gfx::Rect occluded; |
| 39 impl.AppendSurfaceQuadsWithOcclusion(render_surface_impl, occluded); | 38 impl.AppendSurfaceQuadsWithOcclusion(render_surface_impl, occluded); |
| 40 | 39 |
| 41 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), | 40 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), |
| 42 gfx::Rect(layer_size)); | 41 gfx::Rect(layer_size)); |
| 43 EXPECT_EQ(1u, impl.quad_list().size()); | 42 EXPECT_EQ(1u, impl.quad_list().size()); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 102 |
| 104 impl.host_impl()->SetViewportSize(viewport_size); | 103 impl.host_impl()->SetViewportSize(viewport_size); |
| 105 impl.host_impl()->active_tree()->BuildLayerListAndPropertyTreesForTesting(); | 104 impl.host_impl()->active_tree()->BuildLayerListAndPropertyTreesForTesting(); |
| 106 impl.host_impl()->active_tree()->UpdateDrawProperties(false); | 105 impl.host_impl()->active_tree()->UpdateDrawProperties(false); |
| 107 | 106 |
| 108 LayerImpl* surface_raw = impl.host_impl() | 107 LayerImpl* surface_raw = impl.host_impl() |
| 109 ->active_tree() | 108 ->active_tree() |
| 110 ->root_layer_for_testing() | 109 ->root_layer_for_testing() |
| 111 ->test_properties() | 110 ->test_properties() |
| 112 ->children[0]; | 111 ->children[0]; |
| 113 RenderSurfaceImpl* render_surface_impl = surface_raw->GetRenderSurface(); | 112 RenderSurfaceImpl* render_surface_impl = GetRenderSurface(surface_raw); |
| 114 std::unique_ptr<RenderPass> render_pass = RenderPass::Create(); | 113 std::unique_ptr<RenderPass> render_pass = RenderPass::Create(); |
| 115 AppendQuadsData append_quads_data; | 114 AppendQuadsData append_quads_data; |
| 116 render_surface_impl->AppendQuads(render_pass.get(), &append_quads_data); | 115 render_surface_impl->AppendQuads(render_pass.get(), &append_quads_data); |
| 117 | 116 |
| 118 DCHECK(render_pass->quad_list.front()); | 117 DCHECK(render_pass->quad_list.front()); |
| 119 const RenderPassDrawQuad* quad = | 118 const RenderPassDrawQuad* quad = |
| 120 RenderPassDrawQuad::MaterialCast(render_pass->quad_list.front()); | 119 RenderPassDrawQuad::MaterialCast(render_pass->quad_list.front()); |
| 121 EXPECT_EQ(gfx::RectF(0, 0, 1, 1), quad->mask_uv_rect); | 120 EXPECT_EQ(gfx::RectF(0, 0, 1, 1), quad->mask_uv_rect); |
| 122 EXPECT_EQ(gfx::Vector2dF(2.f, 2.f), quad->filters_scale); | 121 EXPECT_EQ(gfx::Vector2dF(2.f, 2.f), quad->filters_scale); |
| 123 } | 122 } |
| 124 | 123 |
| 125 } // namespace | 124 } // namespace |
| 126 } // namespace cc | 125 } // namespace cc |
| OLD | NEW |