Closed Bug 1015575 Opened 11 years ago Closed 9 years ago

SVG fuzzy/pixelated if SVG was exported with a filter and used as a css background-image

Categories

(Core :: SVG, defect)

29 Branch
defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 1224207

People

(Reporter: demorus, Assigned: u459114)

References

(Blocks 1 open bug)

Details

(Keywords: regression, testcase)

Attachments

(5 files, 2 obsolete files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36 Steps to reproduce: 1. I created a normal vector shape with an SVG shadow filter with Illustrator CS6. 2. Exported it as a SVG 1.1 3. Created a simple div 4. Gave that div a width of 100% and a bottom padding of 10%. Added svg as a background with no-repeat. The background-size is set to 100% or cover. 5. Preview in Firefox 29 Actual results: The SVG background image scaled up and fits on various screen sizes as expected but the image looks like a horribly scaled bitmap image. It is also extremely blurry. This does not happen when exporting the SVG without a filter or when I use the SVG as an IMG element. Expected results: The background-image should be crisp and clean when scaled. It should be treated as a actual vector grafic. It works perfectly in chrome or when used as an IMG element. This feature is really important for fluid designs.
Severity: normal → major
Priority: -- → P1
Hardware: x86_64 → All
Reproduced on Windows 7, 64 bits, with Firefox 30 Beta 7 (User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0) following the steps to reproduce (except for using Inkscape instead of Adobe Illustrator). As the reporter said, it happens only with svg images that have filters; also, it's not reproducible on Google Chrome.
Status: UNCONFIRMED → NEW
Component: Untriaged → SVG
Ever confirmed: true
Product: Firefox → Core
Whiteboard: [bugday-20140526]
Attached file svg_test.rar (obsolete) —
Add testcase. To see the difference between the rendering of svg images with filters and without filters, change the url of the background image from "red_circle_shadow.svg" to "red_circle.svg".
Is this a regression from bug 764299?
Priority: P1 → --
Summary: SVG treated as bitmap if SVG was exported with a filter and used as a css background-image → SVG fuzzy/pixelated if SVG was exported with a filter and used as a css background-image
Attached file testcase (obsolete) —
c.htm is without filters cs.htm is with filters
Attachment #8428717 - Attachment is obsolete: true
both are fuzzy: 2012-06-24-03-05-37-mozilla-central-firefox-16.0a1.en-US.linux-x86_64 both: 2013-01-17-03-09-33-mozilla-central-firefox-21.0a1.en-US.linux-x86_64 both: 2013-05-26-03-10-46-mozilla-central-firefox-24.0a1.en-US.linux-x86_64 -g 2013-06-23-03-10-22-mozilla-central-firefox-24.0a1.en-US.linux-x86_64 -g 2013-07-09-03-02-04-mozilla-central-firefox-25.0a1.en-US.linux-x86_64 >-g 2013-07-17-03-02-07-mozilla-central-firefox-25.0a1.en-US.linux-x86_64 0888e29c83a3 >-b 2013-07-18-03-02-01-mozilla-central-firefox-25.0a1.en-US.linux-x86_64 f26e4c26ce4a -b 2013-07-19-03-02-04-mozilla-central-firefox-25.0a1.en-US.linux-x86_64 -b 2013-07-21-03-02-03-mozilla-central-firefox-25.0a1.en-US.linux-x86_64 -b 2013-07-25-17-15-58-mozilla-central-firefox-25.0a1.en-US.linux-x86_64 -b 2013-10-02-03-02-01-mozilla-central-firefox-27.0a1.en-US.linux-x86_64 -b 2014-01-28-03-17-16-mozilla-central-firefox-29.0a1.en-US.linux-x86_64 https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=0888e29c83a3&tochange=f26e4c26ce4a There is bug 885939.
QA Whiteboard: [bugday-20140526]
Keywords: regression
OS: Windows 7 → All
Hope mozilla is working on it
Not really (at least not according to this bug), except for QA.
Blocks: 885939
Whiteboard: [bugday-20140526]
Hi Daniel, may you help on this bug? This affects Firefox OS also, that would be great if this get fixed. Thank you!
Flags: needinfo?(dholbert)
Attachment #8459517 - Attachment mime type: text/plain → image/xml+svg
Attachment #8459517 - Attachment mime type: image/xml+svg → image/svg+xml
Attachment #8459518 - Attachment mime type: text/plain → image/svg+xml
Attachment #8459519 - Attachment mime type: text/plain → text/html
Attachment #8459519 - Attachment description: cs.html → c.html
Attachment #8459520 - Attachment mime type: text/plain → text/html
Attachment #8459519 - Attachment description: c.html → c.html (semi-reference case; using red_circle.svg)
Flags: needinfo?(dholbert)
Attachment #8459520 - Attachment description: cs.html → cs.html (testcase; using red_circle_shadow.svg)
Flags: needinfo?(dholbert)
So, a bit of diagnosis: - Bug 885939 (which regressed this, per comment 5) changed the way we draw scaled-up SVG images. Previously, we'd synthesize a large viewport for the SVG image to be rendered into, and let SVG draw itself, scaled-using-[maybe-synthesized]-viewBox, into that viewport. After that bug, we don't bother with the viewport adjustment; instead, we call Scale() on the gfxContext. - This works because drawing is done via that gfxContext. - EXCEPT, drawing of filters is done using intermediate DrawTargets that are separate from that gfxContext. And those intermediate DrawTargets' sizing is based on "user space" from the SVG image's perspective (which doesn't know about the gfxContext->Scale() scaling-factor). Something like that, at least. In particular, we draw the circle (for filtering) in nsFilterInstance::BuildSourceImage(), which relies on mSourceGraphic.mNeededBounds to establish the size of the intermediate drawTarget that we'll create. And mSourceGraphic.mNeededBounds doesn't take the gfxContext's scaling factor into account.
No longer blocks: 1021527
Blocks: 1213622
Assignee: nobody → cku
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Flags: needinfo?(dholbert)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: