Skip to content

Commit

Permalink
add traces to aid on investigation
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Fabio Carballo authored and facebook-github-bot committed Nov 6, 2024
1 parent be0fa1d commit 67fd656
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand All @@ -155,6 +160,10 @@ private void maybeDrawOutline(Canvas canvas) {
p.setColor(savedColor);
p.setStrokeJoin(savedJoin);
}

if (isTracing) {
ComponentsSystrace.endSection();
}
}

private String getDebugInfo() {
Expand Down

0 comments on commit 67fd656

Please sign in to comment.