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

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

Issue 1001703003: Take NativeImageSkia out behind the woodshed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make bitmapForCurrentFrame() return SkBitmap by value. Created 5 years, 9 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
Index: Source/platform/graphics/DeferredImageDecoder.cpp
diff --git a/Source/platform/graphics/DeferredImageDecoder.cpp b/Source/platform/graphics/DeferredImageDecoder.cpp
index 61604b6960ac8ac025dd3b43b76a36114056cb33..83fe4ef7eac063ea833f8664c1df47fc642b3ea2 100644
--- a/Source/platform/graphics/DeferredImageDecoder.cpp
+++ b/Source/platform/graphics/DeferredImageDecoder.cpp
@@ -88,7 +88,7 @@ String DeferredImageDecoder::filenameExtension() const
return m_actualDecoder ? m_actualDecoder->filenameExtension() : m_filenameExtension;
}
-PassRefPtr<NativeImageSkia> DeferredImageDecoder::createFrameAtIndex(size_t index)
+SkBitmap DeferredImageDecoder::createFrameAtIndex(size_t index)
{
prepareLazyDecodedFrames();
if (index < m_frameData.size()) {
@@ -103,15 +103,15 @@ PassRefPtr<NativeImageSkia> DeferredImageDecoder::createFrameAtIndex(size_t inde
bitmap.setAlphaType(kOpaque_SkAlphaType);
}
m_frameData[index].m_frameBytes = m_size.area() * sizeof(ImageFrame::PixelData);
- return NativeImageSkia::create(bitmap);
+ return bitmap;
}
if (m_actualDecoder) {
ImageFrame* buffer = m_actualDecoder->frameBufferAtIndex(index);
if (!buffer || buffer->status() == ImageFrame::FrameEmpty)
- return nullptr;
- return buffer->asNewNativeImage();
+ return SkBitmap();
+ return buffer->bitmap();
}
- return nullptr;
+ return SkBitmap();
}
void DeferredImageDecoder::setData(SharedBuffer& data, bool allDataReceived)

Powered by Google App Engine
This is Rietveld 408576698