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 "SkScript.h" | 10 #include "SkScript.h" |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 fError = kCouldNotFindReferencedID; // note: never generated by standard
animator plugins | 379 fError = kCouldNotFindReferencedID; // note: never generated by standard
animator plugins |
380 return false; | 380 return false; |
381 } | 381 } |
382 return evaluateDotParam(script, suppressed, field, fieldLength); | 382 return evaluateDotParam(script, suppressed, field, fieldLength); |
383 } | 383 } |
384 | 384 |
385 bool SkScriptEngine::evaluateDotParam(const char*& script, bool suppressed, | 385 bool SkScriptEngine::evaluateDotParam(const char*& script, bool suppressed, |
386 const char* field, size_t fieldLength) { | 386 const char* field, size_t fieldLength) { |
387 void* object; | 387 void* object; |
388 if (suppressed) | 388 if (suppressed) |
389 object = NULL; | 389 object = nullptr; |
390 else { | 390 else { |
391 if (fTypeStack.top() != kObject) { | 391 if (fTypeStack.top() != kObject) { |
392 fError = kDotOperatorExpectsObject; | 392 fError = kDotOperatorExpectsObject; |
393 return false; | 393 return false; |
394 } | 394 } |
395 object = fOperandStack.top().fObject; | 395 object = fOperandStack.top().fObject; |
396 fTypeStack.pop(); | 396 fTypeStack.pop(); |
397 fOperandStack.pop(); | 397 fOperandStack.pop(); |
398 } | 398 } |
399 char ch; // see if it is a simple member or a function | 399 char ch; // see if it is a simple member or a function |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 commonCallBack(kFunction, callBack, userStorage); | 485 commonCallBack(kFunction, callBack, userStorage); |
486 } | 486 } |
487 | 487 |
488 bool SkScriptEngine::functionParams(const char** scriptPtr, SkTDArray<SkScriptVa
lue>& params) { | 488 bool SkScriptEngine::functionParams(const char** scriptPtr, SkTDArray<SkScriptVa
lue>& params) { |
489 (*scriptPtr)++; // skip open paren | 489 (*scriptPtr)++; // skip open paren |
490 *fOpStack.push() = kParen; | 490 *fOpStack.push() = kParen; |
491 *fBraceStack.push() = kFunctionBrace; | 491 *fBraceStack.push() = kFunctionBrace; |
492 SkBool suppressed = fSuppressStack.top().fSuppress; | 492 SkBool suppressed = fSuppressStack.top().fSuppress; |
493 do { | 493 do { |
494 SkScriptValue value; | 494 SkScriptValue value; |
495 bool success = innerScript(scriptPtr, suppressed ? NULL : &value); | 495 bool success = innerScript(scriptPtr, suppressed ? nullptr : &value); |
496 if (success == false) { | 496 if (success == false) { |
497 fError = kErrorInFunctionParameters; | 497 fError = kErrorInFunctionParameters; |
498 return false; | 498 return false; |
499 } | 499 } |
500 if (suppressed) | 500 if (suppressed) |
501 continue; | 501 continue; |
502 *params.append() = value; | 502 *params.append() = value; |
503 } while ((*scriptPtr)[-1] == ','); | 503 } while ((*scriptPtr)[-1] == ','); |
504 fBraceStack.pop(); | 504 fBraceStack.pop(); |
505 fOpStack.pop(); // pop paren | 505 fOpStack.pop(); // pop paren |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 SkASSERT(success); | 552 SkASSERT(success); |
553 if (suppressed == false) { | 553 if (suppressed == false) { |
554 if (tokenValue.fType == SkType_Displayable) { | 554 if (tokenValue.fType == SkType_Displayable) { |
555 SkASSERT(SkDisplayType::IsDisplayable(tokenInfo->getType
())); | 555 SkASSERT(SkDisplayType::IsDisplayable(tokenInfo->getType
())); |
556 fDisplayable->setReference(tokenInfo, tokenValue.fOperan
d.fDisplayable); | 556 fDisplayable->setReference(tokenInfo, tokenValue.fOperan
d.fDisplayable); |
557 } else { | 557 } else { |
558 if (tokenValue.fType != tokenInfo->getType()) { | 558 if (tokenValue.fType != tokenInfo->getType()) { |
559 if (convertTo(tokenInfo->getType(), &tokenValue) ==
false) | 559 if (convertTo(tokenInfo->getType(), &tokenValue) ==
false) |
560 return false; | 560 return false; |
561 } | 561 } |
562 tokenInfo->writeValue(fDisplayable, NULL, 0, 0, | 562 tokenInfo->writeValue(fDisplayable, nullptr, 0, 0, |
563 (void*) ((char*) fInfo->memberData(fDisplayable) + t
okenInfo->fOffset + fArrayOffset), | 563 (void*) ((char*) fInfo->memberData(fDisplayable) + t
okenInfo->fOffset + fArrayOffset), |
564 tokenInfo->getType(), tokenValue); | 564 tokenInfo->getType(), tokenValue); |
565 } | 565 } |
566 } | 566 } |
567 lastPush = false; | 567 lastPush = false; |
568 continue; | 568 continue; |
569 } else | 569 } else |
570 #endif | 570 #endif |
571 if (fBraceStack.top() == kArrayBrace) { | 571 if (fBraceStack.top() == kArrayBrace) { |
572 SkScriptValue tokenValue; | 572 SkScriptValue tokenValue; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 continue; | 628 continue; |
629 } | 629 } |
630 } | 630 } |
631 if (ch == '0' && (script[1] & ~0x20) == 'X') { | 631 if (ch == '0' && (script[1] & ~0x20) == 'X') { |
632 if (lastPush != false) { | 632 if (lastPush != false) { |
633 fError = kExpectedOperator; | 633 fError = kExpectedOperator; |
634 return false; | 634 return false; |
635 } | 635 } |
636 script += 2; | 636 script += 2; |
637 script = SkParse::FindHex(script, (uint32_t*)&operand.fS32); | 637 script = SkParse::FindHex(script, (uint32_t*)&operand.fS32); |
638 if (script == NULL) { | 638 if (script == nullptr) { |
639 fError = kExpectedHex; | 639 fError = kExpectedHex; |
640 return false; | 640 return false; |
641 } | 641 } |
642 goto intCommon; | 642 goto intCommon; |
643 } | 643 } |
644 if (lastPush == false && ch == '.') | 644 if (lastPush == false && ch == '.') |
645 goto scalarCommon; | 645 goto scalarCommon; |
646 if (ch >= '0' && ch <= '9') { | 646 if (ch >= '0' && ch <= '9') { |
647 if (lastPush != false) { | 647 if (lastPush != false) { |
648 fError = kExpectedOperator; | 648 fError = kExpectedOperator; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 *fTypeStack.push() = kString; | 704 *fTypeStack.push() = kString; |
705 fOperandStack.push(operand); | 705 fOperandStack.push(operand); |
706 } | 706 } |
707 lastPush = true; | 707 lastPush = true; |
708 continue; | 708 continue; |
709 } | 709 } |
710 ; | 710 ; |
711 if (ch == '.') { | 711 if (ch == '.') { |
712 if (fTokenLength == 0) { | 712 if (fTokenLength == 0) { |
713 SkScriptValue scriptValue; | 713 SkScriptValue scriptValue; |
714 SkDEBUGCODE(scriptValue.fOperand.fObject = NULL); | 714 SkDEBUGCODE(scriptValue.fOperand.fObject = nullptr); |
715 int tokenLength = token_length(++script); | 715 int tokenLength = token_length(++script); |
716 const char* token = script; | 716 const char* token = script; |
717 script += tokenLength; | 717 script += tokenLength; |
718 if (suppressed == false) { | 718 if (suppressed == false) { |
719 if (fTypeStack.count() == 0) { | 719 if (fTypeStack.count() == 0) { |
720 fError = kExpectedTokenBeforeDotOperator; | 720 fError = kExpectedTokenBeforeDotOperator; |
721 return false; | 721 return false; |
722 } | 722 } |
723 SkOpType topType; | 723 SkOpType topType; |
724 fTypeStack.pop(&topType); | 724 fTypeStack.pop(&topType); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 } | 873 } |
874 #endif | 874 #endif |
875 | 875 |
876 bool SkScriptEngine::handleArrayIndexer(const char** scriptPtr, bool suppressed)
{ | 876 bool SkScriptEngine::handleArrayIndexer(const char** scriptPtr, bool suppressed)
{ |
877 SkScriptValue scriptValue; | 877 SkScriptValue scriptValue; |
878 (*scriptPtr)++; | 878 (*scriptPtr)++; |
879 *fOpStack.push() = kParen; | 879 *fOpStack.push() = kParen; |
880 *fBraceStack.push() = kArrayBrace; | 880 *fBraceStack.push() = kArrayBrace; |
881 SkOpType saveType = fReturnType; | 881 SkOpType saveType = fReturnType; |
882 fReturnType = kInt; | 882 fReturnType = kInt; |
883 bool success = innerScript(scriptPtr, suppressed == false ? &scriptValue : N
ULL); | 883 bool success = innerScript(scriptPtr, suppressed == false ? &scriptValue : n
ullptr); |
884 if (success == false) | 884 if (success == false) |
885 return false; | 885 return false; |
886 fReturnType = saveType; | 886 fReturnType = saveType; |
887 if (suppressed == false) { | 887 if (suppressed == false) { |
888 if (convertTo(SkType_Int, &scriptValue) == false) | 888 if (convertTo(SkType_Int, &scriptValue) == false) |
889 return false; | 889 return false; |
890 int index = scriptValue.fOperand.fS32; | 890 int index = scriptValue.fOperand.fS32; |
891 SkScriptValue scriptValue; | 891 SkScriptValue scriptValue; |
892 SkOpType type; | 892 SkOpType type; |
893 fTypeStack.pop(&type); | 893 fTypeStack.pop(&type); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 if (suppressed) | 1030 if (suppressed) |
1031 goto done; | 1031 goto done; |
1032 success = false; // note that with standard animator-script plugins, callbac
k never returns false | 1032 success = false; // note that with standard animator-script plugins, callbac
k never returns false |
1033 { | 1033 { |
1034 for (UserCallBack* callBack = fUserCallBacks.begin(); callBack < fUserCa
llBacks.end(); callBack++) { | 1034 for (UserCallBack* callBack = fUserCallBacks.begin(); callBack < fUserCa
llBacks.end(); callBack++) { |
1035 if (callBack->fCallBackType != kProperty) | 1035 if (callBack->fCallBackType != kProperty) |
1036 continue; | 1036 continue; |
1037 success = (*callBack->fPropertyCallBack)(fToken, fTokenLength, | 1037 success = (*callBack->fPropertyCallBack)(fToken, fTokenLength, |
1038 callBack->fUserStorage, &callbackResult); | 1038 callBack->fUserStorage, &callbackResult); |
1039 if (success) { | 1039 if (success) { |
1040 if (callbackResult.fType == SkType_String && callbackResult.fOpe
rand.fString == NULL) { | 1040 if (callbackResult.fType == SkType_String && callbackResult.fOpe
rand.fString == nullptr) { |
1041 callbackResult.fOperand.fString = new SkString(fToken, fToke
nLength); | 1041 callbackResult.fOperand.fString = new SkString(fToken, fToke
nLength); |
1042 track(callbackResult.fOperand.fString); | 1042 track(callbackResult.fOperand.fString); |
1043 } | 1043 } |
1044 fOperandStack.push(callbackResult.fOperand); | 1044 fOperandStack.push(callbackResult.fOperand); |
1045 *fTypeStack.push() = ToOpType(callbackResult.fType); | 1045 *fTypeStack.push() = ToOpType(callbackResult.fType); |
1046 goto done; | 1046 goto done; |
1047 } | 1047 } |
1048 } | 1048 } |
1049 } | 1049 } |
1050 done: | 1050 done: |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 } | 1310 } |
1311 if (type2 == kInt) { | 1311 if (type2 == kInt) { |
1312 operand2.fScalar = IntToScalar(operand2.fS32); | 1312 operand2.fScalar = IntToScalar(operand2.fS32); |
1313 type2 = kScalar; | 1313 type2 = kScalar; |
1314 } | 1314 } |
1315 } | 1315 } |
1316 } | 1316 } |
1317 if ((type1 & attributes->fLeftType) == 0 || type1 != type2) { | 1317 if ((type1 & attributes->fLeftType) == 0 || type1 != type2) { |
1318 if (type1 == kString) { | 1318 if (type1 == kString) { |
1319 const char* result = SkParse::FindScalar(operand1.fString->c_str
(), &operand1.fScalar); | 1319 const char* result = SkParse::FindScalar(operand1.fString->c_str
(), &operand1.fScalar); |
1320 if (result == NULL) { | 1320 if (result == nullptr) { |
1321 fError = kExpectedNumber; | 1321 fError = kExpectedNumber; |
1322 return false; | 1322 return false; |
1323 } | 1323 } |
1324 type1 = kScalar; | 1324 type1 = kScalar; |
1325 } | 1325 } |
1326 if (type1 == kScalar && (attributes->fLeftType == kInt || type2 == k
Int)) { | 1326 if (type1 == kScalar && (attributes->fLeftType == kInt || type2 == k
Int)) { |
1327 operand1.fS32 = SkScalarFloorToInt(operand1.fScalar); | 1327 operand1.fS32 = SkScalarFloorToInt(operand1.fScalar); |
1328 type1 = kInt; | 1328 type1 = kInt; |
1329 } | 1329 } |
1330 } | 1330 } |
1331 } | 1331 } |
1332 if ((type2 & attributes->fRightType) == 0 || type1 != type2) { | 1332 if ((type2 & attributes->fRightType) == 0 || type1 != type2) { |
1333 if (type2 == kString) { | 1333 if (type2 == kString) { |
1334 const char* result = SkParse::FindScalar(operand2.fString->c_str(),
&operand2.fScalar); | 1334 const char* result = SkParse::FindScalar(operand2.fString->c_str(),
&operand2.fScalar); |
1335 if (result == NULL) { | 1335 if (result == nullptr) { |
1336 fError = kExpectedNumber; | 1336 fError = kExpectedNumber; |
1337 return false; | 1337 return false; |
1338 } | 1338 } |
1339 type2 = kScalar; | 1339 type2 = kScalar; |
1340 } | 1340 } |
1341 if (type2 == kScalar && (attributes->fRightType == kInt || type1 == kInt
)) { | 1341 if (type2 == kScalar && (attributes->fRightType == kInt || type1 == kInt
)) { |
1342 operand2.fS32 = SkScalarFloorToInt(operand2.fScalar); | 1342 operand2.fS32 = SkScalarFloorToInt(operand2.fScalar); |
1343 type2 = kInt; | 1343 type2 = kInt; |
1344 } | 1344 } |
1345 } | 1345 } |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1480 } | 1480 } |
1481 | 1481 |
1482 void SkScriptEngine::unboxCallBack(_unboxCallBack func, void* userStorage) { | 1482 void SkScriptEngine::unboxCallBack(_unboxCallBack func, void* userStorage) { |
1483 UserCallBack callBack; | 1483 UserCallBack callBack; |
1484 callBack.fUnboxCallBack = func; | 1484 callBack.fUnboxCallBack = func; |
1485 commonCallBack(kUnbox, callBack, userStorage); | 1485 commonCallBack(kUnbox, callBack, userStorage); |
1486 } | 1486 } |
1487 | 1487 |
1488 bool SkScriptEngine::ConvertTo(SkScriptEngine* engine, SkDisplayTypes toType, Sk
ScriptValue* value ) { | 1488 bool SkScriptEngine::ConvertTo(SkScriptEngine* engine, SkDisplayTypes toType, Sk
ScriptValue* value ) { |
1489 SkASSERT(value); | 1489 SkASSERT(value); |
1490 if (SkDisplayType::IsEnum(NULL /* fMaker */, toType)) | 1490 if (SkDisplayType::IsEnum(nullptr /* fMaker */, toType)) |
1491 toType = SkType_Int; | 1491 toType = SkType_Int; |
1492 if (toType == SkType_Point || toType == SkType_3D_Point) | 1492 if (toType == SkType_Point || toType == SkType_3D_Point) |
1493 toType = SkType_Float; | 1493 toType = SkType_Float; |
1494 if (toType == SkType_Drawable) | 1494 if (toType == SkType_Drawable) |
1495 toType = SkType_Displayable; | 1495 toType = SkType_Displayable; |
1496 SkDisplayTypes type = value->fType; | 1496 SkDisplayTypes type = value->fType; |
1497 if (type == toType) | 1497 if (type == toType) |
1498 return true; | 1498 return true; |
1499 SkOperand& operand = value->fOperand; | 1499 SkOperand& operand = value->fOperand; |
1500 bool success = true; | 1500 bool success = true; |
1501 switch (toType) { | 1501 switch (toType) { |
1502 case SkType_Int: | 1502 case SkType_Int: |
1503 if (type == SkType_Boolean) | 1503 if (type == SkType_Boolean) |
1504 break; | 1504 break; |
1505 if (type == SkType_Float) | 1505 if (type == SkType_Float) |
1506 operand.fS32 = SkScalarFloorToInt(operand.fScalar); | 1506 operand.fS32 = SkScalarFloorToInt(operand.fScalar); |
1507 else { | 1507 else { |
1508 if (type != SkType_String) { | 1508 if (type != SkType_String) { |
1509 success = false; | 1509 success = false; |
1510 break; // error | 1510 break; // error |
1511 } | 1511 } |
1512 success = SkParse::FindS32(operand.fString->c_str(), &operand.fS
32) != NULL; | 1512 success = SkParse::FindS32(operand.fString->c_str(), &operand.fS
32) != nullptr; |
1513 } | 1513 } |
1514 break; | 1514 break; |
1515 case SkType_Float: | 1515 case SkType_Float: |
1516 if (type == SkType_Int) { | 1516 if (type == SkType_Int) { |
1517 if (operand.fS32 == SK_NaN32) | 1517 if (operand.fS32 == SK_NaN32) |
1518 operand.fScalar = SK_ScalarNaN; | 1518 operand.fScalar = SK_ScalarNaN; |
1519 else if (SkAbs32(operand.fS32) == SK_MaxS32) | 1519 else if (SkAbs32(operand.fS32) == SK_MaxS32) |
1520 operand.fScalar = SkSign32(operand.fS32) * SK_ScalarMax; | 1520 operand.fScalar = SkSign32(operand.fS32) * SK_ScalarMax; |
1521 else | 1521 else |
1522 operand.fScalar = SkIntToScalar(operand.fS32); | 1522 operand.fScalar = SkIntToScalar(operand.fS32); |
1523 } else { | 1523 } else { |
1524 if (type != SkType_String) { | 1524 if (type != SkType_String) { |
1525 success = false; | 1525 success = false; |
1526 break; // error | 1526 break; // error |
1527 } | 1527 } |
1528 success = SkParse::FindScalar(operand.fString->c_str(), &operand
.fScalar) != NULL; | 1528 success = SkParse::FindScalar(operand.fString->c_str(), &operand
.fScalar) != nullptr; |
1529 } | 1529 } |
1530 break; | 1530 break; |
1531 case SkType_String: { | 1531 case SkType_String: { |
1532 SkString* strPtr = new SkString(); | 1532 SkString* strPtr = new SkString(); |
1533 SkASSERT(engine); | 1533 SkASSERT(engine); |
1534 engine->track(strPtr); | 1534 engine->track(strPtr); |
1535 if (type == SkType_Int) { | 1535 if (type == SkType_Int) { |
1536 strPtr->appendS32(operand.fS32); | 1536 strPtr->appendS32(operand.fS32); |
1537 } else if (type == SkType_Displayable) { | 1537 } else if (type == SkType_Displayable) { |
1538 SkASSERT(0); // must call through instance version instead of st
atic version | 1538 SkASSERT(0); // must call through instance version instead of st
atic version |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1588 return SkType_Displayable; | 1588 return SkType_Displayable; |
1589 // case kStruct: | 1589 // case kStruct: |
1590 // return SkType_Structure; | 1590 // return SkType_Structure; |
1591 default: | 1591 default: |
1592 SkASSERT(0); | 1592 SkASSERT(0); |
1593 return SkType_Unknown; | 1593 return SkType_Unknown; |
1594 } | 1594 } |
1595 } | 1595 } |
1596 | 1596 |
1597 SkScriptEngine::SkOpType SkScriptEngine::ToOpType(SkDisplayTypes type) { | 1597 SkScriptEngine::SkOpType SkScriptEngine::ToOpType(SkDisplayTypes type) { |
1598 if (SkDisplayType::IsDisplayable(NULL /* fMaker */, type)) | 1598 if (SkDisplayType::IsDisplayable(nullptr /* fMaker */, type)) |
1599 return (SkOpType) kObject; | 1599 return (SkOpType) kObject; |
1600 if (SkDisplayType::IsEnum(NULL /* fMaker */, type)) | 1600 if (SkDisplayType::IsEnum(nullptr /* fMaker */, type)) |
1601 return kInt; | 1601 return kInt; |
1602 switch (type) { | 1602 switch (type) { |
1603 case SkType_ARGB: | 1603 case SkType_ARGB: |
1604 case SkType_MSec: | 1604 case SkType_MSec: |
1605 case SkType_Int: | 1605 case SkType_Int: |
1606 return kInt; | 1606 return kInt; |
1607 case SkType_Float: | 1607 case SkType_Float: |
1608 case SkType_Point: | 1608 case SkType_Point: |
1609 case SkType_3D_Point: | 1609 case SkType_3D_Point: |
1610 return kScalar; | 1610 return kScalar; |
(...skipping 29 matching lines...) Expand all Loading... |
1640 return false; | 1640 return false; |
1641 } | 1641 } |
1642 return true; // no error | 1642 return true; // no error |
1643 } | 1643 } |
1644 | 1644 |
1645 #ifdef SK_SUPPORT_UNITTEST | 1645 #ifdef SK_SUPPORT_UNITTEST |
1646 | 1646 |
1647 #include "SkFloatingPoint.h" | 1647 #include "SkFloatingPoint.h" |
1648 | 1648 |
1649 #define DEF_SCALAR_ANSWER 0 | 1649 #define DEF_SCALAR_ANSWER 0 |
1650 #define DEF_STRING_ANSWER NULL | 1650 #define DEF_STRING_ANSWER nullptr |
1651 | 1651 |
1652 #define testInt(expression) { #expression, SkType_Int, expression, DEF_SCALAR_AN
SWER, DEF_STRING_ANSWER } | 1652 #define testInt(expression) { #expression, SkType_Int, expression, DEF_SCALAR_AN
SWER, DEF_STRING_ANSWER } |
1653 #define testScalar(expression) { #expression, SkType_Float, 0, (float) expre
ssion, DEF_STRING_ANSWER } | 1653 #define testScalar(expression) { #expression, SkType_Float, 0, (float) expre
ssion, DEF_STRING_ANSWER } |
1654 #define testRemainder(exp1, exp2) { #exp1 "%" #exp2, SkType_Float, 0, sk_flo
at_mod(exp1, exp2), DEF_STRING_ANSWER } | 1654 #define testRemainder(exp1, exp2) { #exp1 "%" #exp2, SkType_Float, 0, sk_flo
at_mod(exp1, exp2), DEF_STRING_ANSWER } |
1655 #define testTrue(expression) { #expression, SkType_Int, 1, DEF_SCALAR_ANSWER, DE
F_STRING_ANSWER } | 1655 #define testTrue(expression) { #expression, SkType_Int, 1, DEF_SCALAR_ANSWER, DE
F_STRING_ANSWER } |
1656 #define testFalse(expression) { #expression, SkType_Int, 0, DEF_SCALAR_ANSWER, D
EF_STRING_ANSWER } | 1656 #define testFalse(expression) { #expression, SkType_Int, 0, DEF_SCALAR_ANSWER, D
EF_STRING_ANSWER } |
1657 | 1657 |
1658 static const SkScriptNAnswer scriptTests[] = { | 1658 static const SkScriptNAnswer scriptTests[] = { |
1659 testInt(1>1/2), | 1659 testInt(1>1/2), |
1660 testInt((6+7)*8), | 1660 testInt((6+7)*8), |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1881 break; | 1881 break; |
1882 case SkType_String: | 1882 case SkType_String: |
1883 SkASSERT(strcmp(value.fOperand.fString->c_str(), scriptTests[ind
ex].fStringAnswer) == 0); | 1883 SkASSERT(strcmp(value.fOperand.fString->c_str(), scriptTests[ind
ex].fStringAnswer) == 0); |
1884 break; | 1884 break; |
1885 default: | 1885 default: |
1886 SkASSERT(0); | 1886 SkASSERT(0); |
1887 } | 1887 } |
1888 } | 1888 } |
1889 } | 1889 } |
1890 #endif | 1890 #endif |
OLD | NEW |