Skip to content

Commit

Permalink
Don't do clear or round rect optimizations when a rect has stencil
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
csmartdalton86 authored and Skia Commit-Bot committed Feb 5, 2020
1 parent 6c9b1fd commit bc3307c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gpu/GrRenderTargetContext.cpp
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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) &&
Expand Down

0 comments on commit bc3307c

Please sign in to comment.