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

Side by Side Diff: cc/trees/property_tree_builder.cc

Issue 1848613002: Extract subpixel offsets from composited layer transforms when possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/trees/property_tree_builder.h" 5 #include "cc/trees/property_tree_builder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 layer == data_from_ancestor.overscroll_elasticity_layer; 232 layer == data_from_ancestor.overscroll_elasticity_layer;
233 const bool is_scrollable = layer->scrollable(); 233 const bool is_scrollable = layer->scrollable();
234 const bool is_fixed = layer->position_constraint().is_fixed_position(); 234 const bool is_fixed = layer->position_constraint().is_fixed_position();
235 235
236 const bool has_significant_transform = 236 const bool has_significant_transform =
237 !layer->transform().IsIdentityOr2DTranslation(); 237 !layer->transform().IsIdentityOr2DTranslation();
238 238
239 const bool has_potentially_animated_transform = 239 const bool has_potentially_animated_transform =
240 layer->HasPotentiallyRunningTransformAnimation(); 240 layer->HasPotentiallyRunningTransformAnimation();
241 241
242 LOG(ERROR) << "AddTransformNodeIfNeeded: " << layer;
243
244
242 // A transform node is needed even for a finished animation, since differences 245 // A transform node is needed even for a finished animation, since differences
243 // in the timing of animation state updates can mean that an animation that's 246 // in the timing of animation state updates can mean that an animation that's
244 // in the Finished state at tree-building time on the main thread is still in 247 // in the Finished state at tree-building time on the main thread is still in
245 // the Running state right after commit on the compositor thread. 248 // the Running state right after commit on the compositor thread.
246 const bool has_any_transform_animation = 249 const bool has_any_transform_animation =
247 layer->HasAnyAnimationTargetingProperty(TargetProperty::TRANSFORM); 250 layer->HasAnyAnimationTargetingProperty(TargetProperty::TRANSFORM);
248 251
249 const bool has_surface = created_render_surface; 252 const bool has_surface = created_render_surface;
250 253
251 // A transform node is needed to change the render target for subtree when 254 // A transform node is needed to change the render target for subtree when
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 layer->transform().To2dTranslation(); 318 layer->transform().To2dTranslation();
316 gfx::Vector2dF source_to_parent; 319 gfx::Vector2dF source_to_parent;
317 if (source_index != parent_index) { 320 if (source_index != parent_index) {
318 gfx::Transform to_parent; 321 gfx::Transform to_parent;
319 data_from_ancestor.transform_tree->ComputeTransform( 322 data_from_ancestor.transform_tree->ComputeTransform(
320 source_index, parent_index, &to_parent); 323 source_index, parent_index, &to_parent);
321 source_to_parent = to_parent.To2dTranslation(); 324 source_to_parent = to_parent.To2dTranslation();
322 } 325 }
323 layer->set_offset_to_transform_parent(source_offset + source_to_parent + 326 layer->set_offset_to_transform_parent(source_offset + source_to_parent +
324 local_offset); 327 local_offset);
328 LOG(ERROR) << "subpixel offset: " << layer->subpixel_offset_.ToString();
329 LOG(ERROR) << "set_offset_to_transform_parent: " << layer << ": " << layer-> offset_to_transform_parent().ToString() << ": " << layer->transform().To2dTransl ation().ToString();
325 layer->set_should_flatten_transform_from_property_tree( 330 layer->set_should_flatten_transform_from_property_tree(
326 data_from_ancestor.should_flatten); 331 data_from_ancestor.should_flatten);
327 layer->SetTransformTreeIndex(parent_index); 332 layer->SetTransformTreeIndex(parent_index);
328 if (layer->mask_layer()) 333 if (layer->mask_layer())
329 layer->mask_layer()->SetTransformTreeIndex(parent_index); 334 layer->mask_layer()->SetTransformTreeIndex(parent_index);
330 return false; 335 return false;
331 } 336 }
332 337
333 data_for_children->transform_tree->Insert(TransformNode(), parent_index); 338 data_for_children->transform_tree->Insert(TransformNode(), parent_index);
334 339
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 if (SkColorGetA(color) != 255) 1004 if (SkColorGetA(color) != 255)
1000 color = SkColorSetA(color, 255); 1005 color = SkColorSetA(color, 255);
1001 BuildPropertyTreesTopLevelInternal( 1006 BuildPropertyTreesTopLevelInternal(
1002 root_layer, page_scale_layer, inner_viewport_scroll_layer, 1007 root_layer, page_scale_layer, inner_viewport_scroll_layer,
1003 outer_viewport_scroll_layer, overscroll_elasticity_layer, 1008 outer_viewport_scroll_layer, overscroll_elasticity_layer,
1004 elastic_overscroll, page_scale_factor, device_scale_factor, viewport, 1009 elastic_overscroll, page_scale_factor, device_scale_factor, viewport,
1005 device_transform, property_trees, color); 1010 device_transform, property_trees, color);
1006 } 1011 }
1007 1012
1008 } // namespace cc 1013 } // namespace cc
OLDNEW
« no previous file with comments | « cc/playback/raster_source.cc ('k') | third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698