Bug 1269971 - Part 5. Correct draw region in nsDisplayBackgroundColor::Paint. r=jfkthame, a=sylvestre
authorCJKu <cku@mozilla.com>
Fri, 20 May 2016 12:03:00 +0200
changeset 333000 da5910798bf1ab9526fc41696c0b200679caa517
parent 332999 1af0ed7b52bc1af6291370fa2f32e3c452a6a0cf
child 333001 c04eab052ee495415f197b5fc0514966b61e9dc0
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, sylvestre
bugs1269971
milestone48.0a2
Bug 1269971 - Part 5. Correct draw region in nsDisplayBackgroundColor::Paint. r=jfkthame, a=sylvestre
layout/base/nsDisplayList.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -3389,31 +3389,30 @@ nsDisplayBackgroundColor::Paint(nsDispla
 
   Rect rect = NSRectToSnappedRect(borderBox,
                                   mFrame->PresContext()->AppUnitsPerDevPixel(),
                                   aDrawTarget);
   ColorPattern color(ToDeviceColor(mColor));
   aDrawTarget.FillRect(rect, color);
 #else
   gfxContext* ctx = aCtx->ThebesContext();
+  gfxRect bounds =
+    nsLayoutUtils::RectToGfxRect(borderBox,
+                                 mFrame->PresContext()->AppUnitsPerDevPixel());
 
   uint8_t clip = mBackgroundStyle->mImage.mLayers[0].mClip;
   if (clip == NS_STYLE_IMAGELAYER_CLIP_TEXT) {
-    gfxContextAutoSaveRestore save(ctx);
-
     GenerateAndPushTextMask(mFrame, aCtx, borderBox);
     ctx->SetColor(mColor);
+    ctx->Rectangle(bounds, true);
     ctx->Fill();
     ctx->PopGroupAndBlend();
     return;
   }
 
-  gfxRect bounds =
-    nsLayoutUtils::RectToGfxRect(borderBox, mFrame->PresContext()->AppUnitsPerDevPixel());
-
   ctx->SetColor(mColor);
   ctx->NewPath();
   ctx->Rectangle(bounds, true);
   ctx->Fill();
 #endif
 }
 
 nsRegion