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

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

Issue 2883153002: Don't bother checking for paint properties for classes that never need them. (Closed)
Patch Set: none Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698