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