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

Side by Side Diff: cc/test/layer_tree_host_common_test.cc

Issue 2026033002: cc: Remove can_use_lcd_text from draw properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
« no previous file with comments | « cc/test/layer_tree_host_common_test.h ('k') | cc/trees/draw_property_utils.h » ('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/test/layer_tree_host_common_test.h" 5 #include "cc/test/layer_tree_host_common_test.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/layers/layer.h" 9 #include "cc/layers/layer.h"
10 #include "cc/layers/layer_impl.h" 10 #include "cc/layers/layer_impl.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 layer->test_properties()->should_flatten_transform = flatten_transform; 64 layer->test_properties()->should_flatten_transform = flatten_transform;
65 if (create_render_surface) { 65 if (create_render_surface) {
66 layer->test_properties()->force_render_surface = true; 66 layer->test_properties()->force_render_surface = true;
67 } 67 }
68 } 68 }
69 69
70 void LayerTreeHostCommonTestBase::ExecuteCalculateDrawProperties( 70 void LayerTreeHostCommonTestBase::ExecuteCalculateDrawProperties(
71 Layer* root_layer, 71 Layer* root_layer,
72 float device_scale_factor, 72 float device_scale_factor,
73 float page_scale_factor, 73 float page_scale_factor,
74 Layer* page_scale_layer, 74 Layer* page_scale_layer) {
75 bool can_use_lcd_text,
76 bool layers_always_allowed_lcd_text) {
77 PropertyTreeBuilder::PreCalculateMetaInformation(root_layer); 75 PropertyTreeBuilder::PreCalculateMetaInformation(root_layer);
78 76
79 EXPECT_TRUE(page_scale_layer || (page_scale_factor == 1.f)); 77 EXPECT_TRUE(page_scale_layer || (page_scale_factor == 1.f));
80 gfx::Transform identity_matrix; 78 gfx::Transform identity_matrix;
81 gfx::Size device_viewport_size = 79 gfx::Size device_viewport_size =
82 gfx::Size(root_layer->bounds().width() * device_scale_factor, 80 gfx::Size(root_layer->bounds().width() * device_scale_factor,
83 root_layer->bounds().height() * device_scale_factor); 81 root_layer->bounds().height() * device_scale_factor);
84 82
85 // We are probably not testing what is intended if the root_layer bounds are 83 // We are probably not testing what is intended if the root_layer bounds are
86 // empty. 84 // empty.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 gfx::Rect(device_viewport_size), identity_transform, 164 gfx::Rect(device_viewport_size), identity_transform,
167 can_render_to_separate_surface, 165 can_render_to_separate_surface,
168 root_layer->layer_tree_impl()->property_trees(), 166 root_layer->layer_tree_impl()->property_trees(),
169 update_layer_list_impl_.get()); 167 update_layer_list_impl_.get());
170 } 168 }
171 169
172 void LayerTreeHostCommonTestBase::ExecuteCalculateDrawProperties( 170 void LayerTreeHostCommonTestBase::ExecuteCalculateDrawProperties(
173 LayerImpl* root_layer, 171 LayerImpl* root_layer,
174 float device_scale_factor, 172 float device_scale_factor,
175 float page_scale_factor, 173 float page_scale_factor,
176 LayerImpl* page_scale_layer, 174 LayerImpl* page_scale_layer) {
177 bool can_use_lcd_text,
178 bool layers_always_allowed_lcd_text) {
179 root_layer->layer_tree_impl()->SetDeviceScaleFactor(device_scale_factor); 175 root_layer->layer_tree_impl()->SetDeviceScaleFactor(device_scale_factor);
180 176
181 EXPECT_TRUE(page_scale_layer || (page_scale_factor == 1.f)); 177 EXPECT_TRUE(page_scale_layer || (page_scale_factor == 1.f));
182 178
183 gfx::Transform identity_matrix; 179 gfx::Transform identity_matrix;
184 gfx::Size device_viewport_size = 180 gfx::Size device_viewport_size =
185 gfx::Size(root_layer->bounds().width() * device_scale_factor, 181 gfx::Size(root_layer->bounds().width() * device_scale_factor,
186 root_layer->bounds().height() * device_scale_factor); 182 root_layer->bounds().height() * device_scale_factor);
187 183
188 render_surface_layer_list_impl_.reset(new LayerImplList); 184 render_surface_layer_list_impl_.reset(new LayerImplList);
189 185
190 // We are probably not testing what is intended if the root_layer bounds are 186 // We are probably not testing what is intended if the root_layer bounds are
191 // empty. 187 // empty.
192 DCHECK(!root_layer->bounds().IsEmpty()); 188 DCHECK(!root_layer->bounds().IsEmpty());
193 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( 189 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
194 root_layer, device_viewport_size, render_surface_layer_list_impl_.get()); 190 root_layer, device_viewport_size, render_surface_layer_list_impl_.get());
195 inputs.device_scale_factor = device_scale_factor; 191 inputs.device_scale_factor = device_scale_factor;
196 inputs.page_scale_factor = page_scale_factor; 192 inputs.page_scale_factor = page_scale_factor;
197 inputs.page_scale_layer = page_scale_layer; 193 inputs.page_scale_layer = page_scale_layer;
198 inputs.can_use_lcd_text = can_use_lcd_text;
199 inputs.layers_always_allowed_lcd_text = layers_always_allowed_lcd_text;
200 inputs.can_adjust_raster_scales = true; 194 inputs.can_adjust_raster_scales = true;
201 195
202 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs); 196 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs);
203 } 197 }
204 198
205 void LayerTreeHostCommonTestBase:: 199 void LayerTreeHostCommonTestBase::
206 ExecuteCalculateDrawPropertiesWithoutSeparateSurfaces( 200 ExecuteCalculateDrawPropertiesWithoutSeparateSurfaces(
207 LayerImpl* root_layer) { 201 LayerImpl* root_layer) {
208 gfx::Transform identity_matrix; 202 gfx::Transform identity_matrix;
209 gfx::Size device_viewport_size = 203 gfx::Size device_viewport_size =
(...skipping 19 matching lines...) Expand all
229 223
230 LayerTreeHostCommonTest::LayerTreeHostCommonTest() 224 LayerTreeHostCommonTest::LayerTreeHostCommonTest()
231 : LayerTreeHostCommonTestBase(LayerTreeSettings()) {} 225 : LayerTreeHostCommonTestBase(LayerTreeSettings()) {}
232 226
233 LayerTreeHostCommonTest::LayerTreeHostCommonTest( 227 LayerTreeHostCommonTest::LayerTreeHostCommonTest(
234 const LayerTreeSettings& settings) 228 const LayerTreeSettings& settings)
235 : LayerTreeHostCommonTestBase(settings) { 229 : LayerTreeHostCommonTestBase(settings) {
236 } 230 }
237 231
238 } // namespace cc 232 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_tree_host_common_test.h ('k') | cc/trees/draw_property_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698