Reset path bounding box tracking when starting a new path.

Starting a new path will wipe out any of the current subpaths in the
current graphics state, so we should reset the min/maxes.

This makes a number of the bounding boxes smaller and reduces the number
of composed pixels. For the smask tests in the corpus, the number of
composed pixesl goes from 19,872,109 to 19,676,905. The difference is much
larger on other PDFs though.
This commit is contained in:
Brendan Dahl 2021-11-03 11:46:52 -07:00
parent 6a15973a1b
commit 039a7a670f

View File

@ -3071,6 +3071,7 @@ class CanvasGraphics {
}
this.pendingClip = null;
}
this.current.startNewPathAndClipBox(this.current.clipBox);
ctx.beginPath();
}