Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
2 /*
3 * Copyright 2006 The Android Open Source Project
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
10 #include "SkPostParts.h"
11 #include "SkDisplayPost.h"
13 #if SK_USE_CONDENSED_INFO == 0
15 const SkMemberInfo SkDataInput::fInfo[] = {
16 SK_MEMBER_INHERITED
17 };
19 #endif
21 DEFINE_GET_MEMBER(SkDataInput);
23 SkDataInput::SkDataInput() : fParent(NULL) {}
25 bool SkDataInput::add() {
26 SkASSERT(name.size() > 0);
27 const char* dataName = name.c_str();
28 if (fInt != (int) SK_NaN32)
29 fParent->fEvent.setS32(dataName, fInt);
30 else if (SkScalarIsNaN(fFloat) == false)
31 fParent->fEvent.setScalar(dataName, fFloat);
32 else if (string.size() > 0)
33 fParent->fEvent.setString(dataName, string);
34 // else
35 // SkASSERT(0);
36 return false;
37 }
39 void SkDataInput::dirty() {
40 fParent->dirty();
41 }
43 SkDisplayable* SkDataInput::getParent() const {
44 return fParent;
45 }
47 bool SkDataInput::setParent(SkDisplayable* displayable) {
48 if (displayable->isPost() == false)
49 return true;
50 fParent = (SkPost*) displayable;
51 return false;
52 }
54 void SkDataInput::onEndElement(SkAnimateMaker&) {
55 add();
56 }