Don't attempt to destroy decoded frame if a BitmapImage doesn't have encoded raw...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Sep 2013 21:54:17 +0000 (21:54 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Sep 2013 21:54:17 +0000 (21:54 +0000)
commit60b3d195ef5b805ac2292ce98d86133a30ae64b0
tree15e1fa8530b394b6b7ce2e0cfa8ce5f5cd46e973
parent080cdd73aa29201531b23182b69f8e58bba666de
Don't attempt to destroy decoded frame if a BitmapImage doesn't have encoded raw data.
https://bugs.webkit.org/show_bug.cgi?id=122115

Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2013-09-30
Reviewed by Daniel Bates.

With BitmapImage::create(PassNativeImagePtr, ImageObserver*), a BitmapImage could be created by
passing a native image.  If this image is added to memory cache, we shouldn't attempt to destroy
its decoded frames since there is no encoded raw data and we won't be able to reconstruct the image again.

No new tests for now. Currently there isn't a code path to add to the memory cache a BitmapImage
that was created by adopting a native image. We'll add such a code path in a subsequent patch.

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::destroyDecodedDataIfNecessary):

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