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

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: Handle numSamples cases in SkGpuDevice Created 5 years, 8 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
« no previous file with comments | « src/gpu/GrProcOptInfo.h ('k') | src/gpu/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrStencilAndCoverPathRenderer.cpp
diff --git a/src/gpu/GrStencilAndCoverPathRenderer.cpp b/src/gpu/GrStencilAndCoverPathRenderer.cpp
index aed1743af22216864a2aa2382a2ea724cc0c82a9..d1507ed6e552500613d13c21ae4dd21e5ad192f0 100644
--- a/src/gpu/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/GrStencilAndCoverPathRenderer.cpp
@@ -58,9 +58,30 @@ bool GrStencilAndCoverPathRenderer::canDrawPath(const GrDrawTarget* target,
const SkPath& path,
const SkStrokeRec& stroke,
bool antiAlias) const {
- return !stroke.isHairlineStyle() &&
- !antiAlias && // doesn't do per-path AA, relies on the target having MSAA
- pipelineBuilder->getStencil().isDisabled();
+
+ if (stroke.isHairlineStyle()) {
+ return false;
+ }
+ if (!pipelineBuilder->getStencil().isDisabled()) {
+ return false;
+ }
+ if (antiAlias) {
+ // No Xfer processors that might do blending inside the shader.
+ // Coverage modulation for mixed samples is done *after* shading, so blending
+ // must occur in the ROP.
+ // TODO: Update Xfer processors to better support mixed samples.
+ if (GrRenderTarget::kStencil_SampleConfig ==
+ pipelineBuilder->getRenderTarget()->sampleConfig() &&
+ pipelineBuilder->willXPNeedDstCopy(*fGpu->caps(), GrProcOptInfo(), GrProcOptInfo())) {
+ return false;
+ }
+
+ return pipelineBuilder->getRenderTarget()->isMultisampled(
+ GrRenderTarget::kStencil_BufferBit) &&
+ pipelineBuilder->canTweakAlphaForCoverage();
+ } else {
+ return true; // doesn't do per-path AA, relies on the target having MSAA
+ }
}
GrPathRenderer::StencilSupport
@@ -101,7 +122,6 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(GrDrawTarget* target,
const SkPath& path,
const SkStrokeRec& stroke,
bool antiAlias) {
- SkASSERT(!antiAlias);
SkASSERT(!stroke.isHairlineStyle());
SkASSERT(pipelineBuilder->getStencil().isDisabled());
@@ -160,5 +180,10 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(GrDrawTarget* target,
}
pipelineBuilder->stencil()->setDisabled();
+ if (antiAlias) {
+ SkASSERT(pipelineBuilder->getRenderTarget()->isMultisampled(
+ GrRenderTarget::kStencil_BufferBit));
+ pipelineBuilder->enableState(GrPipelineBuilder::kHWAntialias_StateBit);
Chris Dalton 2015/04/17 22:05:12 Sorry, I think I may have misled you about where t
+ }
return true;
}
« no previous file with comments | « src/gpu/GrProcOptInfo.h ('k') | src/gpu/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698