Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
| index 73f96a4428f0e55551d71fce2edcff3d61d89874..e3fa5639aa24f37eb929a15a8fc84530de9755bc 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
| @@ -4,6 +4,7 @@ |
| #include "core/paint/PaintPropertyTreeBuilder.h" |
| +#include "core/dom/DOMNodeIds.h" |
| #include "core/frame/FrameView.h" |
| #include "core/frame/LocalFrame.h" |
| #include "core/frame/Settings.h" |
| @@ -375,12 +376,17 @@ void PaintPropertyTreeBuilder::updateTransform( |
| if (style.preserves3D() && !renderingContextID) |
| renderingContextID = PtrHash<const LayoutObject>::hash(&object); |
| + CompositorElementId compositorElementId; |
| + if (style.hasCurrentTransformAnimation()) { |
|
wkorman
2016/12/29 20:22:54
To call out, I made a judgement call here (and sam
Xianzhu
2016/12/29 20:40:38
Is there any extra cost for a paint property node
wkorman
2016/12/29 20:59:15
Yes, we use DOMNodeIds::idForNode() which uses a W
|
| + updateCompositorElementId(object, compositorElementId); |
| + } |
| + |
| auto& properties = |
| object.getMutableForPainting().ensurePaintProperties(); |
| context.forceSubtreeUpdate |= properties.updateTransform( |
| context.current.transform, matrix, transformOrigin(box), |
| context.current.shouldFlattenInheritedTransform, renderingContextID, |
| - compositingReasons); |
| + compositingReasons, compositorElementId); |
| hasTransform = true; |
| } |
| } |
| @@ -484,16 +490,23 @@ void PaintPropertyTreeBuilder::updateEffect( |
| } |
| CompositingReasons compositingReasons = |
| - CompositingReasonFinder::requiresCompositingForEffectAnimation( |
| - object.styleRef()); |
| + CompositingReasonFinder::requiresCompositingForEffectAnimation(style); |
| if (compositingReasons != CompositingReasonNone) |
| effectNodeNeeded = true; |
| + CompositorElementId compositorElementId; |
| + if (style.hasCurrentOpacityAnimation() || |
| + style.hasCurrentFilterAnimation() || |
| + style.hasCurrentBackdropFilterAnimation()) { |
| + updateCompositorElementId(object, compositorElementId); |
| + } |
| + |
| if (effectNodeNeeded) { |
| auto& properties = object.getMutableForPainting().ensurePaintProperties(); |
| context.forceSubtreeUpdate |= properties.updateEffect( |
| context.currentEffect, context.current.transform, outputClip, |
| - std::move(filter), opacity, blendMode, compositingReasons); |
| + std::move(filter), opacity, blendMode, compositingReasons, |
| + compositorElementId); |
| } else { |
| if (auto* properties = object.getMutableForPainting().paintProperties()) |
| context.forceSubtreeUpdate |= properties->clearEffect(); |
| @@ -835,6 +848,13 @@ void PaintPropertyTreeBuilder::updateOutOfFlowContext( |
| } |
| } |
| +void PaintPropertyTreeBuilder::updateCompositorElementId( |
| + const LayoutObject& object, |
| + CompositorElementId& compositorElementId) { |
| + compositorElementId = createCompositorElementId( |
| + DOMNodeIds::idForNode(object.node()), CompositorSubElementId::Primary); |
| +} |
| + |
| // Override ContainingBlockContext based on the properties of a containing block |
| // that was previously walked in a subtree other than the current subtree being |
| // walked. Used for out-of-flow positioned descendants of multi-column spanner |