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 42d0cb93ce21beee0ffb1afea870788548b22afd..4ae5bcc578987cb5f9f2e710b574e009ea44836c 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
| @@ -1207,6 +1207,10 @@ void PaintPropertyTreeBuilder::UpdatePaintProperties( |
| } |
| } |
| +static inline bool MightNeedPaintProperties(const LayoutObject& object) { |
| + return object.IsBoxModelObject() || object.IsSVG(); |
|
pdr.
2017/05/15 21:32:45
Why is IsSVG() needed?
chrishtr
2017/05/15 21:36:22
NeedsSVGLocalToBorderBoxTransform, NeedsTransformF
|
| +} |
| + |
| void PaintPropertyTreeBuilder::UpdatePropertiesForSelf( |
| const LayoutObject& object, |
| PaintPropertyTreeBuilderContext& full_context) { |
| @@ -1218,7 +1222,10 @@ void PaintPropertyTreeBuilder::UpdatePropertiesForSelf( |
| context = PaintPropertyTreeBuilderFragmentContext(); |
| } |
| - UpdatePaintProperties(object, full_context); |
| + bool might_need_paint_properties = MightNeedPaintProperties(object); |
|
pdr.
2017/05/15 21:32:45
It's important that this does not change between u
chrishtr
2017/05/15 21:36:22
Indeed. Changed.
|
| + |
| + if (might_need_paint_properties) |
|
pdr.
2017/05/15 21:32:45
Is the perf win just reducing the calls to this fn
chrishtr
2017/05/15 21:36:22
No. the perf win is not calling UpdatePaintPropert
|
| + UpdatePaintProperties(object, full_context); |
| bool is_actually_needed = false; |
| #if DCHECK_IS_ON() |
| @@ -1236,7 +1243,7 @@ void PaintPropertyTreeBuilder::UpdatePropertiesForSelf( |
| object, full_context.force_subtree_update); |
| #endif |
| - if (object.IsBoxModelObject() || object.IsSVG()) { |
| + if (might_need_paint_properties) { |
| UpdateTransform(object, context, full_context.force_subtree_update); |
| UpdateCssClip(object, context, full_context.force_subtree_update); |
| if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| @@ -1255,7 +1262,7 @@ void PaintPropertyTreeBuilder::UpdatePropertiesForSelf( |
| void PaintPropertyTreeBuilder::UpdatePropertiesForChildren( |
| const LayoutObject& object, |
| PaintPropertyTreeBuilderContext& context) { |
| - if (!object.IsBoxModelObject() && !object.IsSVG()) |
| + if (!MightNeedPaintProperties(object)) |
| return; |
| for (auto& fragment_context : context.fragments) { |