aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrRenderTargetContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrRenderTargetContext.cpp')
-rw-r--r--src/gpu/GrRenderTargetContext.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index 14fa6fb2ef..9d8f69fbbc 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -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,