bug 1270795 - do not generate any background items in glyph path generating process; r=jfkthame
authorCJKu <cku@mozilla.com>
Sat, 07 May 2016 00:47:01 +0800
changeset 296628 d7b395cc7601d6f2659dbc925cb22090f4a1e68c
parent 296627 3e58e4842984a487b07aad295e15e70cb7443b46
child 296629 7865878fa033018bc4ba8145a5417919505509e2
push id76415
push usercku@mozilla.com
push dateMon, 09 May 2016 15:23:32 +0000
treeherdermozilla-inbound@7865878fa033 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1270795
milestone49.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 1270795 - do not generate any background items in glyph path generating process; r=jfkthame MozReview-Commit-ID: GbhxyY93Vur
layout/base/nsDisplayList.cpp
layout/generic/nsFrame.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -2401,16 +2401,20 @@ SetBackgroundClipRegion(DisplayListClipS
 
 /*static*/ bool
 nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuilder,
                                                      nsIFrame* aFrame,
                                                      const nsRect& aBackgroundRect,
                                                      nsDisplayList* aList,
                                                      bool aAllowWillPaintBorderOptimization)
 {
+  if (aBuilder->IsForGenerateGlyphPath()) {
+    return true;
+  }
+
   nsStyleContext* bgSC = nullptr;
   const nsStyleBackground* bg = nullptr;
   nsRect bgRect = aBackgroundRect + aBuilder->ToReferenceFrame(aFrame);
   nsPresContext* presContext = aFrame->PresContext();
   bool isThemed = aFrame->IsThemed();
   if (!isThemed) {
     bgSC = GetBackgroundStyleContext(aFrame);
     if (bgSC) {
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -1885,20 +1885,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);