OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "SkMovie.h" | 8 #include "SkMovie.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkPaint.h" | 10 #include "SkPaint.h" |
11 | 11 |
12 SK_DEFINE_INST_COUNT(SkMovie) | |
13 | |
14 // We should never see this in normal operation since our time values are | 12 // We should never see this in normal operation since our time values are |
15 // 0-based. So we use it as a sentinal. | 13 // 0-based. So we use it as a sentinal. |
16 #define UNINITIALIZED_MSEC ((SkMSec)-1) | 14 #define UNINITIALIZED_MSEC ((SkMSec)-1) |
17 | 15 |
18 SkMovie::SkMovie() | 16 SkMovie::SkMovie() |
19 { | 17 { |
20 fInfo.fDuration = UNINITIALIZED_MSEC; // uninitialized | 18 fInfo.fDuration = UNINITIALIZED_MSEC; // uninitialized |
21 fCurrTime = UNINITIALIZED_MSEC; // uninitialized | 19 fCurrTime = UNINITIALIZED_MSEC; // uninitialized |
22 fNeedBitmap = true; | 20 fNeedBitmap = true; |
23 } | 21 } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 86 |
89 SkMovie* SkMovie::DecodeMemory(const void* data, size_t length) { | 87 SkMovie* SkMovie::DecodeMemory(const void* data, size_t length) { |
90 SkMemoryStream stream(data, length, false); | 88 SkMemoryStream stream(data, length, false); |
91 return SkMovie::DecodeStream(&stream); | 89 return SkMovie::DecodeStream(&stream); |
92 } | 90 } |
93 | 91 |
94 SkMovie* SkMovie::DecodeFile(const char path[]) { | 92 SkMovie* SkMovie::DecodeFile(const char path[]) { |
95 SkAutoTUnref<SkStreamRewindable> stream(SkStream::NewFromFile(path)); | 93 SkAutoTUnref<SkStreamRewindable> stream(SkStream::NewFromFile(path)); |
96 return stream.get() ? SkMovie::DecodeStream(stream) : NULL; | 94 return stream.get() ? SkMovie::DecodeStream(stream) : NULL; |
97 } | 95 } |
OLD | NEW |