Bug 99481 - SVGImageCache is caching images at wrong resolution
Summary: SVGImageCache is caching images at wrong resolution
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Philip Rogers
URL:
Keywords:
: 85335 (view as bug list)
Depends on: 99489 106159
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-16 11:03 PDT by Florin Malita
Modified: 2022-07-15 15:36 PDT (History)
14 users (show)

See Also:


Attachments
Resource for resolution-test.svg (404 bytes, image/svg+xml)
2012-10-16 11:03 PDT, Florin Malita
no flags Details
resolution-test.svg - shows a resampled image on reload. (421 bytes, image/svg+xml)
2012-10-16 11:13 PDT, Florin Malita
no flags Details
Patch (23.14 KB, patch)
2012-10-16 12:22 PDT, Florin Malita
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.