From 8321f7585b6aded0c35e50e9af8709b25fdce3f6 Mon Sep 17 00:00:00 2001 From: Leon Scroggins Date: Mon, 10 Jul 2017 19:51:46 +0000 Subject: Revert "Remove support for decoding to kIndex_8" This reverts commit 742a3e298fda669006147e4a305bab8452369b1f. Reason for revert: Breaking Android roll: frameworks/base/core/jni/android/graphics/BitmapFactory.cpp:453:18: error: no member named 'fColorPtr' in 'SkAndroidCodec::AndroidOptions' codecOptions.fColorPtr = colorPtr; ~~~~~~~~~~~~ ^ frameworks/base/core/jni/android/graphics/BitmapFactory.cpp:454:18: error: no member named 'fColorCount' in 'SkAndroidCodec::AndroidOptions' codecOptions.fColorCount = colorCount; ~~~~~~~~~~~~ ^ Original change's description: > Remove support for decoding to kIndex_8 > > Fix up callsites, and remove tests that no longer make sense. > > Bug: skia:6828 > Change-Id: I2548c4b7528b7b1be7412563156f27b52c9d4295 > Reviewed-on: https://skia-review.googlesource.com/21664 > Reviewed-by: Derek Sollenberger > Commit-Queue: Leon Scroggins TBR=djsollen@google.com,scroggo@google.com Change-Id: I1bc669441f250690884e75a9a61427fdf75c6907 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:6828 Reviewed-on: https://skia-review.googlesource.com/22120 Reviewed-by: Leon Scroggins Commit-Queue: Leon Scroggins --- third_party/gif/SkGifImageReader.cpp | 2 ++ third_party/gif/SkGifImageReader.h | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'third_party/gif') diff --git a/third_party/gif/SkGifImageReader.cpp b/third_party/gif/SkGifImageReader.cpp index e76028dac9..76f3edcef0 100644 --- a/third_party/gif/SkGifImageReader.cpp +++ b/third_party/gif/SkGifImageReader.cpp @@ -762,11 +762,13 @@ bool SkGifImageReader::parse(SkGifImageReader::SkGIFParseQuery query) isLocalColormapDefined, numColors)) { m_firstFrameHasAlpha = true; + m_firstFrameSupportsIndex8 = true; } else { const bool frameIsSubset = xOffset > 0 || yOffset > 0 || width < fScreenWidth || height < fScreenHeight; m_firstFrameHasAlpha = frameIsSubset; + m_firstFrameSupportsIndex8 = !frameIsSubset; } } diff --git a/third_party/gif/SkGifImageReader.h b/third_party/gif/SkGifImageReader.h index 49655c23df..f105a1de87 100644 --- a/third_party/gif/SkGifImageReader.h +++ b/third_party/gif/SkGifImageReader.h @@ -289,6 +289,7 @@ public: , m_streamBuffer(stream) , m_parseCompleted(false) , m_firstFrameHasAlpha(false) + , m_firstFrameSupportsIndex8(false) { } @@ -366,6 +367,8 @@ public: bool firstFrameHasAlpha() const { return m_firstFrameHasAlpha; } + bool firstFrameSupportsIndex8() const { return m_firstFrameSupportsIndex8; } + // Helper function that returns whether an SkGIFFrameContext has transparency. // This method is sometimes called before creating one/parsing its color map, // so it cannot rely on SkGIFFrameContext::transparentPixel or ::localColorMap(). @@ -407,9 +410,10 @@ private: SkStreamBuffer m_streamBuffer; bool m_parseCompleted; - // This value can be computed before we create a SkGIFFrameContext, so we - // store it here instead of on m_frames[0]. + // These values can be computed before we create a SkGIFFrameContext, so we + // store them here instead of on m_frames[0]. bool m_firstFrameHasAlpha; + bool m_firstFrameSupportsIndex8; }; #endif -- cgit v1.2.3