| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 #ifndef SkCodecAnimation_DEFINED | 8 #ifndef SkCodecAnimation_DEFINED |
| 9 #define SkCodecAnimation_DEFINED | 9 #define SkCodecAnimation_DEFINED |
| 10 | 10 |
| 11 #include "SkCodec.h" |
| 11 #include "SkRect.h" | 12 #include "SkRect.h" |
| 12 | 13 |
| 13 class SkCodecAnimation { | 14 class SkCodecAnimation { |
| 14 public: | 15 public: |
| 15 /** | 16 /** |
| 16 * This specifies how the next frame is based on this frame. | 17 * This specifies how the next frame is based on this frame. |
| 17 * | 18 * |
| 18 * Names are based on the GIF 89a spec. | 19 * Names are based on the GIF 89a spec. |
| 19 * | 20 * |
| 20 * The numbers correspond to values in a GIF. | 21 * The numbers correspond to values in a GIF. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 36 | 37 |
| 37 /** | 38 /** |
| 38 * The next frame should be drawn on top of the previous frame - i.e. | 39 * The next frame should be drawn on top of the previous frame - i.e. |
| 39 * disregarding this one. | 40 * disregarding this one. |
| 40 * | 41 * |
| 41 * In a GIF, a value of 4 is also treated as RestorePrevious. | 42 * In a GIF, a value of 4 is also treated as RestorePrevious. |
| 42 */ | 43 */ |
| 43 RestorePrevious_DisposalMethod = 3, | 44 RestorePrevious_DisposalMethod = 3, |
| 44 }; | 45 }; |
| 45 | 46 |
| 46 struct FrameInfo { | 47 struct FrameInfo : public SkCodec::FrameInfo { |
| 47 DisposalMethod fDisposalMethod; | 48 DisposalMethod fDisposalMethod; |
| 48 | 49 |
| 49 // The frame that this frame is drawn on top of, or | |
| 50 // SkCodec::kIndependentFrame. | |
| 51 size_t fRequiredFrame; | |
| 52 | |
| 53 // The subset of the bounds that this frame describes. | 50 // The subset of the bounds that this frame describes. |
| 54 SkIRect fFrameRect; | 51 SkIRect fFrameRect; |
| 55 | |
| 56 // How many 1/100 seconds to show this frame. | |
| 57 size_t fDuration; | |
| 58 }; | 52 }; |
| 59 private: | 53 private: |
| 60 SkCodecAnimation(); | 54 SkCodecAnimation(); |
| 61 }; | 55 }; |
| 62 #endif // SkCodecAnimation_DEFINED | 56 #endif // SkCodecAnimation_DEFINED |
| OLD | NEW |