Bug 1102896 - Save and restore the subpixel AA settings of the draw target when drawing an inactive layer manager so they don't get clobbered. r=mattwoodrow, a=lmandel
authorTimothy Nikkel <tnikkel@gmail.com>
Tue, 24 Feb 2015 22:59:43 -0600
changeset 257460 7cde06012d12f2fd372199ad66272427007c921f
parent 257459 5a6ad0eb44370f1d53e37eb3952c0415f76bd66b
child 257461 62f149b1cfd7e2c7a70b0b53a7fb55a004ac5b12
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, lmandel
bugs1102896
milestone38.0a2
Bug 1102896 - Save and restore the subpixel AA settings of the draw target when drawing an inactive layer manager so they don't get clobbered. r=mattwoodrow, a=lmandel
layout/base/FrameLayerBuilder.cpp
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -4314,19 +4314,18 @@ FrameLayerBuilder::PaintItems(nsTArray<C
                               gfxContext *aContext,
                               nsRenderingContext *aRC,
                               nsDisplayListBuilder* aBuilder,
                               nsPresContext* aPresContext,
                               const nsIntPoint& aOffset,
                               float aXScale, float aYScale,
                               int32_t aCommonClipCount)
 {
-#ifdef MOZ_DUMP_PAINTING
   DrawTarget& aDrawTarget = *aRC->GetDrawTarget();
-#endif
+
   int32_t appUnitsPerDevPixel = aPresContext->AppUnitsPerDevPixel();
   nsRect boundRect = aRect.ToAppUnits(appUnitsPerDevPixel);
   boundRect.MoveBy(NSIntPixelsToAppUnits(aOffset.x, appUnitsPerDevPixel),
                  NSIntPixelsToAppUnits(aOffset.y, appUnitsPerDevPixel));
   boundRect.ScaleInverseRoundOut(aXScale, aYScale);
 
   DisplayItemClip currentClip;
   bool currentClipIsSetInContext = false;
@@ -4366,17 +4365,19 @@ FrameLayerBuilder::PaintItems(nsTArray<C
         NS_ASSERTION(aCommonClipCount < 100,
           "Maybe you really do have more than a hundred clipping rounded rects, or maybe something has gone wrong.");
         currentClip.ApplyTo(aContext, aPresContext, aCommonClipCount);
         aContext->NewPath();
       }
     }
 
     if (cdi->mInactiveLayerManager) {
+      bool saved = aDrawTarget.GetPermitSubpixelAA();
       PaintInactiveLayer(aBuilder, cdi->mInactiveLayerManager, cdi->mItem, aContext, aRC);
+      aDrawTarget.SetPermitSubpixelAA(saved);
     } else {
       nsIFrame* frame = cdi->mItem->Frame();
       frame->AddStateBits(NS_FRAME_PAINTED_THEBES);
 #ifdef MOZ_DUMP_PAINTING
       if (gfxUtils::sDumpPainting) {
         DebugPaintItem(aDrawTarget, aPresContext, cdi->mItem, aBuilder);
       } else {
 #else