diff options
author | Brian Salomon <bsalomon@google.com> | 2018-01-11 11:46:21 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-11 19:37:51 +0000 |
commit | b5ef1f9b13e36a427dd6350986d41db208b2df1b (patch) | |
tree | f3feab5dbea98e9daa160230eff92b63c56e4475 /src/gpu/SkGpuDevice_drawTexture.cpp | |
parent | ac47b88d3c4b6232ea8664cea99fbd8394f2dc38 (diff) |
Make GrTextureOp capable of edge antialiasing.
Bug: skia:
Change-Id: I0088bdbb6a76811611fa4628656bf9513c5bf04a
Reviewed-on: https://skia-review.googlesource.com/91105
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/SkGpuDevice_drawTexture.cpp')
-rw-r--r-- | src/gpu/SkGpuDevice_drawTexture.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gpu/SkGpuDevice_drawTexture.cpp b/src/gpu/SkGpuDevice_drawTexture.cpp index bedd292a58..f8e5f74311 100644 --- a/src/gpu/SkGpuDevice_drawTexture.cpp +++ b/src/gpu/SkGpuDevice_drawTexture.cpp @@ -94,14 +94,13 @@ static bool can_ignore_bilerp_constraint(const GrTextureProducer& producer, static bool can_use_draw_texture_affine(const SkPaint& paint, const SkMatrix& ctm, SkCanvas::SrcRectConstraint constraint) { return (!paint.getColorFilter() && !paint.getShader() && !paint.getMaskFilter() && - !paint.getImageFilter() && !paint.isAntiAlias() && - paint.getFilterQuality() < kMedium_SkFilterQuality && + !paint.getImageFilter() && paint.getFilterQuality() < kMedium_SkFilterQuality && paint.getBlendMode() == SkBlendMode::kSrcOver && !ctm.hasPerspective() && SkCanvas::kFast_SrcRectConstraint == constraint); } static void draw_texture_affine(const SkPaint& paint, const SkMatrix& ctm, const SkRect* src, - const SkRect* dst, sk_sp<GrTextureProxy> proxy, + const SkRect* dst, GrAA aa, sk_sp<GrTextureProxy> proxy, SkColorSpace* colorSpace, const GrClip& clip, GrRenderTargetContext* rtc) { SkASSERT(!(SkToBool(src) && !SkToBool(dst))); @@ -131,7 +130,7 @@ static void draw_texture_affine(const SkPaint& paint, const SkMatrix& ctm, const GrColor color = GrPixelConfigIsAlphaOnly(proxy->config()) ? SkColorToPremulGrColor(paint.getColor()) : SkColorAlphaToGrColor(paint.getColor()); - rtc->drawTextureAffine(clip, std::move(proxy), filter, color, srcRect, dstRect, ctm, + rtc->drawTextureAffine(clip, std::move(proxy), filter, color, srcRect, dstRect, aa, ctm, std::move(csxf)); } @@ -143,8 +142,8 @@ void SkGpuDevice::drawPinnedTextureProxy(sk_sp<GrTextureProxy> proxy, uint32_t p SkCanvas::SrcRectConstraint constraint, const SkMatrix& viewMatrix, const SkPaint& paint) { if (can_use_draw_texture_affine(paint, this->ctm(), constraint)) { - draw_texture_affine(paint, viewMatrix, srcRect, dstRect, std::move(proxy), colorSpace, - this->clip(), fRenderTargetContext.get()); + draw_texture_affine(paint, viewMatrix, srcRect, dstRect, GrAA(paint.isAntiAlias()), + std::move(proxy), colorSpace, this->clip(), fRenderTargetContext.get()); return; } GrTextureAdjuster adjuster(this->context(), std::move(proxy), alphaType, pinnedUniqueID, @@ -166,8 +165,8 @@ void SkGpuDevice::drawTextureMaker(GrTextureMaker* maker, int imageW, int imageH if (!proxy) { return; } - draw_texture_affine(paint, viewMatrix, srcRect, dstRect, std::move(proxy), cs.get(), - this->clip(), fRenderTargetContext.get()); + draw_texture_affine(paint, viewMatrix, srcRect, dstRect, GrAA(paint.isAntiAlias()), + std::move(proxy), cs.get(), this->clip(), fRenderTargetContext.get()); return; } this->drawTextureProducer(maker, srcRect, dstRect, constraint, viewMatrix, paint); |