Commit 902c5bc6 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[BGPT] Don't collect element ids of scrollbar layer effect for animation

Collecting them (after crrev.com/c/1512765) caused element id collision
between element ids of the scrollbar layer and the effect nodes of the
scrollbars.

We should probably skip setting element ids of scrollbar layers in
the future, but the element ids are still required even in layer list
mode in LayerTreeHost::ApplyScrollAndScale().

Not collecting them won't break animation because scrollbar animation
is controlled by cc::ScrollbarAnimationController instead of the
classes under cc/animations.

Bug: 946397
Change-Id: I8a713588e1ee3073b82ef5d8a95b296ff77747ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1542460Reviewed-by: default avatarRobert Flack <flackr@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#645372}
parent e3c760c2
......@@ -35,6 +35,15 @@ namespace blink {
namespace {
// Returns true if the given element namespace is one of the ones needed for
// running animations on the compositor. These are the only element_ids the
// compositor needs to track existence of in the element id set.
bool IsAnimationNamespace(CompositorElementIdNamespace element_namespace) {
return element_namespace == CompositorElementIdNamespace::kPrimaryTransform ||
element_namespace == CompositorElementIdNamespace::kPrimaryEffect ||
element_namespace == CompositorElementIdNamespace::kEffectFilter;
}
// Inserts the element ids of the given node and all of its ancestors into the
// given |composited_element_ids| set. Filters out specifically element ids
// which are needed for animations. Returns once it finds an id which already
......@@ -46,7 +55,8 @@ void InsertAncestorElementIdsForAnimation(
CompositorElementIdSet& composited_element_ids) {
for (const auto* n = &node; n; n = SafeUnalias(n->Parent())) {
const CompositorElementId& element_id = n->GetCompositorElementId();
if (element_id && n->RequiresCompositingForAnimation()) {
if (element_id && n->RequiresCompositingForAnimation() &&
IsAnimationNamespace(NamespaceFromCompositorElementId(element_id))) {
if (composited_element_ids.count(element_id)) {
// Once we reach a node already counted we can stop traversing the
// parent chain.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment