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

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

Issue 2840143002: [cc] Change semantics of fixed-pos container layer
Patch Set: add back inner viewport container layer as fixed-pos container Created 3 years, 7 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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 // Because Blink still provides positions with respect to the parent layer, 386 // Because Blink still provides positions with respect to the parent layer,
387 // we track both a parent TransformNode (which is the parent in the 387 // we track both a parent TransformNode (which is the parent in the
388 // TransformTree) and a 'source' TransformNode (which is the TransformNode 388 // TransformTree) and a 'source' TransformNode (which is the TransformNode
389 // for the parent in the Layer tree). 389 // for the parent in the Layer tree).
390 source_index = Parent(layer)->transform_tree_index(); 390 source_index = Parent(layer)->transform_tree_index();
391 source_offset = Parent(layer)->offset_to_transform_parent(); 391 source_offset = Parent(layer)->offset_to_transform_parent();
392 } 392 }
393 393
394 if (IsContainerForFixedPositionLayers(layer) || is_root) { 394 if (IsContainerForFixedPositionLayers(layer) || is_root) {
395 data_for_children->affected_by_inner_viewport_bounds_delta = 395 data_for_children->affected_by_inner_viewport_bounds_delta =
396 layer == data_from_ancestor.inner_viewport_scroll_layer; 396 layer->id() == (data_from_ancestor.inner_viewport_scroll_layer
397 ? data_from_ancestor.inner_viewport_scroll_layer
398 ->scroll_clip_layer_id()
399 : Layer::INVALID_ID);
397 data_for_children->affected_by_outer_viewport_bounds_delta = 400 data_for_children->affected_by_outer_viewport_bounds_delta =
398 layer == data_from_ancestor.outer_viewport_scroll_layer; 401 layer->id() == (data_from_ancestor.outer_viewport_scroll_layer
399 if (is_scrollable) { 402 ? data_from_ancestor.outer_viewport_scroll_layer
400 DCHECK(!is_root); 403 ->scroll_clip_layer_id()
401 DCHECK(Transform(layer).IsIdentity()); 404 : Layer::INVALID_ID);
402 data_for_children->transform_fixed_parent = Parent(layer); 405 data_for_children->transform_fixed_parent = layer;
403 } else {
404 data_for_children->transform_fixed_parent = layer;
405 }
406 } 406 }
407 data_for_children->transform_tree_parent = layer; 407 data_for_children->transform_tree_parent = layer;
408 408
409 if (!requires_node) { 409 if (!requires_node) {
410 data_for_children->should_flatten |= ShouldFlattenTransform(layer); 410 data_for_children->should_flatten |= ShouldFlattenTransform(layer);
411 gfx::Vector2dF local_offset = layer->position().OffsetFromOrigin() + 411 gfx::Vector2dF local_offset = layer->position().OffsetFromOrigin() +
412 Transform(layer).To2dTranslation(); 412 Transform(layer).To2dTranslation();
413 gfx::Vector2dF source_to_parent; 413 gfx::Vector2dF source_to_parent;
414 if (source_index != parent_index) { 414 if (source_index != parent_index) {
415 gfx::Transform to_parent; 415 gfx::Transform to_parent;
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
1381 root_layer, page_scale_layer, inner_viewport_scroll_layer, 1381 root_layer, page_scale_layer, inner_viewport_scroll_layer,
1382 outer_viewport_scroll_layer, overscroll_elasticity_layer, 1382 outer_viewport_scroll_layer, overscroll_elasticity_layer,
1383 elastic_overscroll, page_scale_factor, device_scale_factor, viewport, 1383 elastic_overscroll, page_scale_factor, device_scale_factor, viewport,
1384 device_transform, property_trees, color); 1384 device_transform, property_trees, color);
1385 property_trees->effect_tree.CreateOrReuseRenderSurfaces( 1385 property_trees->effect_tree.CreateOrReuseRenderSurfaces(
1386 &render_surfaces, root_layer->layer_tree_impl()); 1386 &render_surfaces, root_layer->layer_tree_impl());
1387 property_trees->ResetCachedData(); 1387 property_trees->ResetCachedData();
1388 } 1388 }
1389 1389
1390 } // namespace cc 1390 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698