mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 766429 - Minimize the size of the offscreen surfaces created for SVG group opacity, masks and complex clipPaths. r=roc.
This commit is contained in:
parent
7a97c993d4
commit
8ac746fbdd
@ -1226,6 +1226,19 @@ nsSVGUtils::PaintFrameWithEffects(nsRenderingContext *aContext,
|
||||
if (opacity != 1.0f || maskFrame || (clipPathFrame && !isTrivialClip)) {
|
||||
complexEffects = true;
|
||||
gfx->Save();
|
||||
if (!(aFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
// aFrame has a valid visual overflow rect, so clip to it before calling
|
||||
// PushGroup() to minimize the size of the surfaces we'll composite:
|
||||
gfxContextMatrixAutoSaveRestore matrixAutoSaveRestore(gfx);
|
||||
gfx->Multiply(GetCanvasTM(aFrame));
|
||||
nsRect overflowRect = aFrame->GetVisualOverflowRectRelativeToSelf();
|
||||
if (aFrame->IsFrameOfType(nsIFrame::eSVGGeometry)) {
|
||||
// Unlike containers, leaf frames do not include GetPosition() in
|
||||
// GetCanvasTM().
|
||||
overflowRect = overflowRect + aFrame->GetPosition();
|
||||
}
|
||||
aContext->IntersectClip(overflowRect);
|
||||
}
|
||||
gfx->PushGroup(gfxASurface::CONTENT_COLOR_ALPHA);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user