bug 691646 fixed one way that patterns become blurred but broke another - bug 535185. In bug 535185 the pattern is small and is scaled when it's used. In bug 691646 the pattern has a patternTransform which scales it. We need to account for both scalings when determining the size of the pattern to create.
Created attachment 569330 [details] [diff] [review] patch I'll see if I can do a reftest for this.
Created attachment 569335 [details] [diff] [review] patch with reftest
Looks like pattern-scale-01a.svg and pattern-scale-01-ref.svg are missing from the patch.
oh, sorry -- the ref already exists, and "a" is renamed from an existing file. Cool. Darn bugzilla's diff viewer.
Comment on attachment 569335 [details] [diff] [review] patch with reftest >@@ -254,21 +254,23 @@ nsSVGPatternFrame::PaintPattern(gfxASurf > // routine. > *patternMatrix = GetPatternMatrix(bbox, callerBBox, callerCTM); [...] >+ float scale = nsSVGUtils::MaxExpansion(callerCTM); >+ > bool resultOverflows; > gfxIntSize surfaceSize = > nsSVGUtils::ConvertToSurfaceSize( >- gfxSize(patternWidth * fabs(patternMatrix->xx), >- patternHeight * fabs(patternMatrix->yy)), >+ gfxSize(patternWidth * fabs(patternMatrix->xx) * scale, >+ patternHeight * fabs(patternMatrix->yy) * scale), > &resultOverflows); Why do we need this extra "scale" factor? Shouldn't we already be getting all the scaling information that we need from |callerCTM| when we create patternMatrix, in the "GetPatternMatrix(..., callerCTM)" call? See also bug 691646 comment 13... Perhaps that helps with this?
Actually I'm less sure about bug 691646 comment 13 now, as noted there, so disregard that for now. However, I'm still a little iffy on the patch here... Note that GetPatternMatrix() already involves a scale by 1/MaxExpansion(callerCTM), so your attached patch here is basically reversing that scale, for the purposes of the surface-size computation. That seems like it could be extra work. Perhaps we really want to remove that scale from GetPatternMatrix completely? (possibly lifting it up to this method, and applying it to patternMatrix after we've computed the surfaceSize?) I'm not sure -- I don't totally grok what's going on here. I'd like to get a better idea of why the patch here (or its successor) is correct, before granting r+.
We only want to apply the patternTransform scaling (the scaling in the pattern) without the callerCTM (i.e. the scaling on to the object). You are right in that we're multiplying and dividing in by MaxExpansion order to get the number we'd get from GetPatternTransform directly.
Created attachment 569636 [details] [diff] [review] updated patch to address efficiency concerns
Created attachment 569638 [details] [diff] [review] right patch
Comment on attachment 569638 [details] [diff] [review] right patch Could you put a short chunk of documentation over nsSVGPatternFrame::GetPatternMatrix() (either the decl or the impl), to reflect its new usage? r=me with that.
Do you think this could have caused the following regressions? Talos Regression :( V8 increase 2.78% on MacOSX 10.6.2 (rev3) Mozilla-Inbound Talos Regression :( Dromaeo (String/Array/Eval/Regex) decrease 4.17% on MacOSX 10.6.2 (rev3) Mozilla-Inbound https://groups.google.com/forum/#!topic/mozilla.dev.tree-management/w2WZEx3ugn0
(In reply to Ed Morley [:edmorley] from comment #12) > Do you think this could have caused the following regressions? No. The patch *only* touched code for the <pattern> element in SVG, so it has no effect on non-SVG content. (I'd be very surprised if either of those test suites included SVG at all, let alone SVG <pattern> elements.) I'm guessing that the treewatcher bot might have mis-attributed blame here, and the real guilty party might be immediately before/after (or maybe an infra change?)
(In reply to Daniel Holbert [:dholbert] from comment #13) > No. The patch *only* touched code for the <pattern> element in SVG Ah yes. Sorry was in a rush so forgot to actually check the diff :$
No problem; thanks for your vigilance! This does look like a real regression (with unknown cause so far) -- let's follow up in m.d.tree-management.