Bug 170577 - A synchronous DecodingOptions should be compatible with any asynchronous sizeForDrawing DecodingOptions
Summary: A synchronous DecodingOptions should be compatible with any asynchronous size...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-04-06 17:15 PDT by Said Abou-Hallawa
Modified: 2017-04-08 19:39 PDT (History)
4 users (show)

See Also:


Attachments
Patch (8.43 KB, patch)
2017-04-06 17:19 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
To be referenced by the test case (11.61 KB, image/png)
2017-04-06 18:07 PDT, Said Abou-Hallawa
no flags Details
test case (991 bytes, text/html)
2017-04-06 18:07 PDT, Said Abou-Hallawa
no flags Details
Patch (8.43 KB, patch)
2017-04-08 15:22 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2017-04-06 17:15:23 PDT
This prevents the following repaint infinite loop:

Suppose I have two elements 'x' and 'y' and 'y' is the parent of 'x'. Both 'x' and 'y' are using the image 'm' to draw their background. 'x' does not repeat the background while 'y' does.

1. 'x' draws its background.
2. 'm' is not decoded, so request async image decoding for 'm' since it is a large image.
3. 'm' finishes decoding, it repaints the rectangle of 'x'.
4. Repainting the rectangle of 'x' causes a repaint for 'y' as well.
5. To paint 'y', 'm' will be used to draw a pattern.
6. To draw a pattern of 'm', a synchronous decoded frame has to be obtained so the one that finished decoding is now deleted.
7. Now goto step 1

This loops will runs forever. To prevent this loop from happening, once a synchronous decoded frame is found, there is no need to decode it again. This decoded frame is suitable for any sizeForDrawing.
Comment 1 Said Abou-Hallawa 2017-04-06 17:19:41 PDT
Created attachment 306442 [details]
Patch
Comment 2 Said Abou-Hallawa 2017-04-06 17:20:37 PDT
<rdar://problem/31465804>
Comment 3 Said Abou-Hallawa 2017-04-06 18:07:14 PDT
Created attachment 306451 [details]
To be referenced by the test case
Comment 4 Said Abou-Hallawa 2017-04-06 18:07:57 PDT
Created attachment 306452 [details]
test case
Comment 5 Simon Fraser (smfr) 2017-04-07 17:32:53 PDT
Comment on attachment 306442 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=306442&action=review

> Source/WebCore/ChangeLog:8
> +        Test: fast/images/async-image-background-image-repeated.html

This should go below the paragraph below.

> Source/WebCore/platform/graphics/DecodingOptions.h:76
> +        // Comparing DedocingOptions with isAsynchronous() should not happen.

"DedocingOptions"
Comment 6 Said Abou-Hallawa 2017-04-08 15:22:39 PDT
Created attachment 306584 [details]
Patch
Comment 7 WebKit Commit Bot 2017-04-08 19:39:31 PDT
Comment on attachment 306584 [details]
Patch

Clearing flags on attachment: 306584

Committed r215157: <http://trac.webkit.org/changeset/215157>
Comment 8 WebKit Commit Bot 2017-04-08 19:39:32 PDT
All reviewed patches have been landed.  Closing bug.