Ensure that insetting for blur texture domain doesn't invert domain rect.

Bug: chromium:949422
Change-Id: I9046ee89f5cfb56fc25c50bd3b9bd617f07a3a73
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208514
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Brian Salomon 2019-04-16 13:20:08 -04:00 committed by Skia Commit-Bot
parent 393981d1db
commit 30182b482b

View File

@ -321,6 +321,13 @@ static sk_sp<GrTextureProxy> decimate(GrRecordingContext* context,
SkRect domain = SkRect::Make(*contentRect);
domain.inset((i < scaleFactorX) ? SK_ScalarHalf + SK_ScalarNearlyZero : 0.0f,
(i < scaleFactorY) ? SK_ScalarHalf + SK_ScalarNearlyZero : 0.0f);
// Ensure that the insetting doesn't invert the domain rectangle.
if (domain.fRight < domain.fLeft) {
domain.fLeft = domain.fRight = SkScalarAve(domain.fLeft, domain.fRight);
}
if (domain.fBottom < domain.fTop) {
domain.fTop = domain.fBottom = SkScalarAve(domain.fTop, domain.fBottom);
}
auto fp = GrTextureDomainEffect::Make(std::move(src),
SkMatrix::I(),
domain,