commit | e13b82fac077383d9f93631a177573509be44f38 | [log] [tgz] |
---|---|---|
author | Leon Scroggins III <scroggo@google.com> | Tue Dec 01 15:03:59 2020 -0500 |
committer | Leon Scroggins <scroggo@google.com> | Wed Dec 02 20:28:35 2020 +0000 |
tree | c7598ab63cf4885bfa9560a29baf359f29b8195c | |
parent | 85c165b459a47d3d383357c4a460d337f3d3d892 [diff] |
Ensure frame rect is on screen or empty Bug: b/160984428 There is no reason for a client to need to know that the frame rect extends beyond the edge of the "canvas"/"screen"/image bounds. A typical use case is more interested in knowing what part of the original bounds the frame update occupies. If the offsets are beyond the image bounds, move them to the right/bottom edge of the image (and make the width/height 0). This matches Wuffs. Change-Id: I215b312b421a30bf985f681424a4c4198f069862 Reviewed-on: https://skia-review.googlesource.com/c/libgifcodec/+/339831 Commit-Queue: Leon Scroggins <scroggo@google.com> Commit-Queue: Derek Sollenberger <djsollen@google.com> Auto-Submit: Leon Scroggins <scroggo@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com>
libgifcodec is based on a fork of libgif made by Chromium. It was copied into Skia with https://codereview.chromium.org/2045293002, as https://skia.googlesource.com/skia/+/19b91531e912283d237435d94516575b28713cba.
The header file SkGifCodec.h
exposes two functions:
bool SkGifCodec::IsGif(const void*, size_t);
std::unique_ptr<SkCodec> SkGifCodec::MakeFromStream(std::unique_ptr<SkStream>, SkCodec::Result*);
Which can be used by Skia's SkCodec::MakeFromStream
to implement GIF Decoding.
See LICENSE.md
for the license information.