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 321139 d7b395cc7601d6f2659dbc925cb22090f4a1e68c
parent 321138 3e58e4842984a487b07aad295e15e70cb7443b46
child 321140 7865878fa033018bc4ba8145a5417919505509e2
push id9671
push userraliiev@mozilla.com
push dateMon, 06 Jun 2016 20:27:52 +0000
treeherdermozilla-aurora@cea65ca3d0bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1270795
milestone49.0a1
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);