Bug 171467

Summary: Async image decoding should be disabled for snapshots, printing and preview
Product: WebKit Reporter: Said Abou-Hallawa <sabouhallawa>
Component: ImagesAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, 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
Patch
none
Patch
none
Patch none

Description Said Abou-Hallawa 2017-04-28 17:21:15 PDT
Async image decoding should only be used for window display where RenderElements can be repainted and painted. For cases where there is only one chance to draw the image, synchronous decoding should be used.
Comment 1 Said Abou-Hallawa 2017-04-28 17:22:03 PDT
Created attachment 308625 [details]
Patch
Comment 2 Said Abou-Hallawa 2017-04-28 17:23:48 PDT
<rdar://problem/31308092>
Comment 3 Simon Fraser (smfr) 2017-05-01 10:51:20 PDT
Comment on attachment 308625 [details]
Patch

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

> Source/WebCore/page/FrameView.cpp:4410
> +        frame().settings().setLargeImageAsyncDecodingEnabled(false);

We don't generally toggle settings as a way of setting temporary runtime state; toggling settings can have side effects like all-frame style recalcs.

Why not just test (view().frameView().paintBehavior() & PaintBehaviorFlattenCompositingLayers) as we do in RenderBox::paintMaskImages?
Comment 4 Said Abou-Hallawa 2017-05-01 12:32:16 PDT
Created attachment 308748 [details]
Patch
Comment 5 Simon Fraser (smfr) 2017-05-01 14:16:29 PDT
Is this testable (say, with an API test)?
Comment 6 Said Abou-Hallawa 2017-05-03 10:23:06 PDT
Created attachment 308921 [details]
Patch
Comment 7 Simon Fraser (smfr) 2017-05-03 11:26:02 PDT
Comment on attachment 308921 [details]
Patch

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

> Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewSnapshot.mm:271
> +        CGContextRef context = CGBitmapContextCreate(rgba, viewWidth, viewHeight, 8, 4 * viewWidth, colorSpace.get(), kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);

We we use RetainPtr<> = adoptCF() here?
Comment 8 Said Abou-Hallawa 2017-05-03 11:56:48 PDT
Created attachment 308935 [details]
Patch
Comment 9 WebKit Commit Bot 2017-05-03 12:43:46 PDT
Comment on attachment 308935 [details]
Patch

Clearing flags on attachment: 308935

Committed r216135: <http://trac.webkit.org/changeset/216135>
Comment 10 WebKit Commit Bot 2017-05-03 12:43:47 PDT
All reviewed patches have been landed.  Closing bug.