Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: cc/layers/render_surface_impl_unittest.cc

Issue 2053193002: cc : Move LayerImpl::children to test properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 child->SetBounds(layer_size); 92 child->SetBounds(layer_size);
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()->BuildLayerListAndPropertyTreesForTesting(); 99 impl.host_impl()->active_tree()->BuildLayerListAndPropertyTreesForTesting();
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 = impl.host_impl()
103 impl.host_impl()->active_tree()->root_layer()->children()[0]; 103 ->active_tree()
104 ->root_layer()
105 ->test_properties()
106 ->children[0];
104 RenderSurfaceImpl* render_surface_impl = surface_raw->render_surface(); 107 RenderSurfaceImpl* render_surface_impl = surface_raw->render_surface();
105 std::unique_ptr<RenderPass> render_pass = RenderPass::Create(); 108 std::unique_ptr<RenderPass> render_pass = RenderPass::Create();
106 AppendQuadsData append_quads_data; 109 AppendQuadsData append_quads_data;
107 render_surface_impl->AppendQuads( 110 render_surface_impl->AppendQuads(
108 render_pass.get(), render_surface_impl->draw_transform(), Occlusion(), 111 render_pass.get(), render_surface_impl->draw_transform(), Occlusion(),
109 SK_ColorBLACK, 1.f, surface_raw->mask_layer(), &append_quads_data, 112 SK_ColorBLACK, 1.f, surface_raw->mask_layer(), &append_quads_data,
110 RenderPassId(1, 1)); 113 RenderPassId(1, 1));
111 114
112 const RenderPassDrawQuad* quad = 115 const RenderPassDrawQuad* quad =
113 RenderPassDrawQuad::MaterialCast(render_pass->quad_list.front()); 116 RenderPassDrawQuad::MaterialCast(render_pass->quad_list.front());
114 EXPECT_EQ(gfx::Vector2dF(0.0005f, 0.0005f), quad->mask_uv_scale); 117 EXPECT_EQ(gfx::Vector2dF(0.0005f, 0.0005f), quad->mask_uv_scale);
115 EXPECT_EQ(gfx::Vector2dF(2.f, 2.f), quad->filters_scale); 118 EXPECT_EQ(gfx::Vector2dF(2.f, 2.f), quad->filters_scale);
116 } 119 }
117 120
118 } // namespace 121 } // namespace
119 } // namespace cc 122 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698