diff options
author | Robert Phillips <robertphillips@google.com> | 2018-07-10 10:11:01 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-10 15:01:11 +0000 |
commit | c100d48e4241ecc7be0fd7fd79eae13e13f255c0 (patch) | |
tree | 9964c8f11311271d21748fd69ed04cc3f11542a7 /src/gpu | |
parent | 45e27c8eed8f1673efebcb6cb2c03b8644c9c7a5 (diff) |
Expand testing of SkMatrix::decomposeScale
Bug: skia:7211
Change-Id: If03ad1d364b33e174d91010ca250cd6c2d2f67c2
Reviewed-on: https://skia-review.googlesource.com/140185
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index ffe237f803..f031e5edf1 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1058,23 +1058,26 @@ void SkGpuDevice::drawSprite(const SkBitmap& bitmap, } -void SkGpuDevice::drawSpecial(SkSpecialImage* special1, int left, int top, const SkPaint& paint, +void SkGpuDevice::drawSpecial(SkSpecialImage* special, int left, int top, const SkPaint& paint, SkImage* clipImage, const SkMatrix& clipMatrix) { ASSERT_SINGLE_OWNER GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawSpecial", fContext.get()); // TODO: clipImage support. - SkIPoint offset = { 0, 0 }; - sk_sp<SkSpecialImage> result; if (paint.getImageFilter()) { - result = this->filterTexture(special1, left, top, &offset, paint.getImageFilter()); + SkIPoint offset = { 0, 0 }; + + result = this->filterTexture(special, left, top, &offset, paint.getImageFilter()); if (!result) { return; } + + left += offset.fX; + top += offset.fY; } else { - result = sk_ref_sp(special1); + result = sk_ref_sp(special); } SkASSERT(result->isTextureBacked()); @@ -1088,7 +1091,7 @@ void SkGpuDevice::drawSpecial(SkSpecialImage* special1, int left, int top, const SkPaint tmpUnfiltered(paint); if (tmpUnfiltered.getMaskFilter()) { SkMatrix ctm = this->ctm(); - ctm.postTranslate(-SkIntToScalar(left + offset.fX), -SkIntToScalar(top + offset.fY)); + ctm.postTranslate(-SkIntToScalar(left), -SkIntToScalar(top)); tmpUnfiltered.setMaskFilter(tmpUnfiltered.getMaskFilter()->makeWithMatrix(ctm)); } @@ -1116,8 +1119,7 @@ void SkGpuDevice::drawSpecial(SkSpecialImage* special1, int left, int top, const std::move(grPaint), GrAA(tmpUnfiltered.isAntiAlias()), SkMatrix::I(), - SkRect::Make(SkIRect::MakeXYWH(left + offset.fX, top + offset.fY, subset.width(), - subset.height())), + SkRect::Make(SkIRect::MakeXYWH(left, top, subset.width(), subset.height())), SkRect::Make(subset)); } |