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

Issue 2554833002: [NOT FOR REVIEW] cc : New clip tree

Created:
4 years ago by jaydasika
Modified:
4 years ago
Reviewers:
CC:
cc-bugs_chromium.org, chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[NOT FOR REVIEW] cc : New clip tree CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Patch Set 1 #

Patch Set 2 : comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -0 lines) Patch
M cc/trees/property_tree_builder.cc View 1 1 chunk +75 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 4 (1 generated)
weiliangc
This look good! What are blocking from directly trying to land this? If there are ...
4 years ago (2016-12-08 16:58:30 UTC) #2
jaydasika
On 2016/12/08 16:58:30, weiliangc wrote: > This look good! > > What are blocking from ...
4 years ago (2016-12-08 17:20:34 UTC) #3
chromium-reviews
4 years ago (2016-12-08 17:21:24 UTC) #4
On Thu, Dec 8, 2016 at 9:20 AM <jaydasika@chromium.org> wrote:

> Reviewers:
> CL: https://codereview.chromium.org/2554833002/
>
> Message:
>
> On 2016/12/08 16:58:30, weiliangc wrote:
> > This look good!
> >
> > What are blocking from directly trying to land this?
> >
> > If there are still a list of tasks maybe set up a new crbug?
> >
> > Thanks!
>
> This clip tree won't work with the current clip caching. I am trying to
> write a
> CL that will compute clips from this clip tree using the dynamic clips
> computation and compare it with old clip tree + old cached clips. This
> will be
> part of that.
>
> Description:
> [NOT FOR REVIEW] cc : New clip tree
> CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel
>
> Affected files (+75, -0 lines):
> M cc/trees/property_tree_builder.cc
>
>
> Index: cc/trees/property_tree_builder.cc
> diff --git a/cc/trees/property_tree_builder.cc
> b/cc/trees/property_tree_builder.cc
> index
>
d99262f84e268156ac925bafd5a8b9ef5092d462..8d42ab09bce1e9e23234d2a23e12ebd0fac77439
> 100644
> --- a/cc/trees/property_tree_builder.cc
> +++ b/cc/trees/property_tree_builder.cc
> @@ -456,6 +456,81 @@ void AddClipNodeIfNeeded(const
> DataForRecursion<LayerType>& data_from_ancestor,
> }
>
> template <typename LayerType>
> +void AddClipNodeOnlyIfLayerClipsSubtree(
> + const DataForRecursion<LayerType>& data_from_ancestor,
> + LayerType* layer,
> + bool created_render_surface,
> + bool created_transform_node,
> + DataForRecursion<LayerType>* data_for_children) {
> + const bool inherits_clip = !ClipParent(layer);
> + const int parent_id = inherits_clip ? data_from_ancestor.clip_tree_parent
> + : ClipParent(layer)->clip_tree_index();
> + ClipNode* parent =
> + data_from_ancestor.property_trees->clip_tree.Node(parent_id);
> +
> + bool apply_ancestor_clip = false;
> + if (inherits_clip) {
> + apply_ancestor_clip = data_from_ancestor.apply_ancestor_clip;
> + } else {
> + const EffectNode* parent_effect_node =
> + data_from_ancestor.property_trees->effect_tree.Node(
> + ClipParent(layer)->effect_tree_parent());
> + if (parent_effect_node->clip_id == parent->id) {
> + if (parent_effect_node->surface_is_clipped) {
> + // In this case, there is no clipping layer between the clip parent and
> + // its target and the target has applied the clip.
> + apply_ancestor_clip = false;
> + } else {
> + // In this case, there is no clipping layer between the clip parent and
> + // its target and the target has not applied the clip. There are two
> + // cases when a target doesn't apply clip. First, there is no ancestor
> + // clip to apply, in this case apply_ancestor_clip should be false.
> + // Second, there is a clip to apply but there are unclipped descendants,
> + // so the target cannot apply the clip. In this case,
> + // apply_ancestor_clip should be true.
> + apply_ancestor_clip = parent_effect_node->has_unclipped_descendants;
> + }
> + } else {
> + // In this case, there is a clipping layer between the clip parent and
> + // its target.
> + apply_ancestor_clip = true;
> + }
> + }
> + if (created_render_surface)
> + SetSurfaceIsClipped(data_for_children, apply_ancestor_clip, layer);
> +
> + bool layer_clips_subtree = LayerClipsSubtree(layer);
> + if (layer_clips_subtree) {
> + data_for_children->apply_ancestor_clip = true;
> + }
> +
> + if (!layer_clips_subtree) {
> + data_for_children->clip_tree_parent = parent_id;
> + } else {
> + LayerType* transform_parent = data_for_children->transform_tree_parent;
> + if (PositionConstraint(layer).is_fixed_position() &&
> + !created_transform_node) {
> + transform_parent = data_for_children->transform_fixed_parent;
> + }
> + ClipNode node;
> + node.clip = gfx::RectF(gfx::PointF() +
> layer->offset_to_transform_parent(),
> + gfx::SizeF(layer->bounds()));
> + node.transform_id = transform_parent->transform_tree_index();
> + node.owner_id = layer->id();
> + if (layer_clips_subtree)
> + node.clip_type = ClipNode::ClipType::APPLIES_LOCAL_CLIP;
> + else
> + node.clip_type = ClipNode::ClipType::NONE;
> + data_for_children->clip_tree_parent =
> + data_for_children->property_trees->clip_tree.Insert(node, parent_id);
> + data_for_children->property_trees->clip_id_to_index_map[layer->id()] =
> + data_for_children->clip_tree_parent;
> + }
> +
> + layer->SetClipTreeIndex(data_for_children->clip_tree_parent);
> +}
> +
> +template <typename LayerType>
> static inline bool IsAtBoundaryOf3dRenderingContext(LayerType* layer) {
> return Parent(layer)
> ? Parent(layer)->sorting_context_id() !=
>
>
>

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698