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

Unified Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp

Issue 2608543002: Store compositor element id in paint properties for animated objects. (Closed)
Patch Set: Sync to head. Created 3 years, 12 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 side-by-side diff with in-line comments
Download patch
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 b01a6cdf72ebf83e8f3cd03c97ff373f5a15b88f..2de00f63a0dfb08e25f844fea63477e766a2aa13 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()) {
+ 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;
pdr. 2017/01/03 21:29:04 Could you do something like: bool needsCompositorE
wkorman 2017/01/03 22:04:40 Yeah, sort of -- CompositorElementId is a struct w
+ 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(
pdr. 2017/01/03 21:29:04 The other update* functions follow a style where s
wkorman 2017/01/03 22:04:40 See above comment.
wkorman 2017/01/03 22:15:24 Moved to anonymous namespace and removed method fr
+ 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

Powered by Google App Engine
This is Rietveld 408576698