Lines Matching refs:SkOperand2

19 { SkOperand2::kNoType, SkOperand2::kNoType, kNoBias, kResultIsNotBoolean },
20 { SkOperand2::OpType(SkOperand2::kS32 | SkOperand2::kScalar | SkOperand2::kString),
21SkOperand2::OpType(SkOperand2::kS32 | SkOperand2::kScalar | SkOperand2::kString), kTowardsString, …
22 { SkOperand2::kS32, SkOperand2::kS32, kNoBias, kResultIsNotBoolean }, // kBitAnd
23 { SkOperand2::kNoType, SkOperand2::kS32, kNoBias, kResultIsNotBoolean }, // kBitNot
24 { SkOperand2::kS32, SkOperand2::kS32, kNoBias, kResultIsNotBoolean }, // kBitOr
25 { SkOperand2::OpType(SkOperand2::kS32 | SkOperand2::kScalar),
26SkOperand2::OpType(SkOperand2::kS32 | SkOperand2::kScalar), kNoBias, kResultIsNotBoolean }, // kDi…
27 { SkOperand2::OpType(SkOperand2::kS32 | SkOperand2::kScalar | SkOperand2::kString),
28SkOperand2::OpType(SkOperand2::kS32 | SkOperand2::kScalar |SkOperand2:: kString), kTowardsNumber,
30 { SkOperand2::kS32, SkOperand2::kNoType, kNoBias, kResultIsNotBoolean }, // kFlipOps
31 { SkOperand2::OpType(SkOperand2::kS32 | SkOperand2::kScalar | SkOperand2::kString),
32SkOperand2::OpType(SkOperand2::kS32 | SkOperand2::kScalar | SkOperand2::kString), kTowardsNumber,
34 { SkOperand2::kNoType, SkOperand2::kS32, kNoBias, kResultIsNotBoolean }, // kLogicalAnd (really,…
35 { SkOperand2::kNoType, SkOperand2::kS32, kNoBias, kResultIsNotBoolean }, // kLogicalNot
36 { SkOperand2::kS32, SkOperand2::kS32, kNoBias, kResultIsNotBoolean }, // kLogicalOr
37 { SkOperand2::kNoType, SkOperand2::OpType(SkOperand2::kS32 | SkOperand2::kScalar), kNoBias, kResult…
38 { SkOperand2::OpType(SkOperand2::kS32 | SkOperand2::kScalar),
39SkOperand2::OpType(SkOperand2::kS32 |SkOperand2:: kScalar), kNoBias, kResultIsNotBoolean }, // kMo…
40 { SkOperand2::OpType(SkOperand2::kS32 | SkOperand2::kScalar),
41SkOperand2::OpType(SkOperand2::kS32 | SkOperand2::kScalar), kNoBias, kResultIsNotBoolean }, // kMu…
42 { SkOperand2::kS32, SkOperand2::kS32, kNoBias, kResultIsNotBoolean }, // kShiftLeft
43 { SkOperand2::kS32, SkOperand2::kS32, kNoBias, kResultIsNotBoolean }, // kShiftRight
44 { SkOperand2::OpType(SkOperand2::kS32 | SkOperand2::kScalar),
45SkOperand2::OpType(SkOperand2::kS32 | SkOperand2::kScalar), kNoBias, kResultIsNotBoolean }, // kSu…
46 { SkOperand2::kS32, SkOperand2::kS32, kNoBias, kResultIsNotBoolean } // kXor
122 SkScriptEngine2::SkScriptEngine2(SkOperand2::OpType returnType) : fActiveStream(&fStream), in SkScriptEngine2()
124 fAccumulatorType(SkOperand2::kNoType), in SkScriptEngine2()
155 SkOperand2::OpType toType, SkScriptEngine2::TypeOp op) { in addTokenConst()
181 if (fAccumulatorType == SkOperand2::kNoType) in addTokenValue()
188 if (reg == kAccumulator && fAccumulatorType != SkOperand2::kNoType) in addTokenValue()
191 case SkOperand2::kS32: in addTokenValue()
195 fAccumulatorType = SkOperand2::kS32; in addTokenValue()
199 case SkOperand2::kScalar: in addTokenValue()
203 fAccumulatorType = SkOperand2::kScalar; in addTokenValue()
207 case SkOperand2::kString: in addTokenValue()
211 fAccumulatorType = SkOperand2::kString; in addTokenValue()
320 gOpAttributes[op].fLeftType == SkOperand2::kNoType)) { in arithmeticOp()
335 const SkOperand2::OpType* paramTypes, int paramCount) { in convertParams()
346 bool SkScriptEngine2::convertTo(SkOperand2::OpType toType, SkScriptValue2* value ) { in convertTo()
347 SkOperand2::OpType type = value->fType; in convertTo()
350 if (type == SkOperand2::kObject) { in convertTo()
375 if (top.fType != SkOperand2::kObject) in evaluateDotParam()
401 if (fReturnType == SkOperand2::kNoType || fReturnType == SkOperand2::kString) { in evaluateScript()
421 if (array->getType() == SkOperand2::kString) { in forget()
430 if (array->getType() == SkOperand2::kArray) { in forget()
463 SkOperand2::OpType SkScriptEngine2::getUnboxType(SkOperand2 scriptValue) { in getUnboxType()
469 return SkOperand2::kObject; in getUnboxType()
493 SkOperand2::OpType type = fReturnType; in innerScript()
494 if (fReturnType == SkOperand2::kNoType) { in innerScript()
554 operand.fType = SkOperand2::kS32; in innerScript()
558 operand.fType = SkOperand2::kScalar; in innerScript()
598 operand.fType = SkOperand2::kString; in innerScript()
615 top.fType = SkOperand2::kObject; in innerScript()
640 operand.fType = SkOperand2::kArray; in innerScript()
702 SkOperand2::OpType lastType = fValueStack.top().fType; in innerScript()
728SkOperand2::OpType topType = fValueStack.count() > 0 ? fValueStack.top().fType : SkOperand2::kNoTy… in innerScript()
730 …topType == SkOperand2::kString && fReturnType != SkOperand2::kNoType) { // if result is a string, … in innerScript()
738 operand.fType = SkOperand2::kString; in innerScript()
761 if (value->fType != fReturnType && value->fType == SkOperand2::kObject && in innerScript()
762 fReturnType != SkOperand2::kNoType) in innerScript()
776 SkOperand2::OpType saveType = fReturnType; in handleArrayIndexer()
777 fReturnType = SkOperand2::kS32; in handleArrayIndexer()
781 success = convertTo(SkOperand2::kS32, &scriptValue); in handleArrayIndexer()
785 if (scriptValue.fType == SkOperand2::kObject) { in handleArrayIndexer()
788 SkASSERT(scriptValue.fType == SkOperand2::kArray); in handleArrayIndexer()
839 if (callbackResult.fType == SkOperand2::kString) in handleMember()
860 if (callbackResult.fType == SkOperand2::kString) in handleMemberFunction()
880 … if (callbackResult.fType == SkOperand2::kString && callbackResult.fOperand.fString == nullptr) { in handleProperty()
902 if (scriptValue->fType == SkOperand2::kString) in handleUnbox()
986 …SkASSERT(value.fType == SkOperand2::kS32 || value.fType == SkOperand2::kScalar); // !!! add error … in processLogicalOp()
987 … int index = value.fType == SkOperand2::kScalar ? SkScalarFloorToInt(value.fOperand.fScalar) : in processLogicalOp()
991 SkASSERT(arrayValue.fType == SkOperand2::kArray); // !!! add error handling in processLogicalOp()
993 SkOperand2 operand; in processLogicalOp()
1004 if (fAccumulatorType == SkOperand2::kNoType) { in processLogicalOp()
1008 SkASSERT(fAccumulatorType != SkOperand2::kString); // !!! add error handling in processLogicalOp()
1013 fAccumulatorType = SkOperand2::kNoType; in processLogicalOp()
1027 fAccumulatorType = SkOperand2::kNoType; in processLogicalOp()
1036 if (fAccumulatorType == SkOperand2::kNoType) { in processLogicalOp()
1037 …SkASSERT(fValueStack.top().fType == SkOperand2::kS32); // !!! add error handling, and conversion t… in processLogicalOp()
1041 SkASSERT(fAccumulatorType == SkOperand2::kS32); in processLogicalOp()
1051 fAccumulatorType = SkOperand2::kNoType; in processLogicalOp()
1072 if (attributes->fLeftType != SkOperand2::kNoType) { in processOp()
1084 if (value1.fType == SkOperand2::kObject && (value1.fType & attributes->fLeftType) == 0) { in processOp()
1089 if (value2.fType == SkOperand2::kObject && (value2.fType & attributes->fLeftType) == 0) { in processOp()
1093 if (attributes->fLeftType != SkOperand2::kNoType) { in processOp()
1095 … if ((attributes->fLeftType & SkOperand2::kString) && attributes->fBias & kTowardsString && in processOp()
1096 ((value1.fType | value2.fType) & SkOperand2::kString)) { in processOp()
1097 if (value1.fType == SkOperand2::kS32 || value1.fType == SkOperand2::kScalar) { in processOp()
1098 addTokenConst(&value1, kAccumulator, SkOperand2::kString, in processOp()
1099 … value1.fType == SkOperand2::kS32 ? kIntToString : kScalarToString); in processOp()
1101 if (value2.fType == SkOperand2::kS32 || value2.fType == SkOperand2::kScalar) { in processOp()
1102 addTokenConst(&value2, kOperand, SkOperand2::kString, in processOp()
1103 … value2.fType == SkOperand2::kS32 ? kIntToString2 : kScalarToString2); in processOp()
1105 … } else if (attributes->fLeftType & SkOperand2::kScalar && ((value1.fType | value2.fType) & in processOp()
1106 SkOperand2::kScalar)) { in processOp()
1107 if (value1.fType == SkOperand2::kS32) in processOp()
1108 addTokenConst(&value1, kAccumulator, SkOperand2::kScalar, kIntToScalar); in processOp()
1109 if (value2.fType == SkOperand2::kS32) in processOp()
1110 addTokenConst(&value2, kOperand, SkOperand2::kScalar, kIntToScalar2); in processOp()
1114 if (value1.fType == SkOperand2::kString) in processOp()
1115 addTokenConst(&value1, kAccumulator, SkOperand2::kScalar, kStringToScalar); in processOp()
1116 if (value1.fType == SkOperand2::kScalar && (attributes->fLeftType == SkOperand2::kS32 || in processOp()
1117 value2.fType == SkOperand2::kS32)) in processOp()
1118 addTokenConst(&value1, kAccumulator, SkOperand2::kS32, kScalarToInt); in processOp()
1121 AddTokenRegister rhRegister = attributes->fLeftType != SkOperand2::kNoType ? in processOp()
1124 if (value2.fType == SkOperand2::kString) in processOp()
1125 addTokenConst(&value2, rhRegister, SkOperand2::kScalar, kStringToScalar2); in processOp()
1126 if (value2.fType == SkOperand2::kScalar && (attributes->fRightType == SkOperand2::kS32 || in processOp()
1127 value1.fType == SkOperand2::kS32)) in processOp()
1128 addTokenConst(&value2, rhRegister, SkOperand2::kS32, kScalarToInt2); in processOp()
1131 if (value2.fType == SkOperand2::kScalar) in processOp()
1133 else if (value2.fType == SkOperand2::kString) in processOp()
1136 SkOperand2::OpType saveType = SkOperand2::kNoType; in processOp()
1142 fAccumulatorType = SkOperand2::kNoType; in processOp()
1145 if (attributes->fLeftType != SkOperand2::kNoType) { // two operands in processOp()
1162 value1.fType = SkOperand2::kS32; in processOp()
1163 else if (attributes->fLeftType == SkOperand2::kNoType) // unary operand in processOp()
1166 if (value1.fType == SkOperand2::kString) in processOp()
1168 else if (value1.fType == SkOperand2::kArray) in processOp()
1193 bool SkScriptEngine2::ConvertTo(SkScriptEngine2* engine, SkOperand2::OpType toType, SkScriptValue2*… in ConvertTo()
1195 SkOperand2::OpType type = value->fType; in ConvertTo()
1198 SkOperand2& operand = value->fOperand; in ConvertTo()
1201 case SkOperand2::kS32: in ConvertTo()
1202 if (type == SkOperand2::kScalar) in ConvertTo()
1205 SkASSERT(type == SkOperand2::kString); in ConvertTo()
1209 case SkOperand2::kScalar: in ConvertTo()
1210 if (type == SkOperand2::kS32) in ConvertTo()
1213 SkASSERT(type == SkOperand2::kString); in ConvertTo()
1217 case SkOperand2::kString: { in ConvertTo()
1221 if (type == SkOperand2::kS32) in ConvertTo()
1224 SkASSERT(type == SkOperand2::kScalar); in ConvertTo()
1229 case SkOperand2::kArray: { in ConvertTo()
1255 case SkOperand2::kS32: in ValueToString()
1259 case SkOperand2::kScalar: in ValueToString()
1263 case SkOperand2::kString: in ValueToString()
1276 #define testInt(expression) { #expression, SkOperand2::kS32, expression, 0, nullptr }
1277 #define testScalar(expression) { #expression, SkOperand2::kScalar, 0, (float) (expression), nullptr…
1278 #define testRemainder(exp1, exp2) { #exp1 "%" #exp2, SkOperand2::kScalar, 0, fmodf((float) exp1, (f…
1279 #define testTrue(expression) { #expression, SkOperand2::kS32, 1, 0, nullptr }
1280 #define testFalse(expression) { #expression, SkOperand2::kS32, 0, 0, nullptr }
1308 { "'123'+\"456\"", SkOperand2::kString, 0, 0, "123456" },
1309 { "123+\"456\"", SkOperand2::kString, 0, 0, "123456" },
1310 { "'123'+456", SkOperand2::kString, 0, 0, "123456" },
1311 { "'123'|\"456\"", SkOperand2::kS32, 123|456, 0, nullptr },
1312 { "123|\"456\"", SkOperand2::kS32, 123|456, 0, nullptr },
1313 { "'123'|456", SkOperand2::kS32, 123|456, 0, nullptr },
1314 { "'2'<11", SkOperand2::kS32, 1, 0, nullptr },
1315 { "2<'11'", SkOperand2::kS32, 1, 0, nullptr },
1316 { "'2'<'11'", SkOperand2::kS32, 0, 0, nullptr },
1468 , { "123.5", SkOperand2::kScalar, 0, SkIntToScalar(123) + SK_Scalar1/2, nullptr }
1486 case SkOperand2::kS32: in UnitTest()
1491 case SkOperand2::kScalar: in UnitTest()
1497 case SkOperand2::kString: in UnitTest()