bug 1270795 - do not generate any background items in glyph path generating process; r=jfkthame a=lizzard
authorCJKu <cku@mozilla.com>
Sat, 07 May 2016 00:47:01 +0800
changeset 332863 96622c844cdaf613297ed44b436671b50ae567d3
parent 332862 689961723fc8f0b7954c7c33dfc99d6a30ce3cfa
child 332864 eb377e675575f0e057feb291d700277d9ac95c93
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame, lizzard
bugs1270795
milestone48.0a2
bug 1270795 - do not generate any background items in glyph path generating process; r=jfkthame a=lizzard MozReview-Commit-ID: GbhxyY93Vur
layout/base/nsDisplayList.cpp
layout/generic/nsFrame.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -2403,16 +2403,20 @@ SetBackgroundClipRegion(DisplayListClipS
 }
 
 
 /*static*/ bool
 nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuilder,
                                                      nsIFrame* aFrame,
                                                      nsDisplayList* aList)
 {
+  if (aBuilder->IsForGenerateGlyphPath()) {
+    return true;
+  }
+
   nsStyleContext* bgSC = nullptr;
   const nsStyleBackground* bg = nullptr;
   nsPresContext* presContext = aFrame->PresContext();
   bool isThemed = aFrame->IsThemed();
   if (!isThemed) {
     bgSC = GetBackgroundStyleContext(aFrame);
     if (bgSC) {
       bg = bgSC->StyleBackground();
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -1887,20 +1887,16 @@ nsFrame::DisplayBorderBackgroundOutline(
 {
   // The visibility check belongs here since child elements have the
   // opportunity to override the visibility property and display even if
   // their parent is hidden.
   if (!IsVisibleForPainting(aBuilder)) {
     return;
   }
 
-  if (aBuilder->IsForGenerateGlyphPath()) {
-    return;
-  }
-
   nsCSSShadowArray* shadows = StyleEffects()->mBoxShadow;
   if (shadows && shadows->HasShadowWithInset(false)) {
     aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
       nsDisplayBoxShadowOuter(aBuilder, this));
   }
 
   bool bgIsThemed = DisplayBackgroundUnconditional(aBuilder, aLists,
                                                    aForceBackground);