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 f48b8772ce4a0e0500b69506c1569b7940b483ce..bced6e62f5cecec988c3ccd8623b6c01a5e8d09f 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
| @@ -310,6 +310,20 @@ static void updateOutOfFlowContext(const LayoutObject& object, bool createdNewTr |
| } |
| } |
| +PassOwnPtr<ObjectPaintProperties::PropertyTreeContext> recordTreeContextIfNeeded(LayoutObject& object, const PaintPropertyTreeBuilderContext& context) |
| +{ |
| + // Note: Currently only layer painter makes use of the pre-computed context. This condition can be changed. |
|
pdr.
2016/02/04 04:54:01
I tried to think of a case where this would be use
trchen
2016/02/04 23:08:40
I don't know. It may be used by the merge algorith
|
| + if (!object.hasLayer()) |
| + return nullptr; |
| + |
| + OwnPtr<ObjectPaintProperties::PropertyTreeContext> recordedContext = adoptPtr(new ObjectPaintProperties::PropertyTreeContext); |
| + recordedContext->paintOffset = context.paintOffset; |
| + recordedContext->properties.transform = context.currentTransform; |
| + recordedContext->properties.clip = context.currentClip; |
| + recordedContext->properties.effect = context.currentEffect; |
| + return recordedContext.release(); |
| +} |
| + |
| void PaintPropertyTreeBuilder::walk(LayoutObject& object, const PaintPropertyTreeBuilderContext& context) |
| { |
| PaintPropertyTreeBuilderContext localContext(context); |
| @@ -318,6 +332,7 @@ void PaintPropertyTreeBuilder::walk(LayoutObject& object, const PaintPropertyTre |
| RefPtr<TransformPaintPropertyNode> newTransformNodeForPaintOffsetTranslation = createPaintOffsetTranslationIfNeeded(object, localContext); |
| RefPtr<TransformPaintPropertyNode> newTransformNodeForTransform = createTransformIfNeeded(object, localContext); |
| RefPtr<EffectPaintPropertyNode> newEffectNode = createEffectIfNeeded(object, localContext); |
| + OwnPtr<ObjectPaintProperties::PropertyTreeContext> newRecordedContext = recordTreeContextIfNeeded(object, localContext); |
| RefPtr<ClipPaintPropertyNode> newClipNodeForOverflowClip = createOverflowClipIfNeeded(object, localContext); |
| // TODO(trchen): Insert flattening transform here, as specified by |
| // http://www.w3.org/TR/css3-transforms/#transform-style-property |
| @@ -325,14 +340,15 @@ void PaintPropertyTreeBuilder::walk(LayoutObject& object, const PaintPropertyTre |
| RefPtr<TransformPaintPropertyNode> newTransformNodeForScrollTranslation = createScrollTranslationIfNeeded(object, localContext); |
| updateOutOfFlowContext(object, newTransformNodeForTransform, localContext); |
| - if (newTransformNodeForPaintOffsetTranslation || newTransformNodeForTransform || newEffectNode || newClipNodeForOverflowClip || newTransformNodeForPerspective || newTransformNodeForScrollTranslation) { |
| + if (newTransformNodeForPaintOffsetTranslation || newTransformNodeForTransform || newEffectNode || newClipNodeForOverflowClip || newTransformNodeForPerspective || newTransformNodeForScrollTranslation || newRecordedContext) { |
| OwnPtr<ObjectPaintProperties> updatedPaintProperties = ObjectPaintProperties::create( |
| newTransformNodeForPaintOffsetTranslation.release(), |
| newTransformNodeForTransform.release(), |
| newEffectNode.release(), |
| newClipNodeForOverflowClip.release(), |
| newTransformNodeForPerspective.release(), |
| - newTransformNodeForScrollTranslation.release()); |
| + newTransformNodeForScrollTranslation.release(), |
| + newRecordedContext.release()); |
| object.setObjectPaintProperties(updatedPaintProperties.release()); |
| } else { |
| object.clearObjectPaintProperties(); |