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 2823cc71fc0a171897078a01fb939785dc88bc5e..ba9e65ad3051ac96b1087ad85464bdf2175c18b5 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
| @@ -162,17 +162,14 @@ void PaintPropertyTreeBuilder::updateCssClip(const LayoutObject& object, PaintPr |
| void PaintPropertyTreeBuilder::updateLocalBorderBoxContext(const LayoutObject& object, const PaintPropertyTreeBuilderContext& context) |
| { |
| - // Note: Currently only layer painter makes use of the pre-computed context. |
| - // This condition may be loosened with no adverse effects beside memory use. |
| - if (!object.hasLayer()) |
| + // Avoid adding an ObjectPaintProperties for non-boxes to save memory, since we don't need them at the moment. |
| + if (!object.isBox() && !object.hasLayer()) |
| return; |
| std::unique_ptr<ObjectPaintProperties::LocalBorderBoxProperties> borderBoxContext = |
| wrapUnique(new ObjectPaintProperties::LocalBorderBoxProperties); |
| borderBoxContext->paintOffset = context.paintOffset; |
| - borderBoxContext->transform = context.currentTransform; |
| - borderBoxContext->clip = context.currentClip; |
| - borderBoxContext->effect = context.currentEffect; |
| + borderBoxContext->propertyTreeState = PropertyTreeState(context.currentTransform, context.currentClip, context.currentEffect); |
| object.getMutableForPainting().ensureObjectPaintProperties().setLocalBorderBoxProperties(std::move(borderBoxContext)); |
| } |
| @@ -384,11 +381,11 @@ static void deriveBorderBoxFromContainerContext(const LayoutObject& object, Pain |
| void PaintPropertyTreeBuilder::buildTreeNodes(const LayoutObject& object, PaintPropertyTreeBuilderContext& context) |
| { |
| + object.getMutableForPainting().clearObjectPaintProperties(); |
|
pdr.
2016/07/01 18:39:39
Won't this create an object paint properties for a
chrishtr
2016/07/01 22:01:12
This is clearObjectPaintProperties(), which remove
|
| + |
| if (!object.isBoxModelObject() && !object.isSVG()) |
| return; |
| - object.getMutableForPainting().clearObjectPaintProperties(); |
| - |
| deriveBorderBoxFromContainerContext(object, context); |
| updatePaintOffsetTranslation(object, context); |