Report frame bytes by platform ImageDecoder
authorhclam@chromium.org <hclam@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Aug 2012 17:48:38 +0000 (17:48 +0000)
committerhclam@chromium.org <hclam@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Aug 2012 17:48:38 +0000 (17:48 +0000)
commitaa064a51c115b5fcaeafe619ddd9786601209b2b
tree5e641f1f833480df435e6c710827fd0e64c14e1a
parent46edac13e23905d6e7801f997f86eeb0dc998d88
Report frame bytes by platform ImageDecoder
https://bugs.webkit.org/show_bug.cgi?id=94241

Reviewed by James Robinson.

Decoded frame bytes should be reported by the platform ImageSource and
ImageDecoder. BitmapImage used to guess system memory used by a frame
but this is no longer true if a frame is backed by an accelerated
surface or defer-decoded.

Adds ImageSource::frameBytesAtIndex and ImageDecoder::frameBytesAtIndex
such that platform can report memory usage correctly.

No new tests. Refactoring without change of behavior.
Tested on Chromium port with pixel tests without any crash or failure.

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::destroyDecodedData):
(WebCore::BitmapImage::destroyDecodedDataIfNecessary):
(WebCore::BitmapImage::destroyMetadataAndNotify):
(WebCore::BitmapImage::cacheFrame):
(WebCore::BitmapImage::dataChanged):
* platform/graphics/BitmapImage.h:
(WebCore::FrameData::FrameData):
(FrameData):
(BitmapImage):
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::frameBytesAtIndex):
(WebCore):
* platform/graphics/ImageSource.h:
* platform/graphics/cg/ImageSourceCG.cpp:
(WebCore::ImageSource::frameBytesAtIndex):
(WebCore):
* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::frameBytesAtIndex):
(WebCore):
* platform/image-decoders/ImageDecoder.h:
(ImageDecoder):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126892 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/BitmapImage.cpp
Source/WebCore/platform/graphics/BitmapImage.h
Source/WebCore/platform/graphics/ImageSource.cpp
Source/WebCore/platform/graphics/ImageSource.h
Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp
Source/WebCore/platform/image-decoders/ImageDecoder.cpp
Source/WebCore/platform/image-decoders/ImageDecoder.h