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

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

Issue 2659883003: cc: Remove direct calls to LayerImpl::SetHasRenderSurface from tests (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/layers/render_surface_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 } 65 }
66 66
67 TEST(RenderSurfaceLayerImplTest, AppendQuadsWithScaledMask) { 67 TEST(RenderSurfaceLayerImplTest, AppendQuadsWithScaledMask) {
68 gfx::Size layer_size(1000, 1000); 68 gfx::Size layer_size(1000, 1000);
69 gfx::Size viewport_size(1000, 1000); 69 gfx::Size viewport_size(1000, 1000);
70 70
71 LayerTestCommon::LayerImplTest impl; 71 LayerTestCommon::LayerImplTest impl;
72 std::unique_ptr<LayerImpl> root = 72 std::unique_ptr<LayerImpl> root =
73 LayerImpl::Create(impl.host_impl()->active_tree(), 2); 73 LayerImpl::Create(impl.host_impl()->active_tree(), 2);
74 root->SetHasRenderSurface(true);
75 std::unique_ptr<LayerImpl> surface = 74 std::unique_ptr<LayerImpl> surface =
76 LayerImpl::Create(impl.host_impl()->active_tree(), 3); 75 LayerImpl::Create(impl.host_impl()->active_tree(), 3);
77 surface->SetBounds(layer_size); 76 surface->SetBounds(layer_size);
78 surface->SetHasRenderSurface(true); 77 surface->test_properties()->force_render_surface = true;
79 78
80 gfx::Transform scale; 79 gfx::Transform scale;
81 scale.Scale(2, 2); 80 scale.Scale(2, 2);
82 surface->test_properties()->transform = scale; 81 surface->test_properties()->transform = scale;
83 82
84 surface->test_properties()->SetMaskLayer( 83 surface->test_properties()->SetMaskLayer(
85 FakeMaskLayerImpl::Create(impl.host_impl()->active_tree(), 4)); 84 FakeMaskLayerImpl::Create(impl.host_impl()->active_tree(), 4));
86 surface->test_properties()->mask_layer->SetDrawsContent(true); 85 surface->test_properties()->mask_layer->SetDrawsContent(true);
87 surface->test_properties()->mask_layer->SetBounds(layer_size); 86 surface->test_properties()->mask_layer->SetBounds(layer_size);
88 87
(...skipping 21 matching lines...) Expand all
110 render_surface_impl->AppendQuads(render_pass.get(), &append_quads_data); 109 render_surface_impl->AppendQuads(render_pass.get(), &append_quads_data);
111 110
112 const RenderPassDrawQuad* quad = 111 const RenderPassDrawQuad* quad =
113 RenderPassDrawQuad::MaterialCast(render_pass->quad_list.front()); 112 RenderPassDrawQuad::MaterialCast(render_pass->quad_list.front());
114 EXPECT_EQ(gfx::Vector2dF(0.0005f, 0.0005f), quad->mask_uv_scale); 113 EXPECT_EQ(gfx::Vector2dF(0.0005f, 0.0005f), quad->mask_uv_scale);
115 EXPECT_EQ(gfx::Vector2dF(2.f, 2.f), quad->filters_scale); 114 EXPECT_EQ(gfx::Vector2dF(2.f, 2.f), quad->filters_scale);
116 } 115 }
117 116
118 } // namespace 117 } // namespace
119 } // namespace cc 118 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/layers/render_surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698