-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CG] Optimize getting the ImageFrame metadata #28799
[CG] Optimize getting the ImageFrame metadata #28799
Conversation
EWS run on previous version of this PR (hash d8c4323) |
d8c4323
to
9fef97e
Compare
EWS run on previous version of this PR (hash 9fef97e) |
@@ -147,4 +152,21 @@ bool ImageDecoder::supportsMediaType(MediaType type) | |||
return false; | |||
} | |||
|
|||
bool ImageDecoder::frameMetadataAtIndex(size_t index, SubsamplingLevel subsamplingLevel, const DecodingOptions& options, ImageFrame& frame) const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name is a bit vague. From the call site it's hard to see that this is filling some members of frame
. Maybe fetchFrameMetaDataAtIndex()
?
9fef97e
to
dfb0a0d
Compare
EWS run on current version of this PR (hash dfb0a0d) |
https://bugs.webkit.org/show_bug.cgi?id=274399 rdar://126232516 Reviewed by Simon Fraser. BitmapImageSource::cacheMetadataAtIndex() currently makes separate calls to ImageDecoder functions. Some of them calls CGImageSourceCopyPropertiesAtIndex() and we end up calling CGImageSourceCopyPropertiesAtIndex() multiple times. This can be optimized by adding ImageDecoder::frameMetadataAtIndex() which fills in the ImageFrame metadata. This way CGImageSourceCopyPropertiesAtIndex() will be called once and its CFDictionary will be used to retrieve all the ImageFrame metadata. * Source/WebCore/platform/graphics/BitmapImageSource.cpp: (WebCore::BitmapImageSource::cacheMetadataAtIndex): * Source/WebCore/platform/graphics/ImageDecoder.cpp: (WebCore::ImageDecoder::fetchFrameMetaDataAtIndex const): * Source/WebCore/platform/graphics/ImageDecoder.h: (WebCore::ImageDecoder::frameDensityCorrectedSizeAtIndex const): (WebCore::ImageDecoder::densityCorrectedSizeAtIndex const): Deleted. * Source/WebCore/platform/graphics/ImageFrame.h: * Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::frameSizeFromProperties): (WebCore::ImageDecoderCG::encodedDataStatus const): (WebCore::ImageDecoderCG::hasAlpha const): (WebCore::ImageDecoderCG::frameSizeAtIndex const): (WebCore::ImageDecoderCG::frameOrientationAtIndex const): (WebCore::ImageDecoderCG::frameDensityCorrectedSizeAtIndex const): (WebCore::ImageDecoderCG::frameHasAlphaAtIndex const): (WebCore::ImageDecoderCG::fetchFrameMetaDataAtIndex const): (WebCore::ImageDecoderCG::decodeUTI): (WebCore::ImageDecoderCG::shouldUseQuickLookForFullscreen const): (WebCore::ImageDecoderCG::densityCorrectedSizeAtIndex const): Deleted. * Source/WebCore/platform/graphics/cg/ImageDecoderCG.h: * Source/WebCore/platform/image-decoders/ScalableImageDecoder.h: Canonical link: https://commits.webkit.org/279069@main
dfb0a0d
to
828ba37
Compare
Committed 279069@main (828ba37): https://commits.webkit.org/279069@main Reviewed commits have been landed. Closing PR #28799 and removing active labels. |
828ba37
dfb0a0d
π§ͺ wpe-wk2π§ͺ ios-wk2π§ͺ ios-wk2-wptπ§ͺ api-iosπ§ͺ mac-AS-debug-wk2π§ͺ gtk-wk2π tv-simπ§ͺ api-gtkπ watch