blob: b0495b89eeaec531578034d55f668ecc0270529b [file] [log] [blame]
scroggo19b91532016-10-24 09:03:26 -07001/*
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
scroggo19b91532016-10-24 09:03:26 -07008#ifndef SkCodecAnimation_DEFINED
9#define SkCodecAnimation_DEFINED
10
11#include "SkCodec.h"
12#include "SkRect.h"
13
14class SkCodecAnimation {
15public:
scroggo19b91532016-10-24 09:03:26 -070016 /**
17 * This specifies how the next frame is based on this frame.
18 *
19 * Names are based on the GIF 89a spec.
20 *
21 * The numbers correspond to values in a GIF.
22 */
23 enum DisposalMethod {
24 /**
25 * The next frame should be drawn on top of this one.
26 *
27 * In a GIF, a value of 0 (not specified) is also treated as Keep.
28 */
29 Keep_DisposalMethod = 1,
30
31 /**
32 * Similar to Keep, except the area inside this frame's rectangle
33 * should be cleared to the BackGround color (transparent) before
34 * drawing the next frame.
35 */
36 RestoreBGColor_DisposalMethod = 2,
37
38 /**
39 * The next frame should be drawn on top of the previous frame - i.e.
40 * disregarding this one.
41 *
42 * In a GIF, a value of 4 is also treated as RestorePrevious.
43 */
44 RestorePrevious_DisposalMethod = 3,
45 };
46
47private:
48 SkCodecAnimation();
49};
50#endif // SkCodecAnimation_DEFINED