Lines Matching full:value
111 boxedValue->value = !! scriptValue->fOperand.fS32;
116 boxedValue->value = scriptValue->fOperand.fS32;
121 boxedValue->value = scriptValue->fOperand.fScalar;
142 void* eng, SkScriptValue* value) {
153 success = engine.evaluateScript(&script, value);
155 *value = *scriptValue;
159 bool SkAnimatorScript::EvalEnum(const char* token, size_t len, void* callBack, SkScriptValue* value) {
161 value->fType = SkType_Int;
162 if (MapEnums(tokens, token, len, (int*)&value->fOperand.fS32))
167 bool SkAnimatorScript::EvalID(const char* token, size_t len, void* user, SkScriptValue* value) {
179 value->fOperand.fDisplayable = parent;
180 value->fType = SkType_Displayable;
184 if (displayable && EvalMember(token, len, displayable, engine, value))
186 value->fOperand.fString = NULL;
187 value->fType = SkType_String;
190 value->fOperand.fDisplayable = displayable;
191 value->fType = SkType_Displayable;
203 bool SkAnimatorScript::EvalNamedColor(const char* token, size_t len, void* callback, SkScriptValue* value) {
204 value->fType = SkType_Int;
205 if (SkParse::FindNamedColor(token, len, (SkColor*) &value->fOperand.fS32) != NULL)
211 void* eng, SkScriptValue* value) {
224 value->fOperand.fS32 = result;
225 value->fType = SkType_Int;
230 SkDisplayable* displayable, SkScriptValue* value) {
244 value->fOperand.fS32 = *(int32_t*) info->memberData(displayable); // OK for SkScalar too
246 value->fOperand.fScalar = SkScalarDiv((SkScalar) value->fOperand.fS32, 1000); // dividing two ints is the same as dividing two scalars
254 value->fOperand.fString = new SkString(*displayableString);
265 SkTypedArray* array = value->fOperand.fArray = new SkTypedArray(original);
276 value->fType = type;
281 SkScriptValue* value) {
287 value->fOperand.fDisplayable = named;
288 value->fType = SkType_Displayable;
295 if (displayable->getProperty(info->propertyIndex(), value) == false) {
300 return EvalMemberCommon(engine, info, displayable, value);
304 SkTDArray<SkScriptValue>& params, void* eng, SkScriptValue* value) {
315 value);
316 return EvalMemberCommon(engine, info, displayable, value);
321 SkScriptValue value;
322 bool success = engine.evaluate(script, &value, SkType_Displayable);
324 *result = value.fOperand.fDisplayable;
330 SkScriptValue value;
331 bool success = engine.evaluate(script, &value, SkType_Int);
333 *result = value.fOperand.fS32;
339 SkScriptValue value;
340 bool success = engine.evaluate(script, &value, SkType_Float);
342 *result = value.fOperand.fScalar;
348 SkScriptValue value;
349 bool success = engine.evaluate(script, &value, SkType_String);
351 result->set(*(value.fOperand.fString));
358 SkScriptValue value;
359 bool success = engine.evaluate(script, &value, SkType_String);
361 result->set(*(value.fOperand.fString));
372 bool SkAnimatorScript::Infinity(const char* token, size_t len, void* user, SkScriptValue* value) {
375 value->fType = SkType_Float;
376 value->fOperand.fScalar = SK_ScalarInfinity;
381 void* eng, SkScriptValue* value) {
389 value->fType = SkType_Int;
390 value->fOperand.fS32 = type == SkType_Float ? SkScalarIsNaN(scalar) == false &&
396 void* eng, SkScriptValue* value) {
402 value->fType = SkType_Int;
403 value->fOperand.fS32 = scriptValue->fType == SkType_Float ? SkScalarIsNaN(scriptValue->fOperand.fScalar) : 0;
407 bool SkAnimatorScript::MapEnums(const char* ptr, const char* match, size_t len, int* value) {
418 *value = index;
427 bool SkAnimatorScript::NaN(const char* token, size_t len, void* user, SkScriptValue* value) {
430 value->fType = SkType_Float;
431 value->fOperand.fScalar = SK_ScalarNaN;
436 bool SkAnimatorScript::ObjectToString(void* object, void* user, SkScriptValue* value) {
443 value->fOperand.fString = new SkString(key);
444 value->fType = SkType_String;
461 scriptValue->fOperand.fS32 = boxedValue->value;
465 scriptValue->fOperand.fS32 = boxedValue->value;
469 scriptValue->fOperand.fScalar = boxedValue->value;
473 scriptValue->fOperand.fString = SkNEW_ARGS(SkString, (boxedValue->value));
510 "<int id='idx' value='2' />\n"
511 "<int id='idy' value='2' />\n"
512 "<string id='alpha' value='abc' />\n"
517 "<set field='value' to='evt.x.int' />\n"
541 { "idx.value", SkType_Int, 2 DEFAULT_ANSWER DEFAULT_ANSWER },
542 { "alpha.value", SkType_String, 0, 0, "abc" },
544 { "alpha.value+alpha.value", SkType_String, 0, 0, "abcabc" },
549 { "alpha.value.slice(1,2)", SkType_String, 0, 0, "b" },
555 { "0 ? idx.value : 1", SkType_Int, 1 DEFAULT_ANSWER DEFAULT_ANSWER },
557 { "0 ? alpha.value.slice(1,2) : 1", SkType_Int, 1 DEFAULT_ANSWER DEFAULT_ANSWER },
571 // set up animator with memory script above, then run value tests
574 SkScriptValue value;
576 bool success = engine.evaluateScript(&script, &value);
582 SkASSERT(value.fType == scriptTests[index].fType);
584 switch (value.fType) {
586 SkASSERT(value.fOperand.fS32 == scriptTests[index].fIntAnswer);
589 error = SkScalarAbs(value.fOperand.fScalar - scriptTests[index].fScalarAnswer);
593 SkASSERT(strcmp(value.fOperand.fString->c_str(), scriptTests[index].fStringAnswer) == 0);