Skip to content

Commit

Permalink
Remove unnecessary parameter in blur mask code
Browse files Browse the repository at this point in the history
Found this was investigating another change. margin is an output
parameter, but since the result is not used after, we can save
a copy operation by passing in nullptr.

Note we *do* need margin in the earlier calls in these functions
to establish how much to expand the mask when blurring.

Change-Id: I4290fe14ee8e5afae1f23a77a67a4951dbb4b13e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/952217
Commit-Queue: Daniel Dilan <[email protected]>
Auto-Submit: Kaylee Lubick <[email protected]>
Reviewed-by: Daniel Dilan <[email protected]>
  • Loading branch information
kjlubick authored and SkCQ committed Feb 14, 2025
1 parent 2092430 commit 13a3b6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/SkBlurMaskFilterImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ SkBlurMaskFilterImpl::filterRRectToNine(const SkRRect& rrect, const SkMatrix& ma
}
SkAutoMaskFreeImage amf(srcM.image());
SkMaskBuilder filterM;
if (!this->filterMask(&filterM, srcM, matrix, &margin)) {
if (!this->filterMask(&filterM, srcM, matrix, nullptr)) {
return std::nullopt;
}
cache = add_cached_rrect(&filterM, sigma, fBlurStyle, smallRR);
Expand Down Expand Up @@ -450,11 +450,11 @@ SkBlurMaskFilterImpl::filterRectsToNine(const SkRect rects[], int count,

SkAutoMaskFreeImage amf(srcM.image());

if (!this->filterMask(&filterM, srcM, matrix, &margin)) {
if (!this->filterMask(&filterM, srcM, matrix, nullptr)) {
return FilterReturn::kFalse;
}
} else {
if (!this->filterRectMask(&filterM, smallR[0], matrix, &margin,
if (!this->filterRectMask(&filterM, smallR[0], matrix, nullptr,
SkMaskBuilder::kComputeBoundsAndRenderImage_CreateMode)) {
return FilterReturn::kFalse;
}
Expand Down

0 comments on commit 13a3b6f

Please sign in to comment.