| Index: src/gpu/GrClipMaskManager.cpp
|
| diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
|
| index 076871ca05b25a001f66ef790de30c87d1d7dfd9..d5da16b256b7e297efa0e1ba4db7fbbeec8c756e 100644
|
| --- a/src/gpu/GrClipMaskManager.cpp
|
| +++ b/src/gpu/GrClipMaskManager.cpp
|
| @@ -368,8 +368,23 @@ bool GrClipMaskManager::setupClipping(const GrPipelineBuilder& pipelineBuilder,
|
| }
|
| }
|
|
|
| - // If MSAA is enabled we can do everything in the stencil buffer.
|
| - if (0 == rt->numStencilSamples() && requiresAA) {
|
| + SkASSERT(!pipelineBuilder.isHWAntialias() || rt->isStencilBufferMultisampled());
|
| +
|
| + bool hasHWAntialias = pipelineBuilder.isHWAntialias();
|
| +
|
| + if (rt->isStencilBufferMultisampled() && !hasHWAntialias) {
|
| + if (!this->caps()->multisampleDisableSupport()) {
|
| + hasHWAntialias = true; // This will be on regardless, it's impossible to turn it off.
|
| + } else if (this->caps()->programmableSampleLocationsSupport()) {
|
| + // Enable HW antialias, but leave the draw non-antialiased by co-centering the samples.
|
| + out->fAdditionalPipelineFlags |= GrPipeline::kHWAA_Flag |
|
| + GrPipeline::kCoCenterSamples_Flag;
|
| + hasHWAntialias = true;
|
| + }
|
| + }
|
| +
|
| + // If we have HW antialias, or don't need AA, we can do everything in the stencil buffer.
|
| + if (!hasHWAntialias && requiresAA) {
|
| SkAutoTUnref<GrTexture> result;
|
|
|
| // The top-left of the mask corresponds to the top-left corner of the bounds.
|
|
|