From 67fd656e1192566be886d26c6fa01e2f761c760e Mon Sep 17 00:00:00 2001 From: Fabio Carballo Date: Wed, 6 Nov 2024 11:30:20 -0800 Subject: [PATCH] add traces to aid on investigation Summary: There is a QE setting shadows that is seeing regression performances - so we want to understand if this is the bit where the bigger source of the regression comes from. Differential Revision: D65541311 fbshipit-source-id: 592e78384f4f641ca26b29c8e78382bd10427312 --- .../java/com/facebook/litho/widget/TextDrawable.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/litho-widget/src/main/java/com/facebook/litho/widget/TextDrawable.java b/litho-widget/src/main/java/com/facebook/litho/widget/TextDrawable.java index 859f8e120a..94fdd7604e 100644 --- a/litho-widget/src/main/java/com/facebook/litho/widget/TextDrawable.java +++ b/litho-widget/src/main/java/com/facebook/litho/widget/TextDrawable.java @@ -46,6 +46,7 @@ import androidx.annotation.RequiresApi; import androidx.annotation.VisibleForTesting; import com.facebook.fbui.textlayoutbuilder.util.LayoutMeasureUtil; +import com.facebook.litho.ComponentsSystrace; import com.facebook.litho.TextContent; import com.facebook.litho.Touchable; import com.facebook.litho.utils.VersionedAndroidApis; @@ -138,6 +139,10 @@ public void draw(Canvas canvas) { */ @RequiresApi(Build.VERSION_CODES.Q) private void maybeDrawOutline(Canvas canvas) { + boolean isTracing = ComponentsSystrace.isTracing(); + if (isTracing) { + ComponentsSystrace.beginSection("TextDrawable.maybeDrawOutline"); + } if (mOutlineWidth > 0f) { Paint p = mLayout.getPaint(); int savedColor = p.getColor(); @@ -155,6 +160,10 @@ private void maybeDrawOutline(Canvas canvas) { p.setColor(savedColor); p.setStrokeJoin(savedJoin); } + + if (isTracing) { + ComponentsSystrace.endSection(); + } } private String getDebugInfo() {