Bug 99481

Summary: SVGImageCache is caching images at wrong resolution
Product: WebKit Reporter: Florin Malita <fmalita>
Component: SVGAssignee: Philip Rogers <pdr>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: bfulgham, cricri.bug, gyuyoung.kim, japhet, krit, pdr, qinmin, rakuco, rwlbuis, schenney, shezbaig.wk, thorton, webkit.review.bot, zimmermann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 99489, 106159    
Bug Blocks:    
Attachments:
Description Flags
Resource for resolution-test.svg
none
resolution-test.svg - shows a resampled image on reload.
none
Patch none

Description Florin Malita 2012-10-16 11:03:49 PDT
Created attachment 168978 [details]
Resource for resolution-test.svg

Chromium issue: http://code.google.com/p/chromium/issues/detail?id=119693

SVGImageCache::lookupOrCreateBitmapImageForRenderer() doesn't take transform scaling into account when calculating the image buffer size. Thus SVG images are cached at the wrong resolution and show resampling artifacts when served from cache (on page reload for example).

Open resolution-test.svg - a sharp-edged triangle is displayed.
Reload the page - the triangle is blurred (resampled from a low-res cached image).
Comment 1 Florin Malita 2012-10-16 11:13:14 PDT
Created attachment 168983 [details]
resolution-test.svg - shows a resampled image on reload.
Comment 2 Florin Malita 2012-10-16 12:22:01 PDT
Created attachment 168996 [details]
Patch
Comment 3 Florin Malita 2012-10-16 12:25:45 PDT
Unfortunately the test seems to only pass when run independently, for what appears to be another SVG image sizing bug (transform scale is ignored on the first load). I'll open a separate issue and mark it blocking.
Comment 4 Dirk Schulze 2012-10-16 15:14:14 PDT
If it should not get reviewed now, can you remove the flag then?
Comment 5 Florin Malita 2012-10-17 06:52:42 PDT
The patch should be ready for review.

What I meant is that (at least on my workstation) the new test is failing when run in batch mode for an unrelated reason. That doesn't seem to be a problem on the bots though, and even if it turns out to be we can mark it failing and point to the separate bug I've opened.
Comment 6 Nikolas Zimmermann 2012-10-21 07:48:09 PDT
This seems to clash with bug 98403. Can you make sure the more general patch in bug 98403 fixes your issues as well?
Comment 7 Tim Horton 2012-12-11 05:59:12 PST
*** Bug 85335 has been marked as a duplicate of this bug. ***
Comment 8 Min Qin 2013-02-07 11:22:10 PST
ping. Any progress on this?

Not taking CSS transform into consideration can put a lot of memory pressure on devices like android.
Comment 9 Dirk Schulze 2013-02-15 23:40:12 PST
Comment on attachment 168996 [details]
Patch

I gues this is not valid anymore. Can you remove the review flag and close the bug? Or do I miss something?
Comment 10 Philip Rogers 2013-02-28 13:15:27 PST
Comment on attachment 168996 [details]
Patch

We now properly handle this. Clearing the review flag.