WebKit Bugzilla
Attachment 341219 Details for
Bug 185956
: Enable subsampling for progressive JPEG images
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185956-20180524131458.patch (text/plain), 3.58 KB, created by
Chris Dumez
on 2018-05-24 13:14:58 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-05-24 13:14:58 PDT
Size:
3.58 KB
patch
obsolete
>Subversion Revision: 232157 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a2b43d66ac8d88b7c8ae63784ce27470b2933180..85b722211161abc84116abb34a4ef095b16c352a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2018-05-24 Chris Dumez <cdumez@apple.com> >+ >+ Optimize ImageDecoderCG::frameAllowSubsamplingAtIndex() for non-JPEG images >+ https://bugs.webkit.org/show_bug.cgi?id=185956 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ ImageDecoderCG::frameAllowSubsamplingAtIndex() currently checks if the image is a Progressive >+ JPEG. We do not need CGImageSourceCopyPropertiesAtIndex() for non-JPEG images so we can return >+ early based on a UTI check. >+ >+ * platform/graphics/cg/ImageDecoderCG.cpp: >+ (WebCore::computeIsProgressive): >+ (WebCore::ImageDecoderCG::frameAllowSubsamplingAtIndex const): >+ > 2018-05-24 Chris Dumez <cdumez@apple.com> > > [iOS WK2] Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/update-after-navigation-fetch-event.https.html is a flaky failure >diff --git a/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp b/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp >index 6c757c48475df99e80b87d3f58205439ec0b45a0..bfb63ae3049b5ae099edd473de173135b36ca7f9 100644 >--- a/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp >+++ b/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp >@@ -364,25 +364,32 @@ Seconds ImageDecoderCG::frameDurationAtIndex(size_t index) const > return duration; > } > >-bool ImageDecoderCG::frameAllowSubsamplingAtIndex(size_t) const >+static bool computeIsProgressive(CGImageSourceRef nativeDecoder) > { >- RetainPtr<CFDictionaryRef> properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), 0, imageSourceOptions().get())); >+ RetainPtr<CFDictionaryRef> properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(nativeDecoder, 0, imageSourceOptions().get())); > if (!properties) > return false; >- >+ > CFDictionaryRef jfifProperties = static_cast<CFDictionaryRef>(CFDictionaryGetValue(properties.get(), kCGImagePropertyJFIFDictionary)); > if (jfifProperties) { > CFBooleanRef isProgCFBool = static_cast<CFBooleanRef>(CFDictionaryGetValue(jfifProperties, kCGImagePropertyJFIFIsProgressive)); >- if (isProgCFBool) { >- bool isProgressive = CFBooleanGetValue(isProgCFBool); >- // Workaround for <rdar://problem/5184655> - Hang rendering very large progressive JPEG. Decoding progressive >- // images hangs for a very long time right now. Until this is fixed, don't sub-sample progressive images. This >- // will cause them to fail our large image check and they won't be decoded. >- // FIXME: Remove once underlying issue is fixed (<rdar://problem/5191418>) >- return !isProgressive; >- } >+ if (isProgCFBool) >+ return CFBooleanGetValue(isProgCFBool); > } >+ >+ return false; >+} >+ >+bool ImageDecoderCG::frameAllowSubsamplingAtIndex(size_t) const >+{ >+ // Workaround for <rdar://problem/5184655> - Hang rendering very large progressive JPEG. Decoding progressive >+ // images hangs for a very long time right now. Until this is fixed, don't sub-sample progressive images. This >+ // will cause them to fail our large image check and they won't be decoded. >+ // FIXME: Remove once underlying issue is fixed (<rdar://problem/5191418>) >+ if (uti() == "public.jpeg") >+ return !computeIsProgressive(m_nativeDecoder.get()); > >+ ASSERT(!computeIsProgressive(m_nativeDecoder.get())); > return true; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185956
:
341219
|
341227