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 "SkAnimateMaker.h" | 10 #include "SkAnimateMaker.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 { | 92 { |
93 SkDisplayXMLParser parser(*this); | 93 SkDisplayXMLParser parser(*this); |
94 return parser.parse(*stream); | 94 return parser.parse(*stream); |
95 } | 95 } |
96 | 96 |
97 // differs from SkAnimator::decodeURI in that it does not set URI base | 97 // differs from SkAnimator::decodeURI in that it does not set URI base |
98 bool SkAnimateMaker::decodeURI(const char uri[]) { | 98 bool SkAnimateMaker::decodeURI(const char uri[]) { |
99 // SkDebugf("animator decode %s\n", uri); | 99 // SkDebugf("animator decode %s\n", uri); |
100 | 100 |
101 // SkStream* stream = SkStream::GetURIStream(fPrefix.c_str(), uri); | 101 // SkStream* stream = SkStream::GetURIStream(fPrefix.c_str(), uri); |
102 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(uri)); | 102 std::unique_ptr<SkStream> stream = SkStream::MakeFromFile(uri); |
103 if (stream.get()) { | 103 if (stream) { |
104 bool success = decodeStream(stream); | 104 bool success = decodeStream(stream.get()); |
105 if (hasError() && fError.hasNoun() == false) | 105 if (hasError() && fError.hasNoun() == false) |
106 fError.setNoun(uri); | 106 fError.setNoun(uri); |
107 return success; | 107 return success; |
108 } else { | 108 } else { |
109 return false; | 109 return false; |
110 } | 110 } |
111 } | 111 } |
112 | 112 |
113 #if defined SK_DEBUG && 0 | 113 #if defined SK_DEBUG && 0 |
114 //used for the if'd out section of deleteMembers | 114 //used for the if'd out section of deleteMembers |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 } | 363 } |
364 | 364 |
365 bool SkAnimateMaker::GetStep(const char* token, size_t len, void* stepPtr, SkScr
iptValue* value) { | 365 bool SkAnimateMaker::GetStep(const char* token, size_t len, void* stepPtr, SkScr
iptValue* value) { |
366 if (SK_LITERAL_STR_EQUAL("step", token, len)) { | 366 if (SK_LITERAL_STR_EQUAL("step", token, len)) { |
367 value->fOperand.fS32 = *(int32_t*) stepPtr; | 367 value->fOperand.fS32 = *(int32_t*) stepPtr; |
368 value->fType = SkType_Int; | 368 value->fType = SkType_Int; |
369 return true; | 369 return true; |
370 } | 370 } |
371 return false; | 371 return false; |
372 } | 372 } |
OLD | NEW |