diff options
author | Brian Salomon <bsalomon@google.com> | 2018-05-29 16:42:30 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-05-29 16:42:36 +0000 |
commit | 36be574e7bd5eb8bb41e2a0a15085e27b340cf4d (patch) | |
tree | 804d0b58fecb26675a3a4cacb1af0f21afc48b7e /src/gpu/ops | |
parent | 97918ff4ae2fbbfbd621491a2ed73bcac9e487f4 (diff) |
Revert "Make GrTextureOp disable coverage AA when rect falls on integers."
This reverts commit ca439a0a0afca8ad20c724cc837ce7dbc67e1277.
Reason for revert: layout tests :(
Original change's description:
> Make GrTextureOp disable coverage AA when rect falls on integers.
>
> Change-Id: Iaf5e8d154cc9108adcd8294812cecae7b4f01a5d
> Reviewed-on: https://skia-review.googlesource.com/130148
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: Iac6bdc19ed16ebbee27a7601086c305490d44a50
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/130521
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/ops')
-rw-r--r-- | src/gpu/ops/GrTextureOp.cpp | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/src/gpu/ops/GrTextureOp.cpp b/src/gpu/ops/GrTextureOp.cpp index 7c24ce5064..5724050234 100644 --- a/src/gpu/ops/GrTextureOp.cpp +++ b/src/gpu/ops/GrTextureOp.cpp @@ -709,26 +709,15 @@ __attribute__((no_sanitize("float-cast-overflow"))) , fFinalized(0) , fAllowSRGBInputs(allowSRGBInputs ? 1 : 0) { SkASSERT(aaType != GrAAType::kMixedSamples); + + const Draw& draw = fDraws.emplace_back(srcRect, 0, GrPerspQuad(dstRect, viewMatrix), + constraint, color); fPerspective = viewMatrix.hasPerspective(); - auto quad = GrPerspQuad(dstRect, viewMatrix); - auto bounds = quad.bounds(); - if (GrAAType::kCoverage == this->aaType() && viewMatrix.rectStaysRect()) { - // Disable coverage AA when rect falls on integers in device space. - auto is_int = [](float f) { return f == sk_float_floor(f); }; - if (is_int(bounds.fLeft) && is_int(bounds.fTop) && is_int(bounds.fRight) && - is_int(bounds.fBottom)) { - fAAType = static_cast<unsigned>(GrAAType::kNone); - // We may have had a strict constraint with nearest filter soley due to possible AA - // bloat. In that case it's no longer necessary. - if (constraint == SkCanvas::kStrict_SrcRectConstraint && - filter == GrSamplerState::Filter::kNearest) { - constraint = SkCanvas::kFast_SrcRectConstraint; - } - } - } - const auto& draw = fDraws.emplace_back(srcRect, 0, quad, constraint, color); + fDomain = (bool)draw.domain(); + SkRect bounds; + bounds = draw.quad().bounds(); this->setBounds(bounds, HasAABloat::kNo, IsZeroArea::kNo); - fDomain = static_cast<bool>(draw.domain()); + fMaxApproxDstPixelArea = RectSizeAsSizeT(bounds); } |