Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/components/shared/thread/HeightGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ export class ThreadHeightGraph extends PureComponent<Props> {
xPos: number[],
};
function drawSamples(samplesBucket: SamplesBucket, color: string) {
if (samplesBucket.xPos.length === 0) {
return;
}
ctx.fillStyle = color;
for (let i = 0; i < samplesBucket.height.length; i++) {
const height = samplesBucket.height[i];
Expand Down
5 changes: 4 additions & 1 deletion src/components/shared/thread/SampleGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,11 @@ export class ThreadSampleGraphImpl extends PureComponent<Props> {
}

function drawSamples(samplePositions: number[], color: string) {
if (samplePositions.length === 0) {
return;
}
ctx.fillStyle = color;
for (let i = 0; i < samplePositions.length; i++) {
ctx.fillStyle = color;
const startY = 0;
const xPos = samplePositions[i];
ctx.fillRect(xPos, startY, drawnSampleWidth, canvas.height);
Expand Down
8 changes: 0 additions & 8 deletions src/test/components/__snapshots__/CPUGraph.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

exports[`CPUGraph matches the 2d canvas draw snapshot 1`] = `
Array [
Array [
"set fillStyle",
"#45a1ff",
],
Array [
"set fillStyle",
"#003eaa",
Expand Down Expand Up @@ -66,10 +62,6 @@ Array [
10,
0,
],
Array [
"set fillStyle",
"#c5e1fe",
],
Array [
"clearRect",
0,
Expand Down
28 changes: 0 additions & 28 deletions src/test/components/__snapshots__/SampleGraph.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -24,76 +24,48 @@ Array [
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
5,
0,
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
15,
0,
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
25,
0,
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
35,
0,
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
45,
0,
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
55,
0,
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
65,
Expand Down
88 changes: 0 additions & 88 deletions src/test/components/__snapshots__/ThreadActivityGraph.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2541,76 +2541,48 @@ Array [
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
5,
0,
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
15,
0,
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
25,
0,
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
35,
0,
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
45,
0,
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
55,
0,
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
65,
Expand Down Expand Up @@ -5189,76 +5161,48 @@ Array [
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
5,
0,
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
15,
0,
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
25,
0,
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
35,
0,
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
45,
0,
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
55,
0,
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
65,
Expand Down Expand Up @@ -7837,76 +7781,48 @@ Array [
6.666666666666667,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
3.3333333333333335,
0,
6.666666666666667,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
10,
0,
6.666666666666667,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
43.333333333333336,
0,
6.666666666666667,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
50,
0,
6.666666666666667,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
56.666666666666664,
0,
6.666666666666667,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
63.333333333333336,
0,
6.666666666666667,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
70.00000000000001,
Expand Down Expand Up @@ -10042,10 +9958,6 @@ Array [
10,
10,
],
Array [
"set fillStyle",
"#003eaa",
],
Array [
"fillRect",
35,
Expand Down
8 changes: 0 additions & 8 deletions src/test/components/__snapshots__/TrackThread.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

exports[`timeline/TrackThread matches the 2d canvas draw snapshot 1`] = `
Array [
Array [
"set fillStyle",
"#45a1ff",
],
Array [
"set fillStyle",
"#003eaa",
Expand Down Expand Up @@ -38,10 +34,6 @@ Array [
100,
50,
],
Array [
"set fillStyle",
"#c5e1fe",
],
Array [
"clearRect",
0,
Expand Down