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

Side by Side Diff: src/animator/SkAnimateMaker.cpp

Issue 2343933002: Revert of SkFontData to use smart pointers. (Closed)
Patch Set: 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
« no previous file with comments | « samplecode/SampleAnimator.cpp ('k') | src/animator/SkAnimator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 std::unique_ptr<SkStream> stream = SkStream::MakeFromFile(uri); 102 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(uri));
103 if (stream) { 103 if (stream.get()) {
104 bool success = decodeStream(stream.get()); 104 bool success = decodeStream(stream);
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
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 }
OLDNEW
« no previous file with comments | « samplecode/SampleAnimator.cpp ('k') | src/animator/SkAnimator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698