Bug 379123 - filters on objects with some matrices not displayed.

r=longsonr, sr=roc


git-svn-id: svn://10.0.0.236/trunk@229813 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
tor%cs.brown.edu
2007-07-12 15:42:30 +00:00
parent f56a95b8b7
commit ea8d906713

View File

@@ -185,15 +185,24 @@ nsSVGFilterFrame::FilterPaint(nsSVGRenderState *aContext,
nsSVGUtils::ConvertToSurfaceSize(gfxSize(filterResX, filterResY),
&resultOverflows);
} else {
float s1, s2;
ctm->GetA(&s1);
ctm->GetD(&s2);
float a, b, c, d;
ctm->GetA(&a);
ctm->GetB(&b);
ctm->GetC(&c);
ctm->GetD(&d);
// maximum expansion derivation from
// http://lists.cairographics.org/archives/cairo/2004-October/001980.html
float f = (a * a + b * b + c * c + d * d) / 2;
float g = (a * a - b * b + c * c - d * d) / 2;
float h = a * b + c * d;
float scale = sqrt(f + sqrt(g * g + h * h));
#ifdef DEBUG_tor
fprintf(stderr, "scales: %f %f\n", s1, s2);
fprintf(stderr, "scale: %f\n", scale);
#endif
filterRes =
nsSVGUtils::ConvertToSurfaceSize(gfxSize(s1 * width, s2 * height),
nsSVGUtils::ConvertToSurfaceSize(gfxSize(width, height) * scale,
&resultOverflows);
}