Bug 1618000: Part 1: Remove blur radius clamping on Gecko-side for WR blur filters r=gfx-reviewers,nical
authorcbrewster <connorbrewster@yahoo.com>
Wed, 25 Mar 2020 23:57:53 +0000
changeset 520456 077c46d3381cf29fe0adb9fac2caceff4b7df676
parent 520455 8d8c518d568511fabadfb52c813bbadd0e448c67
child 520457 3feaf53352b86d01b4d5b2dfb667d17e4fc4d8e8
push id37251
push usermalexandru@mozilla.com
push dateThu, 26 Mar 2020 09:33:08 +0000
treeherdermozilla-central@3e5a7430c8d7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfx-reviewers, nical
bugs1618000
milestone76.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1618000: Part 1: Remove blur radius clamping on Gecko-side for WR blur filters r=gfx-reviewers,nical Clamping of the blur radius depends on transform scale factors. This info is not available until later in the WebRender pipeline, so we need to delegate blur radius clamping to WebRender. Differential Revision: https://phabricator.services.mozilla.com/D65804
layout/svg/nsSVGIntegrationUtils.cpp
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -1102,21 +1102,16 @@ void nsSVGIntegrationUtils::PaintFilter(
   RegularFramePaintCallback callback(aParams.builder, aParams.layerManager,
                                      offsets.offsetToUserSpaceInDevPx);
   nsRegion dirtyRegion = aParams.dirtyRect - offsets.offsetToBoundingBox;
 
   nsFilterInstance::PaintFilteredFrame(frame, &context, &callback, &dirtyRegion,
                                        aParams.imgParams, opacity);
 }
 
-static float ClampStdDeviation(float aStdDeviation) {
-  // Cap software blur radius for performance reasons.
-  return std::min(std::max(0.0f, aStdDeviation), 100.0f);
-}
-
 bool nsSVGIntegrationUtils::CreateWebRenderCSSFilters(
     Span<const StyleFilter> aFilters, nsIFrame* aFrame,
     WrFiltersHolder& aWrFilters) {
   // All CSS filters are supported by WebRender. SVG filters are not fully
   // supported, those use NS_STYLE_FILTER_URL and are handled separately.
 
   // If there are too many filters to render, then just pretend that we
   // succeeded, and don't render any of them.
@@ -1157,19 +1152,19 @@ bool nsSVGIntegrationUtils::CreateWebRen
         wrFilters.AppendElement(
             wr::FilterOp::HueRotate(filter.AsHueRotate().ToDegrees()));
         break;
       }
       case StyleFilter::Tag::Blur: {
         // TODO(emilio): we should go directly from css pixels -> device pixels.
         float appUnitsPerDevPixel =
             aFrame->PresContext()->AppUnitsPerDevPixel();
-        wrFilters.AppendElement(mozilla::wr::FilterOp::Blur(
-            ClampStdDeviation(NSAppUnitsToFloatPixels(
-                filter.AsBlur().ToAppUnits(), appUnitsPerDevPixel))));
+        wrFilters.AppendElement(
+            mozilla::wr::FilterOp::Blur(NSAppUnitsToFloatPixels(
+                filter.AsBlur().ToAppUnits(), appUnitsPerDevPixel)));
         break;
       }
       case StyleFilter::Tag::DropShadow: {
         float appUnitsPerDevPixel =
             aFrame->PresContext()->AppUnitsPerDevPixel();
         const StyleSimpleShadow& shadow = filter.AsDropShadow();
         nscolor color = shadow.color.CalcColor(aFrame);