Commit 4250e26d authored by Jeff Muizelaar's avatar Jeff Muizelaar
Browse files

Bug 1413629. Don't require a PresContext to apply a clip. r=mstange

The only thing we use the PresContext for is the app units. I'd rather not
worry about keeping around a PresContext for the webrender display item
grouping.
parent 89797990
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -91,10 +91,9 @@ DisplayItemClip::IntersectWith(const DisplayItemClip& aOther)

void
DisplayItemClip::ApplyTo(gfxContext* aContext,
                         nsPresContext* aPresContext,
                         int32_t A2D,
                         uint32_t aBegin, uint32_t aEnd)
{
  int32_t A2D = aPresContext->AppUnitsPerDevPixel();
  ApplyRectTo(aContext, A2D);
  ApplyRoundedRectClipsTo(aContext, A2D, aBegin, aEnd);
}
+1 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ public:
  // Apply this |DisplayItemClip| to the given gfxContext.  Any saving of state
  // or clearing of other clips must be done by the caller.
  // See aBegin/aEnd note on ApplyRoundedRectsTo.
  void ApplyTo(gfxContext* aContext, nsPresContext* aPresContext,
  void ApplyTo(gfxContext* aContext, int32_t A2D,
               uint32_t aBegin = 0, uint32_t aEnd = UINT32_MAX);

  void ApplyRectTo(gfxContext* aContext, int32_t A2D) const;
+1 −1
Original line number Diff line number Diff line
@@ -6015,7 +6015,7 @@ FrameLayerBuilder::PaintItems(nsTArray<ClippedDisplayItem>& aItems,
        aContext->Save();
        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);
        currentClip.ApplyTo(aContext, aPresContext->AppUnitsPerDevPixel(), aCommonClipCount);
        aContext->NewPath();
      }
    }