Don't do clear or round rect optimizations when a rect has stencil

Change-Id: Ib506c0cc3c46d1bf514b35a8ba78d31d3e84f22c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268666
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This commit is contained in:
Chris Dalton 2020-02-04 13:21:03 -07:00 committed by Skia Commit-Bot
parent 6c9b1fd666
commit bc3307c395

View File

@ -685,7 +685,8 @@ GrRenderTargetContext::QuadOptimization GrRenderTargetContext::attemptQuadOptimi
if (clipRRect.isRect()) {
// No rounded corners, so the kClear and kExplicitClip optimizations are possible
if (GrQuadUtils::CropToRect(clipBounds, clipAA, &newFlags, deviceQuad, localQuad)) {
if (constColor && deviceQuad->quadType() == GrQuad::Type::kAxisAligned) {
if (!stencilSettings && constColor &&
deviceQuad->quadType() == GrQuad::Type::kAxisAligned) {
// Clear optimization is possible
drawBounds = deviceQuad->bounds();
if (drawBounds.contains(rtRect)) {
@ -722,7 +723,7 @@ GrRenderTargetContext::QuadOptimization GrRenderTargetContext::attemptQuadOptimi
// the clip entirely
return QuadOptimization::kCropped;
}
} else if (constColor) {
} else if (!stencilSettings && constColor) {
// Rounded corners and constant filled color (limit ourselves to solid colors because
// there is no way to use custom local coordinates with drawRRect).
if (GrQuadUtils::CropToRect(clipBounds, clipAA, &newFlags, deviceQuad, localQuad) &&