mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1073984 - Make SVG geometry painting use a Moz2D Path object directly. r=longsonr
This commit is contained in:
parent
a5d3a2ebc4
commit
bf1cbae705
@ -29,7 +29,7 @@
|
|||||||
== downscale-svg-1a.html downscale-svg-1-ref.html?80
|
== downscale-svg-1a.html downscale-svg-1-ref.html?80
|
||||||
fuzzy(80,468) == downscale-svg-1b.html downscale-svg-1-ref.html?72
|
fuzzy(80,468) == downscale-svg-1b.html downscale-svg-1-ref.html?72
|
||||||
== downscale-svg-1c.html downscale-svg-1-ref.html?64
|
== downscale-svg-1c.html downscale-svg-1-ref.html?64
|
||||||
fuzzy(17,208) fuzzy-if(B2G,254,207) == downscale-svg-1d.html downscale-svg-1-ref.html?53 # right side is 1 pixel off for B2G, probably regression from 974242
|
fuzzy(17,208) fuzzy-if(B2G,255,207) == downscale-svg-1d.html downscale-svg-1-ref.html?53 # right side is 1 pixel off for B2G, probably regression from 974242
|
||||||
fuzzy(78,216) == downscale-svg-1e.html downscale-svg-1-ref.html?40
|
fuzzy(78,216) == downscale-svg-1e.html downscale-svg-1-ref.html?40
|
||||||
fuzzy(51,90) == downscale-svg-1f.html downscale-svg-1-ref.html?24
|
fuzzy(51,90) == downscale-svg-1f.html downscale-svg-1-ref.html?24
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ random == img-and-image-1.html img-and-image-1-ref.svg # bug 645267
|
|||||||
# More complex <img> tests
|
# More complex <img> tests
|
||||||
== img-blobURI-1.html lime100x100-ref.html
|
== img-blobURI-1.html lime100x100-ref.html
|
||||||
random == img-blobURI-2.html lime100x100-ref.html
|
random == img-blobURI-2.html lime100x100-ref.html
|
||||||
== img-content-outside-viewBox-1.html img-content-outside-viewBox-1-ref.html
|
fuzzy-if(d2d,16,10) == img-content-outside-viewBox-1.html img-content-outside-viewBox-1-ref.html # d2d is bug 1074161
|
||||||
== img-display-none-1.html about:blank
|
== img-display-none-1.html about:blank
|
||||||
== img-dyn-1.html img-dyn-1-ref.html
|
== img-dyn-1.html img-dyn-1-ref.html
|
||||||
== img-foreignObject-1.html lime100x100-ref.html
|
== img-foreignObject-1.html lime100x100-ref.html
|
||||||
|
@ -614,7 +614,28 @@ nsSVGPathGeometryFrame::Render(nsRenderingContext *aContext,
|
|||||||
{
|
{
|
||||||
gfxContext *gfx = aContext->ThebesContext();
|
gfxContext *gfx = aContext->ThebesContext();
|
||||||
|
|
||||||
|
gfxMatrix newMatrix =
|
||||||
|
gfx->CurrentMatrix().PreMultiply(aTransform).NudgeToIntegers();
|
||||||
|
if (newMatrix.IsSingular()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint16_t renderMode = SVGAutoRenderState::GetRenderMode(aContext);
|
uint16_t renderMode = SVGAutoRenderState::GetRenderMode(aContext);
|
||||||
|
FillRule fillRule =
|
||||||
|
nsSVGUtils::ToFillRule(renderMode == SVGAutoRenderState::CLIP_MASK ?
|
||||||
|
StyleSVG()->mClipRule : StyleSVG()->mFillRule);
|
||||||
|
|
||||||
|
RefPtr<PathBuilder> builder =
|
||||||
|
aContext->GetDrawTarget()->CreatePathBuilder(fillRule);
|
||||||
|
if (!builder) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
RefPtr<Path> path =
|
||||||
|
static_cast<nsSVGPathGeometryElement*>(mContent)->BuildPath(builder);
|
||||||
|
if (!path) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (StyleSVG()->mShapeRendering) {
|
switch (StyleSVG()->mShapeRendering) {
|
||||||
case NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED:
|
case NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED:
|
||||||
@ -627,36 +648,17 @@ nsSVGPathGeometryFrame::Render(nsRenderingContext *aContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (renderMode == SVGAutoRenderState::CLIP_MASK) {
|
if (renderMode == SVGAutoRenderState::CLIP_MASK) {
|
||||||
FillRule newFillRule = nsSVGUtils::ToFillRule(StyleSVG()->mClipRule);
|
|
||||||
RefPtr<PathBuilder> builder =
|
|
||||||
aContext->GetDrawTarget()->CreatePathBuilder(newFillRule);
|
|
||||||
if (!builder) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
RefPtr<Path> path =
|
|
||||||
static_cast<nsSVGPathGeometryElement*>(mContent)->BuildPath(builder);
|
|
||||||
if (!path) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
gfxMatrix newMatrix =
|
|
||||||
gfx->CurrentMatrix().PreMultiply(aTransform).NudgeToIntegers();
|
|
||||||
if (newMatrix.IsSingular()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
gfxContextMatrixAutoSaveRestore autoSaveRestore(gfx);
|
|
||||||
gfx->SetMatrix(newMatrix);
|
|
||||||
|
|
||||||
FillRule oldFillRule = gfx->CurrentFillRule();
|
FillRule oldFillRule = gfx->CurrentFillRule();
|
||||||
gfx->SetFillRule(newFillRule);
|
gfxContextMatrixAutoSaveRestore autoSaveRestore(gfx);
|
||||||
|
|
||||||
|
gfx->SetMatrix(newMatrix);
|
||||||
|
gfx->SetFillRule(fillRule);
|
||||||
gfx->SetColor(gfxRGBA(1.0f, 1.0f, 1.0f, 1.0f));
|
gfx->SetColor(gfxRGBA(1.0f, 1.0f, 1.0f, 1.0f));
|
||||||
gfx->SetPath(path);
|
gfx->SetPath(path);
|
||||||
gfx->Fill();
|
gfx->Fill();
|
||||||
|
|
||||||
gfx->SetFillRule(oldFillRule);
|
gfx->SetFillRule(oldFillRule);
|
||||||
gfx->NewPath();
|
gfx->NewPath();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -664,8 +666,7 @@ nsSVGPathGeometryFrame::Render(nsRenderingContext *aContext,
|
|||||||
"Unknown render mode");
|
"Unknown render mode");
|
||||||
|
|
||||||
gfxContextAutoSaveRestore autoSaveRestore(gfx);
|
gfxContextAutoSaveRestore autoSaveRestore(gfx);
|
||||||
|
gfx->SetMatrix(newMatrix);
|
||||||
GeneratePath(gfx, ToMatrix(aTransform));
|
|
||||||
|
|
||||||
gfxTextContextPaint *contextPaint =
|
gfxTextContextPaint *contextPaint =
|
||||||
(gfxTextContextPaint*)aContext->GetDrawTarget()->GetUserData(&gfxTextContextPaint::sUserDataKey);
|
(gfxTextContextPaint*)aContext->GetDrawTarget()->GetUserData(&gfxTextContextPaint::sUserDataKey);
|
||||||
@ -674,8 +675,9 @@ nsSVGPathGeometryFrame::Render(nsRenderingContext *aContext,
|
|||||||
nsRefPtr<gfxPattern> fillPattern =
|
nsRefPtr<gfxPattern> fillPattern =
|
||||||
nsSVGUtils::MakeFillPatternFor(this, gfx, contextPaint);
|
nsSVGUtils::MakeFillPatternFor(this, gfx, contextPaint);
|
||||||
if (fillPattern) {
|
if (fillPattern) {
|
||||||
|
gfx->SetPath(path);
|
||||||
gfx->SetPattern(fillPattern);
|
gfx->SetPattern(fillPattern);
|
||||||
gfx->SetFillRule(nsSVGUtils::ToFillRule(StyleSVG()->mFillRule));
|
gfx->SetFillRule(fillRule);
|
||||||
gfx->Fill();
|
gfx->Fill();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -685,6 +687,7 @@ nsSVGPathGeometryFrame::Render(nsRenderingContext *aContext,
|
|||||||
nsRefPtr<gfxPattern> strokePattern =
|
nsRefPtr<gfxPattern> strokePattern =
|
||||||
nsSVGUtils::MakeStrokePatternFor(this, gfx, contextPaint);
|
nsSVGUtils::MakeStrokePatternFor(this, gfx, contextPaint);
|
||||||
if (strokePattern) {
|
if (strokePattern) {
|
||||||
|
gfx->SetPath(path);
|
||||||
nsSVGUtils::SetupCairoStrokeGeometry(this, gfx, contextPaint);
|
nsSVGUtils::SetupCairoStrokeGeometry(this, gfx, contextPaint);
|
||||||
gfx->SetPattern(strokePattern);
|
gfx->SetPattern(strokePattern);
|
||||||
gfx->Stroke();
|
gfx->Stroke();
|
||||||
|
Loading…
Reference in New Issue
Block a user