aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/SkImageFilter.cpp4
-rw-r--r--src/effects/SkMorphologyImageFilter.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 015b77c42c..2a898fda14 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -425,8 +425,8 @@ sk_sp<SkSpecialImage> SkImageFilter::applyCropRect(const Context& ctx,
} else {
sk_sp<SkSpecialImage> img(pad_image(src, ctx.outputProperties(),
bounds->width(), bounds->height(),
- srcOffset->x() - bounds->x(),
- srcOffset->y() - bounds->y()));
+ Sk32_sat_sub(srcOffset->x(), bounds->x()),
+ Sk32_sat_sub(srcOffset->y(), bounds->y())));
*srcOffset = SkIPoint::Make(bounds->x(), bounds->y());
return img;
}
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 9b81b45a6f..6ee409ef06 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -457,7 +457,7 @@ static void apply_morphology_pass(GrRenderTargetContext* renderTargetContext,
middleSrcRect.inset(0, radius);
middleDstRect.inset(0, radius);
}
- if (middleSrcRect.fLeft - middleSrcRect.fRight >= 0) {
+ if (middleSrcRect.width() <= 0) {
// radius covers srcRect; use bounds over entire draw
apply_morphology_rect(renderTargetContext, clip, std::move(textureProxy),
srcRect, dstRect, radius, morphType, bounds, direction);