Bug 1435045 - Don't make CSS filters on the <svg> element use fallback. r=jrmuizel
authorMarkus Stange <mstange@themasta.com>
Wed, 22 Aug 2018 22:06:24 +0000
changeset 481280 d77ca862636da2f413aa0b3a6e98c11c45ecae15
parent 481279 867a77e99ab0d656c7e8f10f7d1d5950501e7535
child 481281 cd6a42517bb9e60c45b6441a986b53d8da7fb147
push id232
push userfmarier@mozilla.com
push dateWed, 05 Sep 2018 20:45:54 +0000
reviewersjrmuizel
bugs1435045
milestone63.0a1
Bug 1435045 - Don't make CSS filters on the <svg> element use fallback. r=jrmuizel Differential Revision: https://phabricator.services.mozilla.com/D4018
layout/painting/nsDisplayList.cpp
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -9655,23 +9655,18 @@ ClampStdDeviation(float aStdDeviation)
 
 bool
 nsDisplayFilter::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
                                          mozilla::wr::IpcResourceUpdateQueue& aResources,
                                          const StackingContextHelper& aSc,
                                          mozilla::layers::WebRenderLayerManager* aManager,
                                          nsDisplayListBuilder* aDisplayListBuilder)
 {
-  if (mFrame->IsFrameOfType(nsIFrame::eSVG)) {
-    return false;
-  }
-
-  // Due to differences in the way that WebRender filters operate
-  // only the brightness and contrast filters use that path. We
-  // can gradually enable more filters as WebRender bugs are fixed.
+  // All CSS filters are supported by WebRender. SVG filters are not supported,
+  // those use NS_STYLE_FILTER_URL.
   nsTArray<mozilla::wr::WrFilterOp> wrFilters;
   const nsTArray<nsStyleFilter>& filters = mFrame->StyleEffects()->mFilters;
   for (const nsStyleFilter& filter : filters) {
     switch (filter.GetType()) {
       case NS_STYLE_FILTER_BRIGHTNESS:
       case NS_STYLE_FILTER_CONTRAST:
       case NS_STYLE_FILTER_GRAYSCALE:
       case NS_STYLE_FILTER_INVERT: