From f09abc58ad0ae3c7545ae5a77fdec1325ceb9c84 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Wed, 3 Oct 2018 15:59:04 -0400 Subject: [PATCH] Always turn off domain in GrTextureOp for no-aa/nearest Fixes an issue on Mali-400 where fragment shader domain check causes precision loss of texture coords even when vertex texture coords are inside the domain. Change-Id: I3e1ea2c7ee7a73a0c1e8df76421afa432f986b88 Reviewed-on: https://skia-review.googlesource.com/c/159324 Reviewed-by: Robert Phillips Commit-Queue: Brian Salomon --- src/gpu/ops/GrTextureOp.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gpu/ops/GrTextureOp.cpp b/src/gpu/ops/GrTextureOp.cpp index a5c051d9ef..4f49cea272 100644 --- a/src/gpu/ops/GrTextureOp.cpp +++ b/src/gpu/ops/GrTextureOp.cpp @@ -696,15 +696,17 @@ private: if (GrAAType::kCoverage == this->aaType()) { fAAType = static_cast(GrAAType::kNone); aaFlags = GrQuadAAFlags::kNone; - // We may have had a strict constraint with nearest filter solely due to - // possible AA bloat. In that case it's no longer necessary. - if (constraint == SkCanvas::kStrict_SrcRectConstraint && - fFilter == GrSamplerState::Filter::kNearest) { - constraint = SkCanvas::kFast_SrcRectConstraint; - } } } } + // We may have had a strict constraint with nearest filter solely due to possible AA bloat. + // If we don't have (or determined we don't need) coverage AA then we can skip using a + // domain. + if (constraint == SkCanvas::kStrict_SrcRectConstraint && + fFilter == GrSamplerState::Filter::kNearest && + this->aaType() != GrAAType::kCoverage) { + constraint = SkCanvas::kFast_SrcRectConstraint; + } const auto& draw = fDraws.emplace_back(srcRect, quad, aaFlags, constraint, color); this->setBounds(bounds, HasAABloat::kNo, IsZeroArea::kNo); fDomain = static_cast(draw.domain());