Skip to content

Commit 4a10a68

Browse files
Connor ClarkDevtools-frontend LUCI CQ
authored andcommitted
[RPP] Only save context if needed for TimelineFlameChartMarker
Bug: none Change-Id: I128f899a2948cc70cc6aeb824ceedd3b730b2f54 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5935713 Commit-Queue: Paul Irish <[email protected]> Auto-Submit: Connor Clark <[email protected]> Reviewed-by: Paul Irish <[email protected]>
1 parent 9992f67 commit 4a10a68

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

front_end/panels/timeline/TimelineFlameChartView.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,17 +1459,21 @@ export class TimelineFlameChartMarker implements PerfUI.FlameChart.FlameChartMar
14591459
return;
14601460
}
14611461

1462-
context.save();
1463-
if (this.style.tall) {
1464-
context.strokeStyle = this.style.color;
1465-
context.lineWidth = this.style.lineWidth;
1466-
context.translate(this.style.lineWidth < 1 || (this.style.lineWidth & 1) ? 0.5 : 0, 0.5);
1467-
context.beginPath();
1468-
context.moveTo(x, 0);
1469-
context.setLineDash(this.style.dashStyle);
1470-
context.lineTo(x, context.canvas.height);
1471-
context.stroke();
1462+
if (!this.style.tall) {
1463+
return;
14721464
}
1465+
1466+
context.save();
1467+
1468+
context.strokeStyle = this.style.color;
1469+
context.lineWidth = this.style.lineWidth;
1470+
context.translate(this.style.lineWidth < 1 || (this.style.lineWidth & 1) ? 0.5 : 0, 0.5);
1471+
context.beginPath();
1472+
context.moveTo(x, 0);
1473+
context.setLineDash(this.style.dashStyle);
1474+
context.lineTo(x, context.canvas.height);
1475+
context.stroke();
1476+
14731477
context.restore();
14741478
}
14751479
}

0 commit comments

Comments
 (0)