Index: third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp b/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp |
index f7be7c977446fab5a519fe9d9d098f8febe88f3c..c9fa7320db496293edb802643f51e506da718de3 100644 |
--- a/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp |
@@ -60,14 +60,13 @@ PictureSnapshot::PictureSnapshot(PassRefPtr<const SkPicture> picture) |
static bool decodeBitmap(const void* data, size_t length, SkBitmap* result) |
{ |
- std::unique_ptr<ImageDecoder> imageDecoder = ImageDecoder::create(ImageDecoder::determineImageType(static_cast<const char*>(data), length), |
+ // No need to copy the data; this decodes immediately. |
+ RefPtr<SegmentReader> segmentReader = SegmentReader::createFromSkData(SkData::MakeWithoutCopy(data, length)); |
+ std::unique_ptr<ImageDecoder> imageDecoder = ImageDecoder::create(segmentReader.release(), true, |
ImageDecoder::AlphaPremultiplied, ImageDecoder::GammaAndColorProfileIgnored); |
if (!imageDecoder) |
return false; |
- // No need to copy the data; this decodes immediately. |
- RefPtr<SegmentReader> segmentReader = SegmentReader::createFromSkData(SkData::MakeWithoutCopy(data, length)); |
- imageDecoder->setData(segmentReader.release(), true); |
ImageFrame* frame = imageDecoder->frameBufferAtIndex(0); |
if (!frame) |
return true; |