Commit 46e1b775 authored by fmalita@chromium.org's avatar fmalita@chromium.org

Remove external BitmapImage lazy decoding tracking

Now that SkImage sports a lazy-decoding querying API (isLazyGenerated), we no longer
need the external mechanism introduced in http://crrev.com/1253483004.


BUG=523922
R=noel@chromium.org

Review URL: https://codereview.chromium.org/1308233002

git-svn-id: svn://svn.chromium.org/blink/trunk@201099 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 405c082a
...@@ -172,7 +172,6 @@ void BitmapImage::cacheFrame(size_t index) ...@@ -172,7 +172,6 @@ void BitmapImage::cacheFrame(size_t index)
if (repetitionCount(false) != cAnimationNone) if (repetitionCount(false) != cAnimationNone)
m_frames[index].m_duration = m_source.frameDurationAtIndex(index); m_frames[index].m_duration = m_source.frameDurationAtIndex(index);
m_frames[index].m_hasAlpha = m_source.frameHasAlphaAtIndex(index); m_frames[index].m_hasAlpha = m_source.frameHasAlphaAtIndex(index);
m_frames[index].m_isLazyDecoded = m_source.frameIsLazyDecodedAtIndex(index);
m_frames[index].m_frameBytes = m_source.frameBytesAtIndex(index); m_frames[index].m_frameBytes = m_source.frameBytesAtIndex(index);
const IntSize frameSize(index ? m_source.frameSizeAtIndex(index) : m_size); const IntSize frameSize(index ? m_source.frameSizeAtIndex(index) : m_size);
...@@ -448,7 +447,8 @@ bool BitmapImage::currentFrameIsComplete() ...@@ -448,7 +447,8 @@ bool BitmapImage::currentFrameIsComplete()
bool BitmapImage::currentFrameIsLazyDecoded() bool BitmapImage::currentFrameIsLazyDecoded()
{ {
return ensureFrameIsCached(currentFrame()) && frameIsLazyDecodedAtIndex(currentFrame()); RefPtr<SkImage> image = frameAtIndex(currentFrame());
return image && image->isLazyGenerated();
} }
ImageOrientation BitmapImage::currentFrameOrientation() ImageOrientation BitmapImage::currentFrameOrientation()
...@@ -467,17 +467,6 @@ ImageOrientation BitmapImage::frameOrientationAtIndex(size_t index) ...@@ -467,17 +467,6 @@ ImageOrientation BitmapImage::frameOrientationAtIndex(size_t index)
return m_source.orientationAtIndex(index); return m_source.orientationAtIndex(index);
} }
bool BitmapImage::frameIsLazyDecodedAtIndex(size_t index) const
{
if (m_frames.size() <= index)
return false;
if (m_frames[index].m_haveMetadata)
return m_frames[index].m_isLazyDecoded;
return m_source.frameIsLazyDecodedAtIndex(index);
}
int BitmapImage::repetitionCount(bool imageKnownToBeComplete) int BitmapImage::repetitionCount(bool imageKnownToBeComplete)
{ {
if ((m_repetitionCountStatus == Unknown) || ((m_repetitionCountStatus == Uncertain) && imageKnownToBeComplete)) { if ((m_repetitionCountStatus == Unknown) || ((m_repetitionCountStatus == Uncertain) && imageKnownToBeComplete)) {
......
...@@ -118,7 +118,6 @@ private: ...@@ -118,7 +118,6 @@ private:
float frameDurationAtIndex(size_t); float frameDurationAtIndex(size_t);
bool frameHasAlphaAtIndex(size_t); bool frameHasAlphaAtIndex(size_t);
ImageOrientation frameOrientationAtIndex(size_t); ImageOrientation frameOrientationAtIndex(size_t);
bool frameIsLazyDecodedAtIndex(size_t) const;
// Decodes and caches a frame. Never accessed except internally. // Decodes and caches a frame. Never accessed except internally.
void cacheFrame(size_t index); void cacheFrame(size_t index);
......
...@@ -177,13 +177,6 @@ bool DeferredImageDecoder::frameIsCompleteAtIndex(size_t index) const ...@@ -177,13 +177,6 @@ bool DeferredImageDecoder::frameIsCompleteAtIndex(size_t index) const
return false; return false;
} }
bool DeferredImageDecoder::frameIsCachedAndLazyDecodedAtIndex(size_t index) const
{
// All frames cached in m_frameData are lazy-decoded.
ASSERT(index >= m_frameData.size() || m_frameData[index].m_haveMetadata);
return index < m_frameData.size();
}
float DeferredImageDecoder::frameDurationAtIndex(size_t index) const float DeferredImageDecoder::frameDurationAtIndex(size_t index) const
{ {
if (m_actualDecoder) if (m_actualDecoder)
......
...@@ -70,7 +70,6 @@ public: ...@@ -70,7 +70,6 @@ public:
size_t clearCacheExceptFrame(size_t); size_t clearCacheExceptFrame(size_t);
bool frameHasAlphaAtIndex(size_t index) const; bool frameHasAlphaAtIndex(size_t index) const;
bool frameIsCompleteAtIndex(size_t) const; bool frameIsCompleteAtIndex(size_t) const;
bool frameIsCachedAndLazyDecodedAtIndex(size_t) const;
float frameDurationAtIndex(size_t) const; float frameDurationAtIndex(size_t) const;
size_t frameBytesAtIndex(size_t index) const; size_t frameBytesAtIndex(size_t index) const;
ImageOrientation orientationAtIndex(size_t index) const; ImageOrientation orientationAtIndex(size_t index) const;
......
...@@ -35,7 +35,6 @@ FrameData::FrameData() ...@@ -35,7 +35,6 @@ FrameData::FrameData()
, m_haveMetadata(false) , m_haveMetadata(false)
, m_isComplete(false) , m_isComplete(false)
, m_hasAlpha(true) , m_hasAlpha(true)
, m_isLazyDecoded(false)
, m_frameBytes(0) , m_frameBytes(0)
{ {
} }
...@@ -51,7 +50,6 @@ bool FrameData::clear(bool clearMetadata) ...@@ -51,7 +50,6 @@ bool FrameData::clear(bool clearMetadata)
m_haveMetadata = false; m_haveMetadata = false;
m_orientation = DefaultImageOrientation; m_orientation = DefaultImageOrientation;
m_isLazyDecoded = false;
m_frameBytes = 0; m_frameBytes = 0;
if (m_frame) { if (m_frame) {
......
...@@ -52,7 +52,6 @@ public: ...@@ -52,7 +52,6 @@ public:
bool m_haveMetadata : 1; bool m_haveMetadata : 1;
bool m_isComplete : 1; bool m_isComplete : 1;
bool m_hasAlpha : 1; bool m_hasAlpha : 1;
bool m_isLazyDecoded : 1;
size_t m_frameBytes; size_t m_frameBytes;
}; };
......
...@@ -143,11 +143,6 @@ bool ImageSource::frameIsCompleteAtIndex(size_t index) const ...@@ -143,11 +143,6 @@ bool ImageSource::frameIsCompleteAtIndex(size_t index) const
return m_decoder && m_decoder->frameIsCompleteAtIndex(index); return m_decoder && m_decoder->frameIsCompleteAtIndex(index);
} }
bool ImageSource::frameIsLazyDecodedAtIndex(size_t index) const
{
return m_decoder && m_decoder->frameIsCachedAndLazyDecodedAtIndex(index);
}
size_t ImageSource::frameBytesAtIndex(size_t index) const size_t ImageSource::frameBytesAtIndex(size_t index) const
{ {
return m_decoder ? m_decoder->frameBytesAtIndex(index) : 0; return m_decoder ? m_decoder->frameBytesAtIndex(index) : 0;
......
...@@ -87,7 +87,6 @@ public: ...@@ -87,7 +87,6 @@ public:
float frameDurationAtIndex(size_t) const; float frameDurationAtIndex(size_t) const;
bool frameHasAlphaAtIndex(size_t) const; // Whether or not the frame actually used any alpha. bool frameHasAlphaAtIndex(size_t) const; // Whether or not the frame actually used any alpha.
bool frameIsCompleteAtIndex(size_t) const; // Whether or not the frame is fully received. bool frameIsCompleteAtIndex(size_t) const; // Whether or not the frame is fully received.
bool frameIsLazyDecodedAtIndex(size_t) const; // Whether or not the frame is lazy-decoded.
ImageOrientation orientationAtIndex(size_t) const; // EXIF image orientation ImageOrientation orientationAtIndex(size_t) const; // EXIF image orientation
// Returns the number of bytes in the decoded frame. May return 0 if the // Returns the number of bytes in the decoded frame. May return 0 if the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment