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.
Created attachment 310744 [details] Patch
<rdar://problem/31899716>
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.
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
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.
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
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.
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
Created attachment 310800 [details] Patch
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
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
Created attachment 310820 [details] Patch
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?
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.
Comment on attachment 310820 [details] Patch Clearing flags on attachment: 310820 Committed r217246: <http://trac.webkit.org/changeset/217246>
All reviewed patches have been landed. Closing bug.