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

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: Fix build error related to isMultisamped renaming Created 5 years, 6 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/GrPipelineBuilder.cpp ('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 a082325b52d8a3b7be59d67a5d965a090469f730..248730bde17430c7fc5b8eaa31721fa140ccbc31 100644
--- a/src/gpu/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/GrStencilAndCoverPathRenderer.cpp
@@ -51,9 +51,17 @@ bool GrStencilAndCoverPathRenderer::canDrawPath(const GrDrawTarget* target,
const SkPath& path,
const GrStrokeInfo& 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) {
+ return pipelineBuilder->getRenderTarget()->isStencilBufferMultisampled();
+ } else {
+ return true; // doesn't do per-path AA, relies on the target having MSAA
+ }
}
GrPathRenderer::StencilSupport
@@ -100,10 +108,14 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(GrDrawTarget* target,
const SkPath& path,
const GrStrokeInfo& stroke,
bool antiAlias) {
- SkASSERT(!antiAlias);
SkASSERT(!stroke.isHairlineStyle());
SkASSERT(pipelineBuilder->getStencil().isDisabled());
+ if (antiAlias) {
+ SkASSERT(pipelineBuilder->getRenderTarget()->isStencilBufferMultisampled());
+ pipelineBuilder->enableState(GrPipelineBuilder::kHWAntialias_Flag);
+ }
+
SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, path, stroke));
if (path.isInverseFillType()) {
« no previous file with comments | « src/gpu/GrPipelineBuilder.cpp ('k') | src/gpu/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698