Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Unified Diff: src/gpu/GrStencilAndCoverPathRenderer.cpp

Issue 1001503002: Implement support for mixed sampled render targets (Closed) Base URL: https://skia.googlesource.com/skia.git@mix1
Patch Set: Multisampling and other fixes Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrStencilAndCoverPathRenderer.cpp
diff --git a/src/gpu/GrStencilAndCoverPathRenderer.cpp b/src/gpu/GrStencilAndCoverPathRenderer.cpp
index aed1743af22216864a2aa2382a2ea724cc0c82a9..54b646c747b5b9f314a40798c9cf50172b15d57b 100644
--- a/src/gpu/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/GrStencilAndCoverPathRenderer.cpp
@@ -59,7 +59,8 @@ bool GrStencilAndCoverPathRenderer::canDrawPath(const GrDrawTarget* target,
const SkStrokeRec& stroke,
bool antiAlias) const {
return !stroke.isHairlineStyle() &&
- !antiAlias && // doesn't do per-path AA, relies on the target having MSAA
+ (!antiAlias || // doesn't do per-path AA, relies on the target having MSAA
+ pipelineBuilder->getRenderTarget()->isMultisampled(kStencil_GrSampleConfig)) &&
pipelineBuilder->getStencil().isDisabled();
Chris Dalton 2015/03/17 00:39:35 Here we can punt and only use nvfms if coverage mo
}
@@ -101,7 +102,8 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(GrDrawTarget* target,
const SkPath& path,
const SkStrokeRec& stroke,
bool antiAlias) {
- SkASSERT(!antiAlias);
+ SkASSERT(!antiAlias ||
+ pipelineBuilder->getRenderTarget()->isMultisampled(kStencil_GrSampleConfig));
Chris Dalton 2015/03/16 19:31:24 We can take out this assert from here since we do
SkASSERT(!stroke.isHairlineStyle());
SkASSERT(pipelineBuilder->getStencil().isDisabled());
@@ -160,5 +162,9 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(GrDrawTarget* target,
}
pipelineBuilder->stencil()->setDisabled();
+ if (antiAlias) {
+ SkASSERT(pipelineBuilder->getRenderTarget()->isMultisampled(kStencil_GrSampleConfig));
+ pipelineBuilder->enableState(GrPipelineBuilder::kHWAntialias_StateBit);
+ }
return true;
}

Powered by Google App Engine
This is Rietveld 408576698