Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(821)

Unified Diff: third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp

Issue 2225903004: Refactoring: Remove dead code in DeferredImageDecoder::createFrameAtIndex (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
index df4b86994d13c1d7ef177299c069132d5ffbdb52..99c59dc89c15204fc7fcc79767af0332b85422c5 100644
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
@@ -98,26 +98,16 @@ PassRefPtr<SkImage> DeferredImageDecoder::createFrameAtIndex(size_t index)
prepareLazyDecodedFrames();
- if (index < m_frameData.size()) {
- DeferredFrameData* frameData = &m_frameData[index];
- if (m_actualDecoder)
- frameData->m_frameBytes = m_actualDecoder->frameBytesAtIndex(index);
- else
- frameData->m_frameBytes = m_size.area() * sizeof(ImageFrame::PixelData);
- // ImageFrameGenerator has the latest known alpha state. There will be a
- // performance boost if this frame is opaque.
- DCHECK(m_frameGenerator);
- return createFrameImageAtIndex(index, !m_frameGenerator->hasAlpha(index));
- }
-
- if (!m_actualDecoder || m_actualDecoder->failed())
- return nullptr;
-
- ImageFrame* frame = m_actualDecoder->frameBufferAtIndex(index);
- if (!frame || frame->getStatus() == ImageFrame::FrameEmpty)
- return nullptr;
-
- return fromSkSp(SkImage::MakeFromBitmap(frame->bitmap()));
+ DCHECK(index < m_frameData.size());
+ DeferredFrameData* frameData = &m_frameData[index];
+ if (m_actualDecoder)
+ frameData->m_frameBytes = m_actualDecoder->frameBytesAtIndex(index);
+ else
+ frameData->m_frameBytes = m_size.area() * sizeof(ImageFrame::PixelData);
+ // ImageFrameGenerator has the latest known alpha state. There will be a
+ // performance boost if this frame is opaque.
+ DCHECK(m_frameGenerator);
+ return createFrameImageAtIndex(index, !m_frameGenerator->hasAlpha(index));
}
PassRefPtr<SharedBuffer> DeferredImageDecoder::data()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698