OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
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 | 8 |
9 | 9 |
10 #include "SkDisplayMovie.h" | 10 #include "SkDisplayMovie.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 } | 27 } |
28 | 28 |
29 SkDisplayMovie::~SkDisplayMovie() { | 29 SkDisplayMovie::~SkDisplayMovie() { |
30 } | 30 } |
31 | 31 |
32 void SkDisplayMovie::buildMovie() { | 32 void SkDisplayMovie::buildMovie() { |
33 if (fMovieBuilt) | 33 if (fMovieBuilt) |
34 return; | 34 return; |
35 SkAnimateMaker* movieMaker = fMovie.fMaker; | 35 SkAnimateMaker* movieMaker = fMovie.fMaker; |
36 SkAnimateMaker* parentMaker = movieMaker->fParentMaker; | 36 SkAnimateMaker* parentMaker = movieMaker->fParentMaker; |
37 if (src.size() == 0 || parentMaker == NULL) | 37 if (src.size() == 0 || parentMaker == nullptr) |
38 return; | 38 return; |
39 movieMaker->fPrefix.set(parentMaker->fPrefix); | 39 movieMaker->fPrefix.set(parentMaker->fPrefix); |
40 fDecodedSuccessfully = fMovie.fMaker->decodeURI(src.c_str()); | 40 fDecodedSuccessfully = fMovie.fMaker->decodeURI(src.c_str()); |
41 if (fDecodedSuccessfully == false) { | 41 if (fDecodedSuccessfully == false) { |
42 | 42 |
43 if (movieMaker->getErrorCode() != SkXMLParserError::kNoError || movieMak
er->getNativeCode() != -1) { | 43 if (movieMaker->getErrorCode() != SkXMLParserError::kNoError || movieMak
er->getNativeCode() != -1) { |
44 movieMaker->setInnerError(parentMaker, src); | 44 movieMaker->setInnerError(parentMaker, src); |
45 parentMaker->setErrorCode(SkDisplayXMLParserError::kInMovie); | 45 parentMaker->setErrorCode(SkDisplayXMLParserError::kInMovie); |
46 } else { | 46 } else { |
47 parentMaker->setErrorNoun(src); | 47 parentMaker->setErrorNoun(src); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 void SkDisplayMovie::dumpEvents() { | 99 void SkDisplayMovie::dumpEvents() { |
100 fMovie.fMaker->fEvents.dump(*fMovie.fMaker); | 100 fMovie.fMaker->fEvents.dump(*fMovie.fMaker); |
101 } | 101 } |
102 #endif | 102 #endif |
103 | 103 |
104 bool SkDisplayMovie::enable(SkAnimateMaker&) { | 104 bool SkDisplayMovie::enable(SkAnimateMaker&) { |
105 if (fDecodedSuccessfully == false) | 105 if (fDecodedSuccessfully == false) |
106 return false; | 106 return false; |
107 SkAnimateMaker* movieMaker = fMovie.fMaker; | 107 SkAnimateMaker* movieMaker = fMovie.fMaker; |
108 movieMaker->fEvents.doEvent(*movieMaker, SkDisplayEvent::kOnload, NULL); | 108 movieMaker->fEvents.doEvent(*movieMaker, SkDisplayEvent::kOnload, nullptr); |
109 movieMaker->fEvents.removeEvent(SkDisplayEvent::kOnload, NULL); | 109 movieMaker->fEvents.removeEvent(SkDisplayEvent::kOnload, nullptr); |
110 fLoaded = true; | 110 fLoaded = true; |
111 movieMaker->fLoaded = true; | 111 movieMaker->fLoaded = true; |
112 return false; | 112 return false; |
113 } | 113 } |
114 | 114 |
115 bool SkDisplayMovie::hasEnable() const { | 115 bool SkDisplayMovie::hasEnable() const { |
116 return true; | 116 return true; |
117 } | 117 } |
118 | 118 |
119 void SkDisplayMovie::onEndElement(SkAnimateMaker& maker) { | 119 void SkDisplayMovie::onEndElement(SkAnimateMaker& maker) { |
120 #if defined SK_DEBUG && defined SK_DEBUG_ANIMATION_TIMING | 120 #if defined SK_DEBUG && defined SK_DEBUG_ANIMATION_TIMING |
121 fMovie.fMaker->fDebugTimeBase = maker.fDebugTimeBase; | 121 fMovie.fMaker->fDebugTimeBase = maker.fDebugTimeBase; |
122 #endif | 122 #endif |
123 fMovie.fMaker->fPrefix.set(maker.fPrefix); | 123 fMovie.fMaker->fPrefix.set(maker.fPrefix); |
124 fMovie.fMaker->fHostEventSinkID = maker.fHostEventSinkID; | 124 fMovie.fMaker->fHostEventSinkID = maker.fHostEventSinkID; |
125 fMovie.fMaker->fParentMaker = &maker; | 125 fMovie.fMaker->fParentMaker = &maker; |
126 buildMovie(); | 126 buildMovie(); |
127 *maker.fMovies.append() = this; | 127 *maker.fMovies.append() = this; |
128 } | 128 } |
OLD | NEW |