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

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..4f6497cd45ddc1ad86f007ba3db16886d9f491a3 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
@@ -1207,6 +1207,11 @@ void PaintPropertyTreeBuilder::UpdatePaintProperties(
}
}
+static inline bool ObjectTypeMightNeedPaintProperties(
+ const LayoutObject& object) {
+ return object.IsBoxModelObject() || object.IsSVG();
+}
+
void PaintPropertyTreeBuilder::UpdatePropertiesForSelf(
const LayoutObject& object,
PaintPropertyTreeBuilderContext& full_context) {
@@ -1218,7 +1223,11 @@ void PaintPropertyTreeBuilder::UpdatePropertiesForSelf(
context = PaintPropertyTreeBuilderFragmentContext();
}
- UpdatePaintProperties(object, full_context);
+ bool object_type_might_need_paint_properties =
+ ObjectTypeMightNeedPaintProperties(object);
+
+ if (object_type_might_need_paint_properties)
+ UpdatePaintProperties(object, full_context);
bool is_actually_needed = false;
#if DCHECK_IS_ON()
@@ -1236,7 +1245,7 @@ void PaintPropertyTreeBuilder::UpdatePropertiesForSelf(
object, full_context.force_subtree_update);
#endif
- if (object.IsBoxModelObject() || object.IsSVG()) {
+ if (object_type_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 +1264,7 @@ void PaintPropertyTreeBuilder::UpdatePropertiesForSelf(
void PaintPropertyTreeBuilder::UpdatePropertiesForChildren(
const LayoutObject& object,
PaintPropertyTreeBuilderContext& context) {
- if (!object.IsBoxModelObject() && !object.IsSVG())
+ if (!ObjectTypeMightNeedPaintProperties(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