REGRESSION(198782): ImageSource::subsamplingLevelForScale() does not cache the Maximu...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Apr 2016 17:02:57 +0000 (17:02 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Apr 2016 17:02:57 +0000 (17:02 +0000)
commit7c0fbe3af1eb21806c257115436f468297e80b66
tree265fa1add1ad3e3f1405b0f70e5fddb8f5dda59a
parent4ab5d0c0c786b9c72b9bf88aab6edc201d0fa723
REGRESSION(198782): ImageSource::subsamplingLevelForScale() does not cache the MaximumSubsamplingLevel for this ImageSource
https://bugs.webkit.org/show_bug.cgi?id=156766

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-04-21
Reviewed by Darin Adler.

Ensure the MaximumSubsamplingLevel for the ImageSource is calculated
only once and is cached for subsequent uses.

The image subsampling is on by default only for iOS. So the and this
patch currently affects the iOS port.

* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::cacheMetadata): Cache m_maximumSubsamplingLevel.
Use m_frameCount as a flag for having_the_cache_done.
(WebCore::ImageSource::subsamplingLevelForScale): Call cacheMetadata()
before using m_maximumSubsamplingLevel.
(WebCore::ImageSource::frameCount): Call cacheMetadata() before returning
m_frameCount.
* platform/graphics/ImageSource.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ImageSource.cpp
Source/WebCore/platform/graphics/ImageSource.h