[graphite] Improve no-op scissor handling

This improves on a scenario where a draw early in the command list needs
a scissor rect, and then there's a long list of draws with nominally
different scissors that are all not affected by their scissors.

Before this change, the second draw (which is unaffected by its scissor
but needs to change it from the 1st draw's scissor), we'd set it to the
2nd draw's nominal scissor. This would cascade through to each draw
needing to change from the prior scissor to its nominal scissor that
doesn't actually affect it. Had the first draw not required a scissor at
all, we would get the preferred command behavior of never setting a
scissor at all.

With this change, we set the scissor rect for the first draw and then
unset it on the second, remaining unset for the rest of the hypothetical
draws.

This isn't just done in the ClipStack to change the scissor stored on
the `Clip` object because checking here can take into account the
special inverse-fill handling rules for particular RenderSteps.

Bug: b/424510276
Change-Id: I1e567687c6ccde5262642d6c36374edf82dfc881
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1015959
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
1 file changed