Bug 170577

Summary: A synchronous DecodingOptions should be compatible with any asynchronous sizeForDrawing DecodingOptions
Product: WebKit Reporter: Said Abou-Hallawa <sabouhallawa>
Component: ImagesAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
To be referenced by the test case
none
test case
none
Patch none

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.