Bug 1346982 - Fix static bustage and backwards condition r=me
authorRyan Hunt <rhunt@eqrion.net>
Tue, 14 Mar 2017 02:28:06 -0400
changeset 349158 eaa70038e3f08908ab0f6e19507c66002c02f730
parent 349157 569c7a783e9602532b359d379d078e62fc723e76
child 349159 142aa7bf0a842f98f6bb811fcc8ad0e557b799a9
push id31546
push userkwierso@gmail.com
push dateThu, 23 Mar 2017 17:37:25 +0000
treeherdermozilla-central@200182ef1156 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1346982
milestone55.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 1346982 - Fix static bustage and backwards condition r=me
layout/painting/nsDisplayList.cpp
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -4949,36 +4949,33 @@ nsDisplayBoxShadowOuter::BuildLayer(nsDi
 
 bool
 nsDisplayBoxShadowOuter::CanBuildWebRenderDisplayItems()
 {
   bool hasBorderRadius;
   nsCSSRendering::HasBoxShadowNativeTheme(mFrame, hasBorderRadius);
   nsCSSShadowArray* shadows = mFrame->StyleEffects()->mBoxShadow;
 
-  return !shadows && !hasBorderRadius;
+  return shadows && !hasBorderRadius;
 }
 
 void
 nsDisplayBoxShadowOuter::CreateWebRenderCommands(wr::DisplayListBuilder& aBuilder,
                                                  nsTArray<WebRenderParentCommand>& aParentCommands,
                                                  WebRenderDisplayItemLayer* aLayer)
 {
   int32_t appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
   nsPoint offset = ToReferenceFrame();
   nsRect borderRect = mFrame->VisualBorderRectRelativeToSelf() + offset;
   //nsPresContext* presContext = mFrame->PresContext();
   AutoTArray<nsRect,10> rects;
   nsRegion visible = aLayer->GetVisibleRegion().ToAppUnits(appUnitsPerDevPixel);
 
   ComputeDisjointRectangles(visible, &rects);
 
-  nsCSSShadowArray* shadows = mFrame->StyleEffects()->mBoxShadow;
-  MOZ_ASSERT(shadows);
-
   bool hasBorderRadius;
   bool nativeTheme = nsCSSRendering::HasBoxShadowNativeTheme(mFrame,
                                                              hasBorderRadius);
 
   // Don't need the full size of the shadow rect like we do in
   // nsCSSRendering since WR takes care of calculations for blur
   // and spread radius.
   nsRect shadowRect = nsCSSRendering::GetShadowRect(borderRect,
@@ -4993,16 +4990,17 @@ nsDisplayBoxShadowOuter::CreateWebRender
                                                      borderRadii);
     MOZ_ASSERT(borderRadii.AreRadiiSame());
   }
 
   // Everything here is in app units, change to device units.
   for (uint32_t i = 0; i < rects.Length(); ++i) {
     Rect clipRect = NSRectToRect(rects[i], appUnitsPerDevPixel);
     nsCSSShadowArray* shadows = mFrame->StyleEffects()->mBoxShadow;
+    MOZ_ASSERT(shadows);
 
     for (uint32_t j = shadows->Length(); j  > 0; j--) {
       nsCSSShadowItem* shadow = shadows->ShadowAt(j - 1);
 
       gfx::Color shadowColor = nsCSSRendering::GetShadowColor(shadow,
                                                               mFrame,
                                                               mOpacity);
       shadowRect.MoveBy(shadow->mXOffset, shadow->mYOffset);