Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Scaled patterns are blurred

RESOLVED FIXED in mozilla10

Status

()

Core
SVG
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Robert Longson, Assigned: Robert Longson)

Tracking

({regression})

Trunk
mozilla10
regression
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 3 obsolete attachments)

(Assignee)

Description

6 years ago
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.
(Assignee)

Updated

6 years ago
Blocks: 535185
Depends on: 691646
(Assignee)

Comment 1

6 years ago
Created attachment 569330 [details] [diff] [review]
patch

I'll see if I can do a reftest for this.
Assignee: nobody → longsonr
(Assignee)

Updated

6 years ago
Keywords: regression
(Assignee)

Comment 2

6 years ago
Created attachment 569335 [details] [diff] [review]
patch with reftest
Attachment #569330 - Attachment is obsolete: true
Attachment #569335 - Flags: review?(dholbert)
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+.
(Assignee)

Comment 7

6 years ago
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.
(Assignee)

Comment 8

6 years ago
Created attachment 569636 [details] [diff] [review]
updated patch to address efficiency concerns
Attachment #569335 - Attachment is obsolete: true
Attachment #569335 - Flags: review?(dholbert)
Attachment #569636 - Flags: review?(dholbert)
(Assignee)

Comment 9

6 years ago
Created attachment 569638 [details] [diff] [review]
right patch
Attachment #569636 - Attachment is obsolete: true
Attachment #569636 - Flags: review?(dholbert)
Attachment #569638 - Flags: review?(dholbert)
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.
Attachment #569638 - Flags: review?(dholbert) → review+
(Assignee)

Comment 11

6 years ago
pushed https://hg.mozilla.org/integration/mozilla-inbound/rev/ff296aef84fe
Flags: in-testsuite+
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
Target Milestone: --- → mozilla10
(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.
https://hg.mozilla.org/mozilla-central/rev/ff296aef84fe
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.