Bug 1281428 - Don't skip paint painting SVG effects due to 0 opacity if the opacity is being handled by a separate item. r=jwatt
authorMatt Woodrow <mwoodrow@mozilla.com>
Fri, 29 Jul 2016 17:58:15 +1200
changeset 307140 2bd88c9c8068fbfa09e34fd1395baf435fc69b3e
parent 307139 0d0a2960686a335eb09de6edbe1dfe573e212701
child 307141 24fc0e07876b0b0f3c3ff718a50366d89c6aac49
push id80044
push usermwoodrow@mozilla.com
push dateFri, 29 Jul 2016 05:59:21 +0000
treeherdermozilla-inbound@09874746f3e0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs1281428
milestone50.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 1281428 - Don't skip paint painting SVG effects due to 0 opacity if the opacity is being handled by a separate item. r=jwatt
layout/base/nsDisplayList.cpp
layout/svg/nsSVGIntegrationUtils.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -6729,18 +6729,18 @@ nsDisplaySVGEffects::BuildLayer(nsDispla
       NS_ASSERTION(false, "why?");
       return nullptr;
     }
     if (!static_cast<const nsSVGElement*>(content)->HasValidDimensions()) {
       return nullptr; // The SVG spec says not to draw filters for this
     }
   }
 
-  float opacity = mFrame->StyleEffects()->mOpacity;
-  if (opacity == 0.0f)
+  if (mFrame->StyleEffects()->mOpacity == 0.0f &&
+      !mOpacityItemCreated)
     return nullptr;
 
   nsIFrame* firstFrame =
     nsLayoutUtils::FirstContinuationOrIBSplitSibling(mFrame);
   nsSVGEffects::EffectProperties effectProperties =
     nsSVGEffects::GetEffectProperties(firstFrame);
 
   bool isOK = effectProperties.HasNoFilterOrHasValidFilter();
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -628,24 +628,24 @@ nsSVGIntegrationUtils::PaintFramesWithEf
       return DrawResult::BAD_ARGS;
     }
     if (!static_cast<const nsSVGElement*>(content)->HasValidDimensions()) {
       return DrawResult::SUCCESS; // The SVG spec says not to draw _anything_
     }
   }
 
   float opacity = frame->StyleEffects()->mOpacity;
-  if (opacity == 0.0f) {
-    return DrawResult::SUCCESS;
-  }
   if (opacity != 1.0f &&
       (nsSVGUtils::CanOptimizeOpacity(frame) ||
        aParams.callerPaintsOpacity)) {
     opacity = 1.0f;
   }
+  if (opacity == 0.0f) {
+    return DrawResult::SUCCESS;
+  }
   MOZ_ASSERT(!nsSVGUtils::CanOptimizeOpacity(frame) || !aParams.callerPaintsOpacity,
              "How can we be optimizing the opacity into the svg as well as having the caller paint it?");
 
   /* Properties are added lazily and may have been removed by a restyle,
      so make sure all applicable ones are set again. */
   nsIFrame* firstFrame =
     nsLayoutUtils::FirstContinuationOrIBSplitSibling(frame);
   nsSVGEffects::EffectProperties effectProperties =