Add rect clip optimization to GrRenderTargetContext::drawTextureAffine

Bug: skia:
Change-Id: Ibca6bdf9dc72a2b1579a5eb4c22d30e32b964f83
Reviewed-on: https://skia-review.googlesource.com/40803
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Brian Salomon 2017-08-30 10:27:49 -04:00 committed by Skia Commit-Bot
parent 643627e242
commit ff9d6d3bc2

View File

@ -791,9 +791,17 @@ void GrRenderTargetContext::drawTextureAffine(const GrClip& clip, sk_sp<GrTextur
if (filter != GrSamplerParams::kNone_FilterMode && !must_filter(srcRect, dstRect, viewMatrix)) {
filter = GrSamplerParams::kNone_FilterMode;
}
SkRect clippedDstRect = dstRect;
SkRect clippedSrcRect = srcRect;
if (!crop_filled_rect(this->width(), this->height(), clip, viewMatrix, &clippedDstRect,
&clippedSrcRect)) {
return;
}
bool allowSRGB = SkToBool(this->getColorSpace());
this->addDrawOp(clip, GrTextureOp::Make(std::move(proxy), filter, color, srcRect, dstRect,
viewMatrix, std::move(colorSpaceXform), allowSRGB));
this->addDrawOp(clip, GrTextureOp::Make(std::move(proxy), filter, color, clippedSrcRect,
clippedDstRect, viewMatrix, std::move(colorSpaceXform),
allowSRGB));
}
void GrRenderTargetContext::fillRectWithLocalMatrix(const GrClip& clip,