diff options
Diffstat (limited to 'src/gpu/text')
-rw-r--r-- | src/gpu/text/GrAtlasTextBlob.cpp | 5 | ||||
-rw-r--r-- | src/gpu/text/GrStencilAndCoverTextContext.cpp | 16 | ||||
-rw-r--r-- | src/gpu/text/GrStencilAndCoverTextContext.h | 2 |
3 files changed, 10 insertions, 13 deletions
diff --git a/src/gpu/text/GrAtlasTextBlob.cpp b/src/gpu/text/GrAtlasTextBlob.cpp index 10f563a1c1..5b35f845c1 100644 --- a/src/gpu/text/GrAtlasTextBlob.cpp +++ b/src/gpu/text/GrAtlasTextBlob.cpp @@ -323,9 +323,8 @@ void GrAtlasTextBlob::flushRun(GrRenderTargetContext* rtc, const GrPaint& grPain distanceAdjustTable, rtc->isGammaCorrect(), cache)); - GrAAType aaType = skPaint.isAntiAlias() && rtc->isUnifiedMultisampled() ? GrAAType::kHW - : GrAAType::kNone; - GrPipelineBuilder pipelineBuilder(grPaint, aaType); + + GrPipelineBuilder pipelineBuilder(grPaint, rtc->mustUseHWAA(grPaint)); rtc->addDrawOp(pipelineBuilder, clip, batch.get()); } diff --git a/src/gpu/text/GrStencilAndCoverTextContext.cpp b/src/gpu/text/GrStencilAndCoverTextContext.cpp index b4e087f788..ba98784c71 100644 --- a/src/gpu/text/GrStencilAndCoverTextContext.cpp +++ b/src/gpu/text/GrStencilAndCoverTextContext.cpp @@ -224,8 +224,10 @@ void GrStencilAndCoverTextContext::drawTextBlob(GrContext* context, GrRenderTarg TextBlob::Iter iter(blob); for (TextRun* run = iter.get(); run; run = iter.next()) { - run->draw(context, rtc, paint, clip, viewMatrix, props, x, y, clipBounds, - fFallbackTextContext, skPaint); + // 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->releaseGlyphCache(); } } @@ -603,9 +605,8 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx, const SkIRect& clipBounds, GrAtlasTextContext* fallbackTextContext, const SkPaint& originalSkPaint) const { - GrAA runAA = this->isAntiAlias(); SkASSERT(fInstanceData); - SkASSERT(renderTargetContext->isStencilBufferMultisampled() || GrAA::kNo == runAA); + SkASSERT(renderTargetContext->isStencilBufferMultisampled() || !grPaint.isAntiAlias()); if (fInstanceData->count()) { static constexpr GrUserStencilSettings kCoverPass( @@ -639,11 +640,8 @@ void GrStencilAndCoverTextContext::TextRun::draw(GrContext* ctx, GrPathRendering::kWinding_FillType, glyphs.get(), fInstanceData.get(), bounds)); - // The run's "font" overrides the anti-aliasing of the passed in SkPaint! - GrAAType aaType = renderTargetContext->isStencilBufferMultisampled() && GrAA::kYes == runAA - ? GrAAType::kHW - : GrAAType::kNone; - GrPipelineBuilder pipelineBuilder(grPaint, aaType); + GrPipelineBuilder pipelineBuilder(grPaint); + pipelineBuilder.setState(GrPipelineBuilder::kHWAntialias_Flag, grPaint.isAntiAlias()); pipelineBuilder.setUserStencil(&kCoverPass); renderTargetContext->addDrawOp(pipelineBuilder, clip, batch.get()); diff --git a/src/gpu/text/GrStencilAndCoverTextContext.h b/src/gpu/text/GrStencilAndCoverTextContext.h index 1ba113b59b..f4773ffa5b 100644 --- a/src/gpu/text/GrStencilAndCoverTextContext.h +++ b/src/gpu/text/GrStencilAndCoverTextContext.h @@ -88,7 +88,7 @@ private: size_t computeSizeInCache() const; - GrAA isAntiAlias() const { return fFont.isAntiAlias() ? GrAA::kYes : GrAA::kNo; } + bool isAntiAlias() const { return fFont.isAntiAlias(); } private: typedef GrDrawPathRangeBatch::InstanceData InstanceData; |