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 "SkPostParts.h" | 10 #include "SkPostParts.h" |
11 #include "SkDisplayPost.h" | 11 #include "SkDisplayPost.h" |
12 | 12 |
13 #if SK_USE_CONDENSED_INFO == 0 | 13 #if SK_USE_CONDENSED_INFO == 0 |
14 | 14 |
15 const SkMemberInfo SkDataInput::fInfo[] = { | 15 const SkMemberInfo SkDataInput::fInfo[] = { |
16 SK_MEMBER_INHERITED | 16 SK_MEMBER_INHERITED |
17 }; | 17 }; |
18 | 18 |
19 #endif | 19 #endif |
20 | 20 |
21 DEFINE_GET_MEMBER(SkDataInput); | 21 DEFINE_GET_MEMBER(SkDataInput); |
22 | 22 |
23 SkDataInput::SkDataInput() : fParent(NULL) {} | 23 SkDataInput::SkDataInput() : fParent(nullptr) {} |
24 | 24 |
25 bool SkDataInput::add() { | 25 bool SkDataInput::add() { |
26 SkASSERT(name.size() > 0); | 26 SkASSERT(name.size() > 0); |
27 const char* dataName = name.c_str(); | 27 const char* dataName = name.c_str(); |
28 if (fInt != (int) SK_NaN32) | 28 if (fInt != (int) SK_NaN32) |
29 fParent->fEvent.setS32(dataName, fInt); | 29 fParent->fEvent.setS32(dataName, fInt); |
30 else if (SkScalarIsNaN(fFloat) == false) | 30 else if (SkScalarIsNaN(fFloat) == false) |
31 fParent->fEvent.setScalar(dataName, fFloat); | 31 fParent->fEvent.setScalar(dataName, fFloat); |
32 else if (string.size() > 0) | 32 else if (string.size() > 0) |
33 fParent->fEvent.setString(dataName, string); | 33 fParent->fEvent.setString(dataName, string); |
(...skipping 13 matching lines...) Expand all Loading... |
47 bool SkDataInput::setParent(SkDisplayable* displayable) { | 47 bool SkDataInput::setParent(SkDisplayable* displayable) { |
48 if (displayable->isPost() == false) | 48 if (displayable->isPost() == false) |
49 return true; | 49 return true; |
50 fParent = (SkPost*) displayable; | 50 fParent = (SkPost*) displayable; |
51 return false; | 51 return false; |
52 } | 52 } |
53 | 53 |
54 void SkDataInput::onEndElement(SkAnimateMaker&) { | 54 void SkDataInput::onEndElement(SkAnimateMaker&) { |
55 add(); | 55 add(); |
56 } | 56 } |
OLD | NEW |