aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/gif/SkGifImageReader.h
diff options
context:
space:
mode:
authorGravatar scroggo <scroggo@chromium.org>2016-10-27 08:29:13 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-10-27 08:29:13 -0700
commit53f63b69e83fd805418d72a6eeb860cf0fcff3c5 (patch)
treefd8f92fcdc7a958ab1e1f6025040c02c091fb303 /third_party/gif/SkGifImageReader.h
parentcffaa70896fa5bc6c7bf98abbaafb1a755b49762 (diff)
Fix decoding GIF to 565
565 cannot take the !writeTransparentPixels path, so disable it for cases where we might have to take that path. This only affects frames beyond the first. If the first frame has a transparent pixel, it will be marked as non-opaque, so we cannot decode to 565 anyway. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2441833002 Review-Url: https://codereview.chromium.org/2441833002
Diffstat (limited to 'third_party/gif/SkGifImageReader.h')
-rw-r--r--third_party/gif/SkGifImageReader.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/third_party/gif/SkGifImageReader.h b/third_party/gif/SkGifImageReader.h
index fee1a5f3c7..5936350681 100644
--- a/third_party/gif/SkGifImageReader.h
+++ b/third_party/gif/SkGifImageReader.h
@@ -86,6 +86,7 @@ enum SkGIFState {
};
struct SkGIFFrameContext;
+class SkGIFColorMap;
// LZW decoder state machine.
class SkGIFLZWContext final : public SkNoncopyable {
@@ -108,7 +109,7 @@ public:
, m_frameContext(frameContext)
{ }
- bool prepareToDecode();
+ bool prepareToDecode(const SkGIFColorMap& globalMap);
bool outputRow(const unsigned char* rowBegin);
bool doLZW(const unsigned char* block, size_t bytesInBlock);
bool hasRemainingRows() { return SkToBool(rowsRemaining); }
@@ -210,7 +211,7 @@ public:
m_lzwBlocks.push_back(SkData::MakeWithCopy(data, size));
}
- bool decode(SkGifCodec* client, bool* frameDecoded);
+ bool decode(SkGifCodec* client, const SkGIFColorMap& globalMap, bool* frameDecoded);
int frameId() const { return m_frameId; }
void setRect(unsigned x, unsigned y, unsigned width, unsigned height)