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() {