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

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

Issue 1460523002: GIF decoding to Index8, unit tests and misusing unit test as benchmark (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment #25 processed. Created 4 years, 11 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: third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp b/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp
index 64d6223d6af84d4c2aaed13b95cd5ae9f5164a10..74d0c3cef0c6ad49dff74ee4508be5763ce28d1e 100644
--- a/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp
+++ b/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp
@@ -69,7 +69,7 @@ bool DecodingImageGenerator::onGetPixels(const SkImageInfo& info, void* pixels,
}
PlatformInstrumentation::willDecodeLazyPixelRef(m_generationId);
- bool decoded = m_frameGenerator->decodeAndScale(m_frameIndex, getInfo(), pixels, rowBytes);
+ bool decoded = m_frameGenerator->decodeAndScale(m_frameIndex, getInfo(), pixels, rowBytes, table, tableCount);
PlatformInstrumentation::didDecodeLazyPixelRef();
return decoded;
@@ -112,7 +112,9 @@ SkImageGenerator* DecodingImageGenerator::create(SkData* data)
return 0;
const IntSize size = decoder->size();
- const SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height());
+ const SkImageInfo info = decoder->canDecodeTo(0, ImageFrame::Index8)
+ ? SkImageInfo::Make(size.width(), size.height(), kIndex_8_SkColorType, kPremul_SkAlphaType)
+ : SkImageInfo::MakeN32Premul(size.width(), size.height());
RefPtr<ImageFrameGenerator> frame = ImageFrameGenerator::create(SkISize::Make(size.width(), size.height()), buffer, true, false);
if (!frame)

Powered by Google App Engine
This is Rietveld 408576698