mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 769612 - Move the SVGAutoRenderState::SetPaintingToWindow() call to nsDisplayOuterSVG::Paint and kill nsSVGOuterSVGFrame::Paint. r=dholbert.
This commit is contained in:
parent
379c18f4f5
commit
ae1ae58136
@ -487,15 +487,27 @@ nsDisplayOuterSVG::Paint(nsDisplayListBuilder* aBuilder,
|
||||
PRTime start = PR_Now();
|
||||
#endif
|
||||
|
||||
// Create an SVGAutoRenderState so we can call SetPaintingToWindow on
|
||||
// it, but do so without changing the render mode:
|
||||
SVGAutoRenderState state(aContext, SVGAutoRenderState::GetRenderMode(aContext));
|
||||
|
||||
if (aBuilder->IsPaintingToWindow()) {
|
||||
state.SetPaintingToWindow(true);
|
||||
}
|
||||
|
||||
nsRect viewportRect =
|
||||
mFrame->GetContentRectRelativeToSelf() + ToReferenceFrame();
|
||||
|
||||
nsRect clipRect = mVisibleRect.Intersect(viewportRect);
|
||||
|
||||
nsIntRect contentAreaDirtyRect =
|
||||
(clipRect - viewportRect.TopLeft()).
|
||||
ToOutsidePixels(mFrame->PresContext()->AppUnitsPerDevPixel());
|
||||
|
||||
aContext->PushState();
|
||||
aContext->IntersectClip(clipRect);
|
||||
aContext->Translate(viewportRect.TopLeft());
|
||||
mFrame->Paint(aBuilder, aContext, clipRect - viewportRect.TopLeft());
|
||||
nsSVGUtils::PaintFrameWithEffects(aContext, &contentAreaDirtyRect, mFrame);
|
||||
aContext->PopState();
|
||||
|
||||
NS_ASSERTION(!aContext->ThebesContext()->HasError(), "Cairo in error state");
|
||||
@ -594,26 +606,6 @@ nsSVGOuterSVGFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGOuterSVGFrame::Paint(const nsDisplayListBuilder* aBuilder,
|
||||
nsRenderingContext* aContext,
|
||||
const nsRect& aDirtyRect)
|
||||
{
|
||||
// Create an SVGAutoRenderState so we can call SetPaintingToWindow on
|
||||
// it, but don't change the render mode:
|
||||
SVGAutoRenderState state(aContext, SVGAutoRenderState::GetRenderMode(aContext));
|
||||
|
||||
if (aBuilder->IsPaintingToWindow()) {
|
||||
state.SetPaintingToWindow(true);
|
||||
}
|
||||
|
||||
// Convert the (content area relative) dirty rect to dev pixels:
|
||||
nsIntRect dirtyPxRect =
|
||||
aDirtyRect.ToOutsidePixels(PresContext()->AppUnitsPerDevPixel());
|
||||
|
||||
nsSVGUtils::PaintFrameWithEffects(aContext, &dirtyPxRect, this);
|
||||
}
|
||||
|
||||
nsSplittableType
|
||||
nsSVGOuterSVGFrame::GetSplittableType() const
|
||||
{
|
||||
|
@ -65,10 +65,6 @@ public:
|
||||
*/
|
||||
virtual nsIAtom* GetType() const;
|
||||
|
||||
void Paint(const nsDisplayListBuilder* aBuilder,
|
||||
nsRenderingContext* aContext,
|
||||
const nsRect& aDirtyRect);
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsAString& aResult) const
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user