Remove a GL optimization that disabled large scissors

Removes an optimization from GrGLGpu that disabled scissor when the
scissor rect contained the entire viewport. This is incompatible with
the dynamic state world where scissor test is enabled during pipeline
bind, and then only the scissor rect is updated between draws. It also
might actually be an un-optimization since scissor test enable state
can be more expensive to change than the rect.

Change-Id: Iadb14e2b5fbebde3fe71bc0dfdaeb979617bb80b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271939
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Chris Dalton 2020-02-19 11:45:21 -07:00 committed by Skia Commit-Bot
parent a6350f021e
commit dc2b15e99f

View File

@ -1753,19 +1753,15 @@ void GrGLGpu::flushScissor(const GrScissorState& scissorState, int rtWidth, int
GrSurfaceOrigin rtOrigin) {
if (scissorState.enabled()) {
auto scissor = GrNativeRect::MakeRelativeTo(rtOrigin, rtHeight, scissorState.rect());
// if the scissor fully contains the viewport then we fall through and
// disable the scissor test.
if (!scissor.contains(rtWidth, rtHeight)) {
if (fHWScissorSettings.fRect != scissor) {
GL_CALL(Scissor(scissor.fX, scissor.fY, scissor.fWidth, scissor.fHeight));
fHWScissorSettings.fRect = scissor;
}
if (kYes_TriState != fHWScissorSettings.fEnabled) {
GL_CALL(Enable(GR_GL_SCISSOR_TEST));
fHWScissorSettings.fEnabled = kYes_TriState;
}
return;
if (fHWScissorSettings.fRect != scissor) {
GL_CALL(Scissor(scissor.fX, scissor.fY, scissor.fWidth, scissor.fHeight));
fHWScissorSettings.fRect = scissor;
}
if (kYes_TriState != fHWScissorSettings.fEnabled) {
GL_CALL(Enable(GR_GL_SCISSOR_TEST));
fHWScissorSettings.fEnabled = kYes_TriState;
}
return;
}
// See fall through note above