Bug 1269971 - Part 5. Correct draw region in nsDisplayBackgroundColor::Paint; draft
authorCJKu <cku@mozilla.com>
Fri, 13 May 2016 00:09:16 +0800
changeset 366374 6a2f8074ab3075f5d86120fa1a4994460408767f
parent 366373 a0040eaa1236d0b78937c56e1ce14fdec35d1f7a
child 366375 fa32bdcf093fc2128bb1b1ae8e272d18bcbef5a9
push id17966
push usercku@mozilla.com
push dateThu, 12 May 2016 16:10:23 +0000
bugs1269971
milestone49.0a1
Bug 1269971 - Part 5. Correct draw region in nsDisplayBackgroundColor::Paint; MozReview-Commit-ID: LV8lP6NuV85
layout/base/nsDisplayList.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -3379,31 +3379,30 @@ nsDisplayBackgroundColor::Paint(nsDispla
 
   Rect rect = NSRectToSnappedRect(mBackgroundRect,
                                   mFrame->PresContext()->AppUnitsPerDevPixel(),
                                   aDrawTarget);
   ColorPattern color(ToDeviceColor(mColor));
   aDrawTarget.FillRect(rect, color);
 #else
   gfxContext* ctx = aCtx->ThebesContext();
+  gfxRect bounds =
+    nsLayoutUtils::RectToGfxRect(mBackgroundRect,
+                                 mFrame->PresContext()->AppUnitsPerDevPixel());
 
   uint8_t clip = mBackgroundStyle->mImage.mLayers[0].mClip;
   if (clip == NS_STYLE_IMAGELAYER_CLIP_TEXT) {
-    gfxContextAutoSaveRestore save(ctx);
-
     GenerateAndPushTextMask(mFrame, aCtx, mBackgroundRect);
     ctx->SetColor(mColor);
+    ctx->Rectangle(bounds, true);
     ctx->Fill();
     ctx->PopGroupAndBlend();
     return;
   }
 
-  gfxRect bounds =
-    nsLayoutUtils::RectToGfxRect(mBackgroundRect, mFrame->PresContext()->AppUnitsPerDevPixel());
-
   ctx->SetColor(mColor);
   ctx->NewPath();
   ctx->Rectangle(bounds, true);
   ctx->Fill();
 #endif
 }
 
 nsRegion