Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(999)

Side by Side Diff: src/codec/SkCodecAnimation.h

Issue 2045293002: Add support for multiple frames in SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Cache all frames in the GM Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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.
msarett 2016/09/22 22:54:34 nit: also?
scroggo 2016/09/23 15:53:15 Haha, yes, that will be more clear.
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698