Bug 5526

Summary: SVGs with filters look grainy when scaled
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: abarth, emacemac7, eric, ian, jeffschiller, krit, ossy, webkit.review.bot
Priority: P4 Keywords: HasReduction
Version: 523.x (Safari 3)   
Hardware: Macintosh   
OS: OS X 10.4   
URL: http://svg-whiz.com/svg/firefox-logo.svg
Bug Depends on: 11980, 19835, 19991    
Bug Blocks: 68469, 5579, 26389    

Description Eric Seidel (no email) 2005-10-28 00:44:11 PDT
SVGs with filters look grainy when scaled

Currently we apply filters according to the abstract coordinate system of the graphic, NOT the device 
coordinate system (i.e. the final pixel coords when drawn to the screen).  This can be *bad* for a couple 
reasons.

1.  When you scale the resulting pixels, the result looks grainy.
2.  You can end up rendering 6 billion pixels and only using 1% of that if that part of the image is 
scaled down.

A couple ways to solve this:
1.  Just figure out what the final CTM for the item/group in question and render only the necessary 
number of pixels.
2.  (Better!) *delay* compositing of the result image.  Instead pass the CIImage back to the parent 
container (the one calling draw()) and let it do the compositing (or apply it's own filters using that 
CIImage as an input).  When you finally have to do the compositing, figure out the absolute CTM, etc.

I guess 2. is really just an optimized version of 1.  In either case, this will need to be solved.
Comment 1 Eric Seidel (no email) 2005-12-06 04:57:55 PST
Erick said he would take a crack at this.
Comment 2 Dirk Schulze 2009-08-19 06:47:30 PDT
If I understand your comment right, we do this right now. I scaled the feGaussianBlur and feColorMatrix of the W3C test suite and i don't see pixels. But maybe this is a result of antialiasing?
Comment 3 Dirk Schulze 2010-10-06 02:46:19 PDT
Committed r69181: <http://trac.webkit.org/changeset/69181>
Comment 5 Dirk Schulze 2010-10-06 03:56:49 PDT
Committed r69182: <http://trac.webkit.org/changeset/69182>
Comment 6 Dirk Schulze 2010-10-06 05:48:20 PDT
Committed r69187: <http://trac.webkit.org/changeset/69187>
Comment 7 Dirk Schulze 2010-10-06 06:01:18 PDT
This bug was fixed with the patch on bug 31370. Marking this bug as duplication of 31370 because fixes for the patch mention this bug. Sorry for that.

*** This bug has been marked as a duplicate of bug 31370 ***
Comment 8 WebKit Review Bot 2010-10-06 08:42:54 PDT
http://trac.webkit.org/changeset/69187 might have broken GTK Linux 32-bit Debug
Comment 9 WebKit Review Bot 2010-10-06 08:43:03 PDT
http://trac.webkit.org/changeset/69188 might have broken GTK Linux 32-bit Debug