OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2016 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #ifndef SkCodecAnimation_DEFINED |
| 9 #define SkCodecAnimation_DEFINED |
| 10 |
| 11 #include "SkRect.h" |
| 12 |
| 13 class SkCodecAnimation { |
| 14 public: |
| 15 /** |
| 16 * This specifies how the next frame is based on this frame. |
| 17 * |
| 18 * Names are based on the GIF 89a spec. |
| 19 * |
| 20 * The numbers correspond to values in a GIF. |
| 21 */ |
| 22 enum DisposalMethod { |
| 23 /** |
| 24 * The next frame should be drawn on top of this one. |
| 25 * |
| 26 * In a GIF, a value of 0 (not specified) is also treated as Keep. |
| 27 */ |
| 28 Keep_DisposalMethod = 1, |
| 29 |
| 30 /** |
| 31 * Similar to Keep, except the area inside this frame's rectangle |
| 32 * should be cleared to the BackGround color (transparent) before |
| 33 * drawing the next frame. |
| 34 */ |
| 35 RestoreBGColor_DisposalMethod = 2, |
| 36 |
| 37 /** |
| 38 * The next frame should be drawn on top of the previous frame - i.e. |
| 39 * disregarding this one. |
| 40 * |
| 41 * In a GIF, a value of 4 is treated as RestorePrevious. |
| 42 */ |
| 43 RestorePrevious_DisposalMethod = 3, |
| 44 }; |
| 45 |
| 46 struct FrameInfo { |
| 47 DisposalMethod fDisposalMethod; |
| 48 |
| 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. |
| 54 SkIRect fFrameRect; |
| 55 |
| 56 // How many 1/100 seconds to show this frame. |
| 57 size_t fDuration; |
| 58 }; |
| 59 private: |
| 60 SkCodecAnimation(); |
| 61 }; |
| 62 #endif // SkCodecAnimation_DEFINED |
OLD | NEW |