1
/* libs/graphics/animator/SkPostParts.cpp
3
** Copyright 2006, The Android Open Source Project
5
** Licensed under the Apache License, Version 2.0 (the "License");
6
** you may not use this file except in compliance with the License.
7
** You may obtain a copy of the License at
9
** http://www.apache.org/licenses/LICENSE-2.0
11
** Unless required by applicable law or agreed to in writing, software
12
** distributed under the License is distributed on an "AS IS" BASIS,
13
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
** See the License for the specific language governing permissions and
15
** limitations under the License.
18
#include "SkPostParts.h"
19
#include "SkDisplayPost.h"
21
#if SK_USE_CONDENSED_INFO == 0
23
const SkMemberInfo SkData::fInfo[] = {
29
DEFINE_GET_MEMBER(SkData);
31
SkData::SkData() : fParent(NULL) {}
34
SkASSERT(name.size() > 0);
35
const char* dataName = name.c_str();
36
if (fInt != (int) SK_NaN32)
37
fParent->fEvent.setS32(dataName, fInt);
38
else if (SkScalarIsNaN(fFloat) == false)
39
fParent->fEvent.setScalar(dataName, fFloat);
40
else if (string.size() > 0)
41
fParent->fEvent.setString(dataName, string);
47
void SkData::dirty() {
51
SkDisplayable* SkData::getParent() const {
55
bool SkData::setParent(SkDisplayable* displayable) {
56
if (displayable->isPost() == false)
58
fParent = (SkPost*) displayable;
62
void SkData::onEndElement(SkAnimateMaker&) {