| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 surface->AddChild(std::move(child)); | 94 surface->AddChild(std::move(child)); |
| 95 root->AddChild(std::move(surface)); | 95 root->AddChild(std::move(surface)); |
| 96 impl.host_impl()->active_tree()->SetRootLayer(std::move(root)); | 96 impl.host_impl()->active_tree()->SetRootLayer(std::move(root)); |
| 97 | 97 |
| 98 impl.host_impl()->SetViewportSize(viewport_size); | 98 impl.host_impl()->SetViewportSize(viewport_size); |
| 99 impl.host_impl()->active_tree()->BuildPropertyTreesForTesting(); | 99 impl.host_impl()->active_tree()->BuildPropertyTreesForTesting(); |
| 100 impl.host_impl()->active_tree()->UpdateDrawProperties(false); | 100 impl.host_impl()->active_tree()->UpdateDrawProperties(false); |
| 101 | 101 |
| 102 LayerImpl* surface_raw = | 102 LayerImpl* surface_raw = |
| 103 impl.host_impl()->active_tree()->root_layer()->children()[0].get(); | 103 impl.host_impl()->active_tree()->root_layer()->children()[0]; |
| 104 RenderSurfaceImpl* render_surface_impl = surface_raw->render_surface(); | 104 RenderSurfaceImpl* render_surface_impl = surface_raw->render_surface(); |
| 105 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); | 105 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); |
| 106 AppendQuadsData append_quads_data; | 106 AppendQuadsData append_quads_data; |
| 107 render_surface_impl->AppendQuads( | 107 render_surface_impl->AppendQuads( |
| 108 render_pass.get(), render_surface_impl->draw_transform(), Occlusion(), | 108 render_pass.get(), render_surface_impl->draw_transform(), Occlusion(), |
| 109 SK_ColorBLACK, 1.f, surface_raw->mask_layer(), &append_quads_data, | 109 SK_ColorBLACK, 1.f, surface_raw->mask_layer(), &append_quads_data, |
| 110 RenderPassId(1, 1)); | 110 RenderPassId(1, 1)); |
| 111 | 111 |
| 112 const RenderPassDrawQuad* quad = | 112 const RenderPassDrawQuad* quad = |
| 113 RenderPassDrawQuad::MaterialCast(render_pass->quad_list.front()); | 113 RenderPassDrawQuad::MaterialCast(render_pass->quad_list.front()); |
| 114 EXPECT_EQ(gfx::Vector2dF(0.0005f, 0.0005f), quad->mask_uv_scale); | 114 EXPECT_EQ(gfx::Vector2dF(0.0005f, 0.0005f), quad->mask_uv_scale); |
| 115 EXPECT_EQ(gfx::Vector2dF(2.f, 2.f), quad->filters_scale); | 115 EXPECT_EQ(gfx::Vector2dF(2.f, 2.f), quad->filters_scale); |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace | 118 } // namespace |
| 119 } // namespace cc | 119 } // namespace cc |
| OLD | NEW |