aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrClipMaskManager.cpp
diff options
context:
space:
mode:
authorGravatar cdalton <cdalton@nvidia.com>2016-05-06 09:41:16 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-05-06 09:41:16 -0700
commit3ccf2e75ed92adb3c2c289e0cb95901d162df394 (patch)
tree92e4b20cdc1b5a7fff7945fc982bd22f1e8636d0 /src/gpu/GrClipMaskManager.cpp
parent73e81abd5e87a6630a2e2725abf13e11af4c8792 (diff)
Remove hasMixedSamples() from GrPipelineBuilder
This info is unknown until after any clip has been applied to the stencil settings, so it's misleading to include in the builder. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1952323002 Review-Url: https://codereview.chromium.org/1952323002
Diffstat (limited to 'src/gpu/GrClipMaskManager.cpp')
-rw-r--r--src/gpu/GrClipMaskManager.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index 3988e67ffe..654b315d52 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -448,7 +448,14 @@ bool GrClipMaskManager::setupClipping(const GrPipelineBuilder& pipelineBuilder,
SkIntToScalar(-clip.origin().fY) };
// When there are multiple samples we want to do per-sample clipping, not compute a
// fractional pixel coverage.
- bool disallowAnalyticAA = rt->isUnifiedMultisampled() || pipelineBuilder.hasMixedSamples();
+ bool disallowAnalyticAA = rt->isStencilBufferMultisampled();
+ if (disallowAnalyticAA && !rt->numColorSamples()) {
+ // With a single color sample, any coverage info is lost from color once it hits the
+ // color buffer anyway, so we may as well use coverage AA if nothing else in the pipe
+ // is multisampled.
+ disallowAnalyticAA = pipelineBuilder.isHWAntialias() ||
+ !pipelineBuilder.getStencil().isDisabled();
+ }
const GrFragmentProcessor* clipFP = nullptr;
if (elements.isEmpty() ||
(requiresAA &&