diff options
author | 2016-12-09 15:10:07 -0500 | |
---|---|---|
committer | 2016-12-09 20:43:41 +0000 | |
commit | 0e8fc8b9e6a138cf4a66b421fb824679df717329 (patch) | |
tree | 9db412fc2ea22314336f3680249e905c4984902c /src/gpu/text | |
parent | 385836d3d764303cc37c4d1bcc0ab890d209374e (diff) |
Relandx2 "Remove antialiasing control from GrPaint."
Fixes a bad merge.
This reverts commit 073285c0595d46205d1482cc19af2d7d891bfeae.
Change-Id: I5e92339d9b33d3a6dc58b9fcd2a1b3a5684e8f8a
Reviewed-on: https://skia-review.googlesource.com/5774
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/text')
-rw-r--r-- | src/gpu/text/GrAtlasTextBlob.cpp | 3 | ||||
-rw-r--r-- | src/gpu/text/GrStencilAndCoverTextContext.cpp | 21 | ||||
-rw-r--r-- | src/gpu/text/GrStencilAndCoverTextContext.h | 2 |
3 files changed, 16 insertions, 10 deletions
diff --git a/src/gpu/text/GrAtlasTextBlob.cpp b/src/gpu/text/GrAtlasTextBlob.cpp index 5b35f845c1..1fb4f2cdda 100644 --- a/src/gpu/text/GrAtlasTextBlob.cpp +++ b/src/gpu/text/GrAtlasTextBlob.cpp @@ -323,8 +323,7 @@ void GrAtlasTextBlob::flushRun(GrRenderTargetContext* rtc, const GrPaint& grPain distanceAdjustTable, rtc->isGammaCorrect(), cache)); - - GrPipelineBuilder pipelineBuilder(grPaint, rtc->mustUseHWAA(grPaint)); + GrPipelineBuilder pipelineBuilder(grPaint, GrAAType::kNone); rtc->addDrawOp(pipelineBuilder, clip, batch.get()); } diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp index ba98784c71..b573b83f62 100644 --- a/src/gpu/text/GrStencilAndCoverTextContext.cpp +++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp @@ -224,10 +224,8 @@ void GrStencilAndCoverTextContext::drawTextBlob(GrContext* context, GrRenderTarg TextBlob::Iter iter(blob); for (TextRun* run = iter.get(); run; run = iter.next()) { - // The run's "font" overrides the anti-aliasing of the passed in paint! - paint.setAntiAlias(run->isAntiAlias()); - run->draw(context, rtc, paint, clip, viewMatrix, props, x, y, - clipBounds, fFallbackTextContext, skPaint); + run->draw(context, rtc, paint, clip, viewMatrix, props, x, y, clipBounds, + fFallbackTextContext, skPaint); run->releaseGlyphCache(); } } @@ -605,8 +603,9 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx, const SkIRect& clipBounds, GrAtlasTextContext* fallbackTextContext, const SkPaint& originalSkPaint) const { + GrAA runAA = this->isAntiAlias(); SkASSERT(fInstanceData); - SkASSERT(renderTargetContext->isStencilBufferMultisampled() || !grPaint.isAntiAlias()); + SkASSERT(renderTargetContext->isStencilBufferMultisampled() || GrAA::kNo == runAA); if (fInstanceData->count()) { static constexpr GrUserStencilSettings kCoverPass( @@ -640,8 +639,16 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx, GrPathRendering::kWinding_FillType, glyphs.get(), fInstanceData.get(), bounds)); - GrPipelineBuilder pipelineBuilder(grPaint); - pipelineBuilder.setState(GrPipelineBuilder::kHWAntialias_Flag, grPaint.isAntiAlias()); + // The run's "font" overrides the anti-aliasing of the passed in SkPaint! + GrAAType aaType = GrAAType::kNone; + if (GrAA::kYes == runAA) { + if (renderTargetContext->isUnifiedMultisampled()) { + aaType = GrAAType::kMSAA; + } else if (renderTargetContext->isStencilBufferMultisampled()) { + aaType = GrAAType::kMixedSamples; + } + } + GrPipelineBuilder pipelineBuilder(grPaint, aaType); pipelineBuilder.setUserStencil(&kCoverPass); renderTargetContext->addDrawOp(pipelineBuilder, clip, batch.get()); diff --git a/src/gpu/text/GrStencilAndCoverTextContext.h b/src/gpu/text/GrStencilAndCoverTextContext.h index f4773ffa5b..1ba113b59b 100644 --- a/src/gpu/text/GrStencilAndCoverTextContext.h +++ b/src/gpu/text/GrStencilAndCoverTextContext.h @@ -88,7 +88,7 @@ private: size_t computeSizeInCache() const; - bool isAntiAlias() const { return fFont.isAntiAlias(); } + GrAA isAntiAlias() const { return fFont.isAntiAlias() ? GrAA::kYes : GrAA::kNo; } private: typedef GrDrawPathRangeBatch::InstanceData InstanceData; |