Backed out 2 changesets (bug 1507021) for android build bustages on a CLOSED TREE
authorAndreea Pavel <apavel@mozilla.com>
Thu, 15 Nov 2018 06:35:54 +0200
changeset 502906 479f5e79077c06df25227e8628c29191c1e91ae6
parent 502905 5beaad8a185bf4d01dd729d53e31429c8cdebf27
child 502907 5a4abcac5a0beffbc3f7705332afd1696d154db0
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1507021
milestone65.0a1
backs out026f135a667f1684e568580bc65e6282174db3a9
1b87eb56e4623d44febf72846134d4c07d4063bd
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 2 changesets (bug 1507021) for android build bustages on a CLOSED TREE Backed out changeset 026f135a667f (bug 1507021) Backed out changeset 1b87eb56e462 (bug 1507021)
gfx/layers/basic/BasicLayerManager.cpp
gfx/thebes/gfxContext.cpp
gfx/thebes/gfxContext.h
gfx/thebes/gfxTextRun.cpp
layout/mathml/nsMathMLChar.cpp
layout/painting/DisplayItemClip.cpp
layout/painting/nsCSSRendering.cpp
layout/painting/nsDisplayList.cpp
layout/svg/nsSVGIntegrationUtils.cpp
--- a/gfx/layers/basic/BasicLayerManager.cpp
+++ b/gfx/layers/basic/BasicLayerManager.cpp
@@ -786,18 +786,20 @@ InstallLayerClipPreserves3D(gfxContext* 
   Matrix transform;
   if (!transform3d.CanDraw2D(&transform)) {
     gfxDevCrash(LogReason::CannotDraw3D) << "GFX: We should not have a 3D transform that CanDraw2D() is false!";
   }
   Matrix oldTransform = aTarget->CurrentMatrix();
   transform *= oldTransform;
   aTarget->SetMatrix(transform);
 
-  aTarget->SnappedClip(gfxRect(clipRect->X(), clipRect->Y(),
-                               clipRect->Width(), clipRect->Height()));
+  aTarget->NewPath();
+  aTarget->SnappedRectangle(gfxRect(clipRect->X(), clipRect->Y(),
+                                    clipRect->Width(), clipRect->Height()));
+  aTarget->Clip();
 
   aTarget->SetMatrix(oldTransform);
 }
 
 void
 BasicLayerManager::PaintLayer(gfxContext* aTarget,
                               Layer* aLayer,
                               DrawPaintedLayerCallback aCallback,
@@ -940,17 +942,19 @@ BasicLayerManager::PaintLayer(gfxContext
     if (xformSurf) {
       aTarget->SetPattern(
         new gfxPattern(xformSurf,
                        Matrix::Translation(xformBounds.TopLeft())));
 
       // Azure doesn't support EXTEND_NONE, so to avoid extending the edges
       // of the source surface out to the current clip region, clip to
       // the rectangle of the result surface now.
-      aTarget->SnappedClip(ThebesRect(xformBounds));
+      aTarget->NewPath();
+      aTarget->SnappedRectangle(ThebesRect(xformBounds));
+      aTarget->Clip();
       FlushGroup(paintLayerContext, needsClipToVisibleRegion);
     }
   }
 }
 
 void
 BasicLayerManager::ClearCachedResources(Layer* aSubtree)
 {
--- a/gfx/thebes/gfxContext.cpp
+++ b/gfx/thebes/gfxContext.cpp
@@ -296,35 +296,16 @@ gfxContext::Rectangle(const gfxRect& rec
 
   mPathBuilder->MoveTo(rec.TopLeft());
   mPathBuilder->LineTo(rec.TopRight());
   mPathBuilder->LineTo(rec.BottomRight());
   mPathBuilder->LineTo(rec.BottomLeft());
   mPathBuilder->Close();
 }
 
-void
-gfxContext::SnappedClip(const gfxRect& rect)
-{
-  Rect rec = ToRect(rect);
-
-  gfxRect newRect(rect);
-  if (UserToDevicePixelSnapped(newRect, true)) {
-    gfxMatrix mat = ThebesMatrix(mTransform);
-    if (mat.Invert()) {
-      // We need the user space rect.
-      rec = ToRect(mat.TransformBounds(newRect));
-    } else {
-      rec = Rect();
-    }
-  }
-
-  Clip(rec);
-}
-
 // transform stuff
 void
 gfxContext::Multiply(const gfxMatrix& matrix)
 {
   CURRENTSTATE_CHANGED()
   ChangeTransform(ToMatrix(matrix) * mTransform);
 }
 
--- a/gfx/thebes/gfxContext.h
+++ b/gfx/thebes/gfxContext.h
@@ -144,22 +144,20 @@ public:
     // path helpers
     /**
      * Draws a line from start to end.
      */
     void Line(const gfxPoint& start, const gfxPoint& end); // XXX snapToPixels option?
 
     /**
      * Draws the rectangle given by rect.
+     * @param snapToPixels ?
      */
-    void Rectangle(const gfxRect& rect) { return Rectangle(rect, false); }
+    void Rectangle(const gfxRect& rect, bool snapToPixels = false);
     void SnappedRectangle(const gfxRect& rect) { return Rectangle(rect, true); }
-private:
-    void Rectangle(const gfxRect& rect, bool snapToPixels);
-public:
 
     /**
      ** Transformation Matrix manipulation
      **/
 
     /**
      * Post-multiplies 'other' onto the current CTM, i.e. this
      * matrix's transformation will take place before the previously set
@@ -369,17 +367,16 @@ public:
     void Clip();
 
     /**
      * Helper functions that will create a rect path and call Clip().
      * Any current path will be destroyed by these functions!
      */
     void Clip(const Rect& rect);
     void Clip(const gfxRect& rect); // will clip to a rect
-    void SnappedClip(const gfxRect& rect); // snap rect and clip to the result
     void Clip(Path* aPath);
 
     void PopClip();
 
     enum ClipExtentsSpace {
         eUserSpace = 0,
         eDeviceSpace = 1,
     };
--- a/gfx/thebes/gfxTextRun.cpp
+++ b/gfx/thebes/gfxTextRun.cpp
@@ -556,20 +556,22 @@ struct MOZ_STACK_CLASS BufferAlphaColor 
 
     }
 
     ~BufferAlphaColor() {}
 
     void PushSolidColor(const gfxRect& aBounds, const Color& aAlphaColor, uint32_t appsPerDevUnit)
     {
         mContext->Save();
-        mContext->SnappedClip(gfxRect(aBounds.X() / appsPerDevUnit,
+        mContext->NewPath();
+        mContext->Rectangle(gfxRect(aBounds.X() / appsPerDevUnit,
                     aBounds.Y() / appsPerDevUnit,
                     aBounds.Width() / appsPerDevUnit,
-                    aBounds.Height() / appsPerDevUnit));
+                    aBounds.Height() / appsPerDevUnit), true);
+        mContext->Clip();
         mContext->SetColor(Color(aAlphaColor.r, aAlphaColor.g, aAlphaColor.b));
         mContext->PushGroupForBlendBack(gfxContentType::COLOR_ALPHA, aAlphaColor.a);
     }
 
     void PopAlpha()
     {
         // pop the text, using the color alpha as the opacity
         mContext->PopGroupAndBlend();
--- a/layout/mathml/nsMathMLChar.cpp
+++ b/layout/mathml/nsMathMLChar.cpp
@@ -2111,18 +2111,20 @@ nsMathMLChar::PaintForeground(nsIFrame* 
 
 class AutoPushClipRect {
   gfxContext* mThebesContext;
 public:
   AutoPushClipRect(gfxContext* aThebesContext, int32_t aAppUnitsPerGfxUnit,
                    const nsRect& aRect)
     : mThebesContext(aThebesContext) {
     mThebesContext->Save();
+    mThebesContext->NewPath();
     gfxRect clip = nsLayoutUtils::RectToGfxRect(aRect, aAppUnitsPerGfxUnit);
-    mThebesContext->SnappedClip(clip);
+    mThebesContext->SnappedRectangle(clip);
+    mThebesContext->Clip();
   }
   ~AutoPushClipRect() {
     mThebesContext->Restore();
   }
 };
 
 static nsPoint
 SnapToDevPixels(const gfxContext* aThebesContext, int32_t aAppUnitsPerGfxUnit,
--- a/layout/painting/DisplayItemClip.cpp
+++ b/layout/painting/DisplayItemClip.cpp
@@ -96,17 +96,17 @@ DisplayItemClip::ApplyTo(gfxContext* aCo
   ApplyRoundedRectClipsTo(aContext, A2D, 0, mRoundedClipRects.Length());
 }
 
 void
 DisplayItemClip::ApplyRectTo(gfxContext* aContext, int32_t A2D) const
 {
   aContext->NewPath();
   gfxRect clip = nsLayoutUtils::RectToGfxRect(mClipRect, A2D);
-  aContext->SnappedRectangle(clip);
+  aContext->Rectangle(clip, true);
   aContext->Clip();
 }
 
 void
 DisplayItemClip::ApplyRoundedRectClipsTo(gfxContext* aContext,
                                          int32_t A2D,
                                          uint32_t aBegin,
                                          uint32_t aEnd) const
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -2537,17 +2537,19 @@ SetupImageLayerClip(nsCSSRendering::Imag
 
   if (aClipState.mHasAdditionalBGClipArea) {
     gfxRect bgAreaGfx = nsLayoutUtils::RectToGfxRect(
       aClipState.mAdditionalBGClipArea, aAppUnitsPerPixel);
     bgAreaGfx.Round();
     gfxUtils::ConditionRect(bgAreaGfx);
 
     aAutoSR->EnsureSaved(aCtx);
-    aCtx->SnappedClip(bgAreaGfx);
+    aCtx->NewPath();
+    aCtx->Rectangle(bgAreaGfx, true);
+    aCtx->Clip();
   }
 
   if (aClipState.mHasRoundedCorners) {
     Rect bgAreaGfx = NSRectToRect(aClipState.mBGClipArea, aAppUnitsPerPixel);
     bgAreaGfx.Round();
 
     if (bgAreaGfx.IsEmpty()) {
       // I think it's become possible to hit this since
@@ -2578,17 +2580,17 @@ DrawBackgroundColor(nsCSSRendering::Imag
   }
 
   DrawTarget* drawTarget = aCtx->GetDrawTarget();
 
   // We don't support custom clips and rounded corners, arguably a bug, but
   // table painting seems to depend on it.
   if (!aClipState.mHasRoundedCorners || aClipState.mCustomClip) {
     aCtx->NewPath();
-    aCtx->SnappedRectangle(aClipState.mDirtyRectInDevPx);
+    aCtx->Rectangle(aClipState.mDirtyRectInDevPx, true);
     aCtx->Fill();
     return;
   }
 
   Rect bgAreaGfx = NSRectToRect(aClipState.mBGClipArea, aAppUnitsPerPixel);
   bgAreaGfx.Round();
 
   if (bgAreaGfx.IsEmpty()) {
@@ -2598,24 +2600,28 @@ DrawBackgroundColor(nsCSSRendering::Imag
     // Make our caller not do anything.
     aClipState.mDirtyRectInDevPx.SizeTo(gfxSize(0.0, 0.0));
     return;
   }
 
   aCtx->Save();
   gfxRect dirty = ThebesRect(bgAreaGfx).Intersect(aClipState.mDirtyRectInDevPx);
 
-  aCtx->SnappedClip(dirty);
+  aCtx->NewPath();
+  aCtx->Rectangle(dirty, true);
+  aCtx->Clip();
 
   if (aClipState.mHasAdditionalBGClipArea) {
     gfxRect bgAdditionalAreaGfx = nsLayoutUtils::RectToGfxRect(
       aClipState.mAdditionalBGClipArea, aAppUnitsPerPixel);
     bgAdditionalAreaGfx.Round();
     gfxUtils::ConditionRect(bgAdditionalAreaGfx);
-    aCtx->SnappedClip(bgAdditionalAreaGfx);
+    aCtx->NewPath();
+    aCtx->Rectangle(bgAdditionalAreaGfx, true);
+    aCtx->Clip();
   }
 
   RefPtr<Path> roundedRect =
     MakePathForRoundedRect(*drawTarget, bgAreaGfx, aClipState.mClippedRadii);
   aCtx->SetPath(roundedRect);
   aCtx->Fill();
   aCtx->Restore();
 }
@@ -2927,17 +2933,19 @@ nsCSSRendering::PaintStyleImageLayerWith
           currentLayerClipState, &aRenderingCtx, appUnitsPerPixel, &autoSR);
         if (!clipBorderArea.IsEqualEdges(aParams.borderArea)) {
           // We're drawing the background for the joined continuation boxes
           // so we need to clip that to the slice that we want for this
           // frame.
           gfxRect clip =
             nsLayoutUtils::RectToGfxRect(aParams.borderArea, appUnitsPerPixel);
           autoSR.EnsureSaved(&aRenderingCtx);
-          aRenderingCtx.SnappedClip(clip);
+          aRenderingCtx.NewPath();
+          aRenderingCtx.SnappedRectangle(clip);
+          aRenderingCtx.Clip();
         }
       }
     }
 
     // Skip the following layer preparing and painting code if the current
     // layer is not selected for drawing.
     if (aParams.layer >= 0 && i != (uint32_t)aParams.layer) {
       continue;
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -5074,25 +5074,25 @@ nsDisplayBackgroundColor::Paint(nsDispla
     mBackgroundStyle->StyleBackground()->mImage.mLayers[0].mClip;
   if (clip == StyleGeometryBox::Text) {
     if (!GenerateAndPushTextMask(mFrame, aCtx, mBackgroundRect, aBuilder)) {
       return;
     }
 
     ctx->SetColor(mColor);
     ctx->NewPath();
-    ctx->SnappedRectangle(bounds);
+    ctx->Rectangle(bounds, true);
     ctx->Fill();
     ctx->PopGroupAndBlend();
     return;
   }
 
   ctx->SetColor(mColor);
   ctx->NewPath();
-  ctx->SnappedRectangle(bounds);
+  ctx->Rectangle(bounds, true);
   ctx->Fill();
 #endif
 }
 
 nsRegion
 nsDisplayBackgroundColor::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
                                           bool* aSnap) const
 {
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -1048,17 +1048,17 @@ void PaintMaskAndClipPathInternal(const 
 
   if (gfxPrefs::DrawMaskLayer()) {
     gfxContextAutoSaveRestore saver(&context);
 
     context.NewPath();
     gfxRect drawingRect =
       nsLayoutUtils::RectToGfxRect(aParams.borderArea,
                                    frame->PresContext()->AppUnitsPerDevPixel());
-    context.SnappedRectangle(drawingRect);
+    context.Rectangle(drawingRect, true);
     Color overlayColor(0.0f, 0.0f, 0.0f, 0.8f);
     if (maskUsage.shouldGenerateMaskLayer) {
       overlayColor.r = 1.0f; // red represents css positioned mask.
     }
     if (maskUsage.shouldApplyClipPath ||
         maskUsage.shouldGenerateClipMaskLayer) {
       overlayColor.g = 1.0f; // green represents clip-path:<clip-source>.
     }