Bug 169473 - REGRESSION(r213618): Large async image decoding should only be requested at the time the BitmapImage is drawn
Summary: REGRESSION(r213618): Large async image decoding should only be requested at t...
Status: RESOLVED DUPLICATE of bug 165039
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-03-10 09:31 PST by Said Abou-Hallawa
Modified: 2017-03-10 10:18 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2017-03-10 09:31:56 PST
In <http://trac.webkit.org/changeset/213618>, the large async image decoding was requested for all the images in the tileCoverageRect of the tileGrid. This turned out to be inefficient approach because tileCoverageRect represents the rectangle from the page that should be cached in tiles. This rectangle includes dirty and clean rectangles. But when requesting the async image decoding, we enumerate all the images in tileCoverageRect regardless whether they are in dirty rects, i.e. they are going to be drawn. Or they are in clean rects, i.e. they are not going to be drawn.

This causes more CPU to be wasted needlessly. And more importantly a memory regression due to aggressive async decoding for images which are not going to be drawn. These images were drawn on tiles and those tiles were kept clean so their frames were destroyed by the MemoryCache to keep the memory under control. But requesting the async decoding for those images, bring their frames back to memory.

The fix is to request the async image decoding only at the time that a BitmapImage is drawn. This is the time that we are sure, a BitmapImage needs to be drawn. It also fixes the scaling and transformation that we need to apply to sizeForDrawing since all of them have to be applied to the GraphicsContext.
Comment 1 Said Abou-Hallawa 2017-03-10 09:33:21 PST
<rdar://problem/30948700>
Comment 2 Said Abou-Hallawa 2017-03-10 10:18:53 PST
<http://trac.webkit.org/changeset/213618> was rolled out. No need for this bug anymore.

*** This bug has been marked as a duplicate of bug 165039 ***