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)
if (repetitionCount(false) != cAnimationNone)
m_frames[index].m_duration = m_source.frameDurationAtIndex(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);
const IntSize frameSize(index ? m_source.frameSizeAtIndex(index) : m_size);
......@@ -448,7 +447,8 @@ bool BitmapImage::currentFrameIsComplete()
bool BitmapImage::currentFrameIsLazyDecoded()
{
return ensureFrameIsCached(currentFrame()) && frameIsLazyDecodedAtIndex(currentFrame());
RefPtr<SkImage> image = frameAtIndex(currentFrame());
return image && image->isLazyGenerated();
}
ImageOrientation BitmapImage::currentFrameOrientation()
......@@ -467,17 +467,6 @@ ImageOrientation BitmapImage::frameOrientationAtIndex(size_t 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)
{
if ((m_repetitionCountStatus == Unknown) || ((m_repetitionCountStatus == Uncertain) && imageKnownToBeComplete)) {
......
......@@ -118,7 +118,6 @@ private:
float frameDurationAtIndex(size_t);
bool frameHasAlphaAtIndex(size_t);
ImageOrientation frameOrientationAtIndex(size_t);
bool frameIsLazyDecodedAtIndex(size_t) const;
// Decodes and caches a frame. Never accessed except internally.
void cacheFrame(size_t index);
......
......@@ -177,13 +177,6 @@ bool DeferredImageDecoder::frameIsCompleteAtIndex(size_t index) const
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
{
if (m_actualDecoder)
......
......@@ -70,7 +70,6 @@ public:
size_t clearCacheExceptFrame(size_t);
bool frameHasAlphaAtIndex(size_t index) const;
bool frameIsCompleteAtIndex(size_t) const;
bool frameIsCachedAndLazyDecodedAtIndex(size_t) const;
float frameDurationAtIndex(size_t) const;
size_t frameBytesAtIndex(size_t index) const;
ImageOrientation orientationAtIndex(size_t index) const;
......
......@@ -35,7 +35,6 @@ FrameData::FrameData()
, m_haveMetadata(false)
, m_isComplete(false)
, m_hasAlpha(true)
, m_isLazyDecoded(false)
, m_frameBytes(0)
{
}
......@@ -51,7 +50,6 @@ bool FrameData::clear(bool clearMetadata)
m_haveMetadata = false;
m_orientation = DefaultImageOrientation;
m_isLazyDecoded = false;
m_frameBytes = 0;
if (m_frame) {
......
......@@ -52,7 +52,6 @@ public:
bool m_haveMetadata : 1;
bool m_isComplete : 1;
bool m_hasAlpha : 1;
bool m_isLazyDecoded : 1;
size_t m_frameBytes;
};
......
......@@ -143,11 +143,6 @@ bool ImageSource::frameIsCompleteAtIndex(size_t index) const
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
{
return m_decoder ? m_decoder->frameBytesAtIndex(index) : 0;
......
......@@ -87,7 +87,6 @@ public:
float frameDurationAtIndex(size_t) const;
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 frameIsLazyDecodedAtIndex(size_t) const; // Whether or not the frame is lazy-decoded.
ImageOrientation orientationAtIndex(size_t) const; // EXIF image orientation
// 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