RESOLVED FIXED 172405
[CG] Use the SPI CGImageSourceGetTypeWithData() to get the typeIdentifierHint of an image
https://bugs.webkit.org/show_bug.cgi?id=172405
Summary [CG] Use the SPI CGImageSourceGetTypeWithData() to get the typeIdentifierHint...
Said Abou-Hallawa
Reported 2017-05-19 17:57:30 PDT
I tried using CGImageSourceGetTypeWithURL() to get the typeIdentifierHint of an image. The typeIdentifierHint helps the CGImageSource choose the correct decoder from the beginning. This function works but it was very costly since it opens or loads the image file and read its header to guess its type. Opening and reading a local file takes many cycles to finish. Requesting the image resource through the network doubles the network traffic. Since we create the ImageDecoder when we first receive data from the network layer, we can use CGImageSourceGetTypeWithData() instead.
Attachments
Patch (12.54 KB, patch)
2017-05-19 18:44 PDT, Said Abou-Hallawa
no flags
Archive of layout-test-results from ews107 for mac-elcapitan-wk2 (632.73 KB, application/zip)
2017-05-19 19:38 PDT, Build Bot
no flags
Archive of layout-test-results from ews112 for mac-elcapitan (610.05 KB, application/zip)
2017-05-19 19:49 PDT, Build Bot
no flags
Archive of layout-test-results from ews100 for mac-elcapitan (941.15 KB, application/zip)
2017-05-19 23:22 PDT, Build Bot
no flags
Patch (10.13 KB, patch)
2017-05-20 23:54 PDT, Said Abou-Hallawa
no flags
Archive of layout-test-results from ews115 for mac-elcapitan (1.56 MB, application/zip)
2017-05-21 02:13 PDT, Build Bot
no flags
Patch (10.13 KB, patch)
2017-05-21 16:48 PDT, Said Abou-Hallawa
no flags
Said Abou-Hallawa
Comment 1 2017-05-19 18:44:55 PDT
Said Abou-Hallawa
Comment 2 2017-05-19 18:48:32 PDT
Build Bot
Comment 3 2017-05-19 19:38:00 PDT
Comment on attachment 310744 [details] Patch Attachment 310744 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/3780516 Number of test failures exceeded the failure limit.
Build Bot
Comment 4 2017-05-19 19:38:01 PDT
Created attachment 310748 [details] Archive of layout-test-results from ews107 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Build Bot
Comment 5 2017-05-19 19:49:17 PDT
Comment on attachment 310744 [details] Patch Attachment 310744 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/3780510 Number of test failures exceeded the failure limit.
Build Bot
Comment 6 2017-05-19 19:49:18 PDT
Created attachment 310750 [details] Archive of layout-test-results from ews112 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews112 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 7 2017-05-19 23:22:20 PDT
Comment on attachment 310744 [details] Patch Attachment 310744 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/3781468 Number of test failures exceeded the failure limit.
Build Bot
Comment 8 2017-05-19 23:22:21 PDT
Created attachment 310764 [details] Archive of layout-test-results from ews100 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Said Abou-Hallawa
Comment 9 2017-05-20 23:54:02 PDT
Build Bot
Comment 10 2017-05-21 02:13:43 PDT
Comment on attachment 310800 [details] Patch Attachment 310800 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/3787601 New failing tests: imported/w3c/web-platform-tests/media-source/mediasource-buffered.html
Build Bot
Comment 11 2017-05-21 02:13:44 PDT
Created attachment 310805 [details] Archive of layout-test-results from ews115 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Said Abou-Hallawa
Comment 12 2017-05-21 16:48:40 PDT
Simon Fraser (smfr)
Comment 13 2017-05-22 13:38:57 PDT
Comment on attachment 310820 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=310820&action=review > Source/WebCore/platform/graphics/ImageTypes.h:30 > +#if USE(CG) > +typedef struct CGImageSource* CGImageSourceRef; > +#endif Why did this move?
Said Abou-Hallawa
Comment 14 2017-05-22 13:54:52 PDT
Comment on attachment 310820 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=310820&action=review >> Source/WebCore/platform/graphics/ImageTypes.h:30 >> +#endif > > Why did this move? I am planning to merge the following header files Source/WebCore/platform/graphics/cg/ImageDecoderCG.h Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.h Source/WebCore/platform/image-decoders/ImageDecoder.h in one file: Source/WebCore/platform/graphics/ImageDecoder.h So I have been cleaning these header files to make it easy when they are merged.
WebKit Commit Bot
Comment 15 2017-05-22 14:23:27 PDT
Comment on attachment 310820 [details] Patch Clearing flags on attachment: 310820 Committed r217246: <http://trac.webkit.org/changeset/217246>
WebKit Commit Bot
Comment 16 2017-05-22 14:23:30 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.