Bug 171467 - Async image decoding should be disabled for snapshots, printing and preview
Summary: Async image decoding should be disabled for snapshots, printing and preview
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-28 17:21 PDT by Said Abou-Hallawa
Modified: 2017-05-03 12:43 PDT (History)
5 users (show)

See Also:


Attachments
Patch (4.64 KB, patch)
2017-04-28 17:22 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (3.29 KB, patch)
2017-05-01 12:32 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (11.18 KB, patch)
2017-05-03 10:23 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (12.33 KB, patch)
2017-05-03 11:56 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-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.