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

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: Return metadata in a vector Created 4 years, 2 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
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
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
OLDNEW
« include/codec/SkCodec.h ('K') | « include/codec/SkCodec.h ('k') | src/codec/SkGifCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698