Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1292)

Unified Diff: third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp

Issue 2585233002: Clamp radii in FEMorphology::createImageFilter (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp b/third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp
index 9be12c2b3223a5207859eec7e0409cb23406b980..bf50630f531b1706c6677c8f704d8bd46e8407e3 100644
--- a/third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp
+++ b/third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp
@@ -92,10 +92,8 @@ FloatRect FEMorphology::mapEffect(const FloatRect& rect) const {
sk_sp<SkImageFilter> FEMorphology::createImageFilter() {
sk_sp<SkImageFilter> input(
SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace()));
- SkScalar radiusX =
- SkFloatToScalar(getFilter()->applyHorizontalScale(m_radiusX));
- SkScalar radiusY =
- SkFloatToScalar(getFilter()->applyVerticalScale(m_radiusY));
+ int radiusX = clampTo<int>(getFilter()->applyHorizontalScale(m_radiusX));
+ int radiusY = clampTo<int>(getFilter()->applyVerticalScale(m_radiusY));
Stephen Chennney 2016/12/19 14:21:14 Does clampTo<SkScalar> work?
fs 2016/12/19 14:24:00 SkScalar is typedef'd to float (or double, but I t
SkImageFilter::CropRect rect = getCropRect();
if (m_type == FEMORPHOLOGY_OPERATOR_DILATE)
return SkDilateImageFilter::Make(radiusX, radiusY, std::move(input), &rect);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698