Backed out changeset a44640701558 (bug 1323912)
authorIris Hsiao <ihsiao@mozilla.com>
Wed, 04 Jan 2017 21:47:16 -0500
changeset 327975 cb00b7bdead87d1da7b33e69e38a52acada3da81
parent 327974 7a3238ae0f8f8d3ae498725350fb6fcb5bb1ac8c
child 328024 f39d44b3c6f4da5e4c6c7d2d22dbef545af40518
push id35647
push userihsiao@mozilla.com
push dateThu, 05 Jan 2017 02:47:27 +0000
treeherderautoland@cb00b7bdead8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1323912
milestone53.0a1
backs outa446407015581697b803ec2170d2c892787e05c3
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
Backed out changeset a44640701558 (bug 1323912)
layout/painting/nsCSSRendering.cpp
layout/painting/nsCSSRendering.h
layout/painting/nsDisplayList.cpp
layout/svg/nsSVGIntegrationUtils.cpp
layout/tables/nsTableCellFrame.cpp
layout/tables/nsTablePainter.cpp
layout/xul/tree/nsTreeBodyFrame.cpp
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -1803,17 +1803,17 @@ nsCSSRendering::PaintBGParams::ForSingle
 
   PaintBGParams result(aPresCtx, aRenderingCtx, aDirtyRect, aBorderArea, aFrame,
     aPaintFlags, aLayer, aCompositionOp);
 
   return result;
 }
 
 DrawResult
-nsCSSRendering::PaintStyleImageLayer(const PaintBGParams& aParams)
+nsCSSRendering::PaintBackground(const PaintBGParams& aParams)
 {
   PROFILER_LABEL("nsCSSRendering", "PaintBackground",
     js::ProfileEntry::Category::GRAPHICS);
 
   NS_PRECONDITION(aParams.frame,
                   "Frame is expected to be provided to PaintBackground");
 
   nsStyleContext *sc;
@@ -1830,17 +1830,17 @@ nsCSSRendering::PaintStyleImageLayer(con
     nsIContent* content = aParams.frame->GetContent();
     if (!content || content->GetParent()) {
       return DrawResult::SUCCESS;
     }
 
     sc = aParams.frame->StyleContext();
   }
 
-  return PaintStyleImageLayerWithSC(aParams, sc, *aParams.frame->StyleBorder());
+  return PaintBackgroundWithSC(aParams, sc, *aParams.frame->StyleBorder());
 }
 
 static bool
 IsOpaqueBorderEdge(const nsStyleBorder& aBorder, mozilla::Side aSide)
 {
   if (aBorder.GetComputedBorder().Side(aSide) == 0)
     return true;
   switch (aBorder.GetBorderStyle(aSide)) {
@@ -3238,19 +3238,19 @@ DetermineCompositionOp(const nsCSSRender
 
     return nsCSSRendering::GetGFXCompositeMode(layer.mComposite);
   }
 
   return nsCSSRendering::GetGFXBlendMode(layer.mBlendMode);
 }
 
 DrawResult
-nsCSSRendering::PaintStyleImageLayerWithSC(const PaintBGParams& aParams,
-                                           nsStyleContext *aBackgroundSC,
-                                           const nsStyleBorder& aBorder)
+nsCSSRendering::PaintBackgroundWithSC(const PaintBGParams& aParams,
+                                      nsStyleContext *aBackgroundSC,
+                                      const nsStyleBorder& aBorder)
 {
   NS_PRECONDITION(aParams.frame,
                   "Frame is expected to be provided to PaintBackground");
 
   // If we're drawing all layers, aCompositonOp is ignored, so make sure that
   // it was left at its default value.
   MOZ_ASSERT_IF(aParams.layer == -1,
                 aParams.compositionOp == CompositionOp::OP_OVER);
@@ -3443,22 +3443,22 @@ nsCSSRendering::PaintStyleImageLayerWith
           if (co != CompositionOp::OP_OVER) {
             NS_ASSERTION(ctx->CurrentOp() == CompositionOp::OP_OVER,
                          "It is assumed the initial op is OP_OVER, when it is "
                          "restored later");
             ctx->SetOp(co);
           }
 
           result &=
-            state.mImageRenderer.DrawLayer(&aParams.presCtx,
-                                           aParams.renderingCtx,
-                                           state.mDestArea, state.mFillArea,
-                                           state.mAnchor + paintBorderArea.TopLeft(),
-                                           clipState.mDirtyRect,
-                                           state.mRepeatSize);
+            state.mImageRenderer.DrawBackground(&aParams.presCtx,
+                                                aParams.renderingCtx,
+                                                state.mDestArea, state.mFillArea,
+                                                state.mAnchor + paintBorderArea.TopLeft(),
+                                                clipState.mDirtyRect,
+                                                state.mRepeatSize);
 
           if (co != CompositionOp::OP_OVER) {
             ctx->SetOp(CompositionOp::OP_OVER);
           }
         }
       }
     }
   }
@@ -5781,23 +5781,23 @@ nsImageRenderer::DrawableForElement(cons
   NS_ASSERTION(mImageElementSurface.GetSourceSurface(), "Surface should be ready.");
   RefPtr<gfxDrawable> drawable = new gfxSurfaceDrawable(
                                 mImageElementSurface.GetSourceSurface().get(),
                                 mImageElementSurface.mSize);
   return drawable.forget();
 }
 
 DrawResult
-nsImageRenderer::DrawLayer(nsPresContext*       aPresContext,
-                           nsRenderingContext&  aRenderingContext,
-                           const nsRect&        aDest,
-                           const nsRect&        aFill,
-                           const nsPoint&       aAnchor,
-                           const nsRect&        aDirty,
-                           const nsSize&        aRepeatSize)
+nsImageRenderer::DrawBackground(nsPresContext*       aPresContext,
+                                nsRenderingContext&  aRenderingContext,
+                                const nsRect&        aDest,
+                                const nsRect&        aFill,
+                                const nsPoint&       aAnchor,
+                                const nsRect&        aDirty,
+                                const nsSize&        aRepeatSize)
 {
   if (!IsReady()) {
     NS_NOTREACHED("Ensure PrepareImage() has returned true before calling me");
     return DrawResult::TEMPORARY_ERROR;
   }
   if (aDest.IsEmpty() || aFill.IsEmpty() ||
       mSize.width <= 0 || mSize.height <= 0) {
     return DrawResult::SUCCESS;
--- a/layout/painting/nsCSSRendering.h
+++ b/layout/painting/nsCSSRendering.h
@@ -142,17 +142,17 @@ public:
    */
   bool PrepareImage();
 
   /**
    * The three Compute*Size functions correspond to the sizing algorthms and
    * definitions from the CSS Image Values and Replaced Content spec. See
    * http://dev.w3.org/csswg/css-images-3/#sizing .
    */
-
+   
   /**
    * Compute the intrinsic size of the image as defined in the CSS Image Values
    * spec. The intrinsic size is the unscaled size which the image would ideally
    * like to be in app units.
    */
   mozilla::CSSSizeOrRatio ComputeIntrinsicSize();
 
   /**
@@ -204,27 +204,27 @@ public:
    * Set this image's preferred size. This will be its intrinsic size where
    * specified and the default size where it is not. Used as the unscaled size
    * when rendering the image.
    */
   void SetPreferredSize(const mozilla::CSSSizeOrRatio& aIntrinsicSize,
                         const nsSize& aDefaultSize);
 
   /**
-   * Draws the image to the target rendering context using
-   * {background|mask}-specific arguments.
+   * Draws the image to the target rendering context using background-specific
+   * arguments.
    * @see nsLayoutUtils::DrawImage() for parameters.
    */
-  DrawResult DrawLayer(nsPresContext*       aPresContext,
-                       nsRenderingContext&  aRenderingContext,
-                       const nsRect&        aDest,
-                       const nsRect&        aFill,
-                       const nsPoint&       aAnchor,
-                       const nsRect&        aDirty,
-                       const nsSize&        aRepeatSize);
+  DrawResult DrawBackground(nsPresContext*       aPresContext,
+                            nsRenderingContext&  aRenderingContext,
+                            const nsRect&        aDest,
+                            const nsRect&        aFill,
+                            const nsPoint&       aAnchor,
+                            const nsRect&        aDirty,
+                            const nsSize&        aRepeatSize);
 
   /**
    * Draw the image to a single component of a border-image style rendering.
    * aFill The destination rect to be drawn into
    * aSrc is the part of the image to be rendered into a tile (aUnitSize in
    * aFill), if aSrc and the dest tile are different sizes, the image will be
    * scaled to map aSrc onto the dest tile.
    * aHFill and aVFill are the repeat patterns for the component -
@@ -664,35 +664,34 @@ struct nsCSSRendering {
        dirtyRect(aDirtyRect),
        borderArea(aBorderArea),
        frame(aFrame),
        paintFlags(aPaintFlags),
        layer(aLayer),
        compositionOp(aCompositionOp) {}
   };
 
-  static DrawResult PaintStyleImageLayer(const PaintBGParams& aParams);
+  static DrawResult PaintBackground(const PaintBGParams& aParams);
 
 
   /**
-   * Same as |PaintStyleImageLayer|, except using the provided style structs.
+   * Same as |PaintBackground|, except using the provided style structs.
    * This short-circuits the code that ensures that the root element's
-   * {background|mask} is drawn on the canvas.
-   * The aLayer parameter allows you to paint a single layer of the
-   * {background|mask}.
+   * background is drawn on the canvas.
+   * The aLayer parameter allows you to paint a single layer of the background.
    * The default value for aLayer, -1, means that all layers will be painted.
    * The background color will only be painted if the back-most layer is also
-   * being painted and (aParams.paintFlags & PAINTBG_MASK_IMAGE) is false.
+   * being painted.
    * aCompositionOp is only respected if a single layer is specified (aLayer != -1).
    * If all layers are painted, the image layer's blend mode (or the mask
    * layer's composition mode) will be used.
    */
-  static DrawResult PaintStyleImageLayerWithSC(const PaintBGParams& aParams,
-                                               nsStyleContext *mBackgroundSC,
-                                               const nsStyleBorder& aBorder);
+  static DrawResult PaintBackgroundWithSC(const PaintBGParams& aParams,
+                                          nsStyleContext *mBackgroundSC,
+                                          const nsStyleBorder& aBorder);
 
   /**
    * Returns the rectangle covered by the given background layer image, taking
    * into account background positioning, sizing, and repetition, but not
    * clipping.
    */
   static nsRect GetBackgroundLayerRect(nsPresContext* aPresContext,
                                        nsIFrame* aForFrame,
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -3244,17 +3244,17 @@ nsDisplayBackgroundImage::PaintInternal(
   nsCSSRendering::PaintBGParams params =
     nsCSSRendering::PaintBGParams::ForSingleLayer(*mFrame->PresContext(),
                                                   *aCtx,
                                                   aBounds, mBackgroundRect,
                                                   mFrame, flags, mLayer,
                                                   CompositionOp::OP_OVER);
   params.bgClipRect = aClipRect;
   image::DrawResult result =
-    nsCSSRendering::PaintStyleImageLayer(params);
+    nsCSSRendering::PaintBackground(params);
 
   if (clip == StyleGeometryBox::Text) {
     ctx->PopGroupAndBlend();
   }
 
   nsDisplayBackgroundGeometry::UpdateDrawResult(this, result);
 }
 
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -507,17 +507,17 @@ PaintMaskSurface(const PaintFramesParams
                                                       rc, aParams.dirtyRect,
                                                       aParams.borderArea,
                                                       aParams.frame,
                                                       aParams.builder->GetBackgroundPaintFlags() |
                                                       nsCSSRendering::PAINTBG_MASK_IMAGE,
                                                       i, compositionOp);
 
       result =
-        nsCSSRendering::PaintStyleImageLayerWithSC(params, aSC,
+        nsCSSRendering::PaintBackgroundWithSC(params, aSC,
                                               *aParams.frame->StyleBorder());
       if (result != DrawResult::SUCCESS) {
         return result;
       }
     }
   }
 
   return DrawResult::SUCCESS;
--- a/layout/tables/nsTableCellFrame.cpp
+++ b/layout/tables/nsTableCellFrame.cpp
@@ -371,17 +371,17 @@ nsTableCellFrame::PaintBackground(nsRend
                                   uint32_t             aFlags)
 {
   nsRect rect(aPt, GetSize());
   nsCSSRendering::PaintBGParams params =
     nsCSSRendering::PaintBGParams::ForAllLayers(*PresContext(),
                                                 aRenderingContext,
                                                 aDirtyRect, rect,
                                                 this, aFlags);
-  return nsCSSRendering::PaintStyleImageLayer(params);
+  return nsCSSRendering::PaintBackground(params);
 }
 
 // Called by nsTablePainter
 DrawResult
 nsTableCellFrame::PaintCellBackground(nsRenderingContext& aRenderingContext,
                                       const nsRect& aDirtyRect, nsPoint aPt,
                                       uint32_t aFlags)
 {
@@ -1199,16 +1199,17 @@ nsBCTableCellFrame::GetBorderOverflow()
   LogicalMargin halfBorder(wm,
                            BC_BORDER_START_HALF_COORD(p2t, mBStartBorder),
                            BC_BORDER_END_HALF_COORD(p2t, mIEndBorder),
                            BC_BORDER_END_HALF_COORD(p2t, mBEndBorder),
                            BC_BORDER_START_HALF_COORD(p2t, mIStartBorder));
   return halfBorder.GetPhysicalMargin(wm);
 }
 
+
 DrawResult
 nsBCTableCellFrame::PaintBackground(nsRenderingContext& aRenderingContext,
                                     const nsRect&        aDirtyRect,
                                     nsPoint              aPt,
                                     uint32_t             aFlags)
 {
   // make border-width reflect the half of the border-collapse
   // assigned border that's inside the cell
@@ -1224,11 +1225,10 @@ nsBCTableCellFrame::PaintBackground(nsRe
   // bypassing nsCSSRendering::PaintBackground is safe because this kind
   // of frame cannot be used for the root element
   nsRect rect(aPt, GetSize());
   nsCSSRendering::PaintBGParams params =
     nsCSSRendering::PaintBGParams::ForAllLayers(*PresContext(),
                                                 aRenderingContext, aDirtyRect,
                                                 rect, this,
                                                 aFlags);
-  return nsCSSRendering::PaintStyleImageLayerWithSC(params, StyleContext(),
-                                                    myBorder);
+  return nsCSSRendering::PaintBackgroundWithSC(params, StyleContext(), myBorder);
 }
--- a/layout/tables/nsTablePainter.cpp
+++ b/layout/tables/nsTablePainter.cpp
@@ -234,17 +234,17 @@ TableBackgroundPainter::PaintTableFrame(
       nsCSSRendering::PaintBGParams::ForAllLayers(*mPresContext,
                                                   mRenderingContext,
                                                   mDirtyRect,
                                                   tableData.mRect + mRenderPt,
                                                   tableData.mFrame,
                                                   mBGPaintFlags);
 
     result &=
-      nsCSSRendering::PaintStyleImageLayerWithSC(params,
+      nsCSSRendering::PaintBackgroundWithSC(params,
                                             tableData.mFrame->StyleContext(),
                                             tableData.StyleBorder(mZeroBorder));
   }
 
   return result;
 }
 
 void
@@ -575,60 +575,60 @@ TableBackgroundPainter::PaintCell(nsTabl
     nsCSSRendering::PaintBGParams params =
       nsCSSRendering::PaintBGParams::ForAllLayers(*mPresContext, mRenderingContext,
                                                  mDirtyRect,
                                                  mCols[colIndex].mColGroup.mRect + mRenderPt,
                                                  mCols[colIndex].mColGroup.mFrame,
                                                  mBGPaintFlags);
     params.bgClipRect = &aColBGRect;
     result &=
-      nsCSSRendering::PaintStyleImageLayerWithSC(params,
+      nsCSSRendering::PaintBackgroundWithSC(params,
                                             mCols[colIndex].mColGroup.mFrame->StyleContext(),
                                             mCols[colIndex].mColGroup.StyleBorder(mZeroBorder));
   }
 
   //Paint column background
   if (haveColumns && mCols[colIndex].mCol.IsVisible()) {
     nsCSSRendering::PaintBGParams params =
       nsCSSRendering::PaintBGParams::ForAllLayers(*mPresContext, mRenderingContext,
                                                   mDirtyRect,
                                                   mCols[colIndex].mCol.mRect + mRenderPt,
                                                   mCols[colIndex].mCol.mFrame,
                                                   mBGPaintFlags);
     params.bgClipRect = &aColBGRect;
     result &=
-      nsCSSRendering::PaintStyleImageLayerWithSC(params,
+      nsCSSRendering::PaintBackgroundWithSC(params,
                                             mCols[colIndex].mCol.mFrame->StyleContext(),
                                             mCols[colIndex].mCol.StyleBorder(mZeroBorder));
   }
 
   //Paint row group background
   if (aRowGroupBGData.IsVisible()) {
     nsCSSRendering::PaintBGParams params =
       nsCSSRendering::PaintBGParams::ForAllLayers(*mPresContext, mRenderingContext,
                                                   mDirtyRect,
                                                   aRowGroupBGData.mRect + mRenderPt,
                                                   aRowGroupBGData.mFrame, mBGPaintFlags);
     params.bgClipRect = &aRowGroupBGRect;
     result &=
-      nsCSSRendering::PaintStyleImageLayerWithSC(params,
+      nsCSSRendering::PaintBackgroundWithSC(params,
                                             aRowGroupBGData.mFrame->StyleContext(),
                                             aRowGroupBGData.StyleBorder(mZeroBorder));
   }
 
   //Paint row background
   if (aRowBGData.IsVisible()) {
     nsCSSRendering::PaintBGParams params =
       nsCSSRendering::PaintBGParams::ForAllLayers(*mPresContext, mRenderingContext,
                                                   mDirtyRect,
                                                   aRowBGData.mRect + mRenderPt,
                                                   aRowBGData.mFrame, mBGPaintFlags);
     params.bgClipRect = &aRowBGRect;
     result &=
-      nsCSSRendering::PaintStyleImageLayerWithSC(params,
+      nsCSSRendering::PaintBackgroundWithSC(params,
                                             aRowBGData.mFrame->StyleContext(),
                                             aRowBGData.StyleBorder(mZeroBorder));
   }
 
   //Paint cell background in border-collapse unless we're just passing
   if (mIsBorderCollapse && !aPassSelf) {
     result &=
       aCell->PaintCellBackground(mRenderingContext, mDirtyRect,
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -4144,18 +4144,17 @@ nsTreeBodyFrame::PaintBackgroundLayer(ns
                                       const nsRect&        aDirtyRect)
 {
   const nsStyleBorder* myBorder = aStyleContext->StyleBorder();
   nsCSSRendering::PaintBGParams params =
     nsCSSRendering::PaintBGParams::ForAllLayers(*aPresContext, aRenderingContext,
                                                 aDirtyRect, aRect, this,
                                                 nsCSSRendering::PAINTBG_SYNC_DECODE_IMAGES);
   DrawResult result =
-    nsCSSRendering::PaintStyleImageLayerWithSC(params, aStyleContext,
-                                               *myBorder);
+    nsCSSRendering::PaintBackgroundWithSC(params, aStyleContext, *myBorder);
 
   result &=
     nsCSSRendering::PaintBorderWithStyleBorder(aPresContext, aRenderingContext,
                                                this, aDirtyRect, aRect,
                                                *myBorder, mStyleContext,
                                                PaintBorderFlags::SYNC_DECODE_IMAGES);
 
   nsCSSRendering::PaintOutline(aPresContext, aRenderingContext, this,