| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkCodecPriv.h" | 8 #include "SkCodecPriv.h" |
| 9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
| 10 #include "SkColorTable.h" | 10 #include "SkColorTable.h" |
| 11 #include "SkGifCodec.h" | 11 #include "SkGifCodec.h" |
| 12 #include "SkStream.h" | 12 #include "SkStream.h" |
| 13 #include "SkSwizzler.h" | 13 #include "SkSwizzler.h" |
| 14 #include "SkUtils.h" | 14 #include "SkUtils.h" |
| 15 | 15 |
| 16 #include "gif_lib.h" |
| 17 |
| 16 /* | 18 /* |
| 17 * Checks the start of the stream to see if the image is a gif | 19 * Checks the start of the stream to see if the image is a gif |
| 18 */ | 20 */ |
| 19 bool SkGifCodec::IsGif(const void* buf, size_t bytesRead) { | 21 bool SkGifCodec::IsGif(const void* buf, size_t bytesRead) { |
| 20 if (bytesRead >= GIF_STAMP_LEN) { | 22 if (bytesRead >= GIF_STAMP_LEN) { |
| 21 if (memcmp(GIF_STAMP, buf, GIF_STAMP_LEN) == 0 || | 23 if (memcmp(GIF_STAMP, buf, GIF_STAMP_LEN) == 0 || |
| 22 memcmp(GIF87_STAMP, buf, GIF_STAMP_LEN) == 0 || | 24 memcmp(GIF87_STAMP, buf, GIF_STAMP_LEN) == 0 || |
| 23 memcmp(GIF89_STAMP, buf, GIF_STAMP_LEN) == 0) | 25 memcmp(GIF89_STAMP, buf, GIF_STAMP_LEN) == 0) |
| 24 { | 26 { |
| 25 return true; | 27 return true; |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 int SkGifCodec::onOutputScanline(int inputScanline) const { | 595 int SkGifCodec::onOutputScanline(int inputScanline) const { |
| 594 if (fGif->Image.Interlace) { | 596 if (fGif->Image.Interlace) { |
| 595 if (inputScanline < fFrameRect.top() || inputScanline >= fFrameRect.bott
om()) { | 597 if (inputScanline < fFrameRect.top() || inputScanline >= fFrameRect.bott
om()) { |
| 596 return inputScanline; | 598 return inputScanline; |
| 597 } | 599 } |
| 598 return get_output_row_interlaced(inputScanline - fFrameRect.top(), fFram
eRect.height()) + | 600 return get_output_row_interlaced(inputScanline - fFrameRect.top(), fFram
eRect.height()) + |
| 599 fFrameRect.top(); | 601 fFrameRect.top(); |
| 600 } | 602 } |
| 601 return inputScanline; | 603 return inputScanline; |
| 602 } | 604 } |
| OLD | NEW |