Take edge AA flags into account when applying implicit device bounds clip

Bug: skia:13114
Change-Id: I1e6552aaeee68eaf4e50e42da2a7761953b06415
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526019
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This commit is contained in:
Michael Ludwig 2022-03-30 14:05:30 -04:00 committed by SkCQ
parent 121d4a2e4b
commit 7f5033d714

View File

@ -475,8 +475,13 @@ SurfaceDrawContext::QuadOptimization SurfaceDrawContext::attemptQuadOptimization
return QuadOptimization::kClipApplied;
} else {
// Update result to store the render target bounds in order and then fall
// through to attempt the draw->native clear optimization
result = GrClip::PreClipResult(SkRRect::MakeRect(rtRect), *aa);
// through to attempt the draw->native clear optimization. Pick an AA value such
// that any geometric clipping doesn't need to change aa or edge flags (since we
// know this is on pixel boundaries, it will draw the same regardless).
// See skbug.com/13114 for more details.
GrAA clipAA = (*aa == GrAA::kNo || quad->fEdgeFlags == GrQuadAAFlags::kNone) ?
GrAA::kNo : GrAA::kYes;
result = GrClip::PreClipResult(SkRRect::MakeRect(rtRect), clipAA);
}
break;
case GrClip::Effect::kClipped: