migrate spiral demo from canvaskit
- add atan, fract, dividef, subtractf
Also wants mix(), but I'm still learning how to handle 2 args
functions (e.g. how to support atan(y,x) as well)
Change-Id: Ib9f233cd1c4266110cfea68a7d444f834f875f1f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286276
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/src/sksl/SkSLByteCode.cpp b/src/sksl/SkSLByteCode.cpp
index c2a1ab6..3af0f6f 100644
--- a/src/sksl/SkSLByteCode.cpp
+++ b/src/sksl/SkSLByteCode.cpp
@@ -51,6 +51,7 @@
VECTOR_MATRIX_DISASSEMBLE(kAddF, "addf")
VECTOR_DISASSEMBLE(kAddI, "addi")
case ByteCodeInstruction::kAndB: printf("andb"); break;
+ VECTOR_DISASSEMBLE(kATan, "atan")
case ByteCodeInstruction::kBranch: printf("branch %d", READ16()); break;
case ByteCodeInstruction::kCall: printf("call %d", READ8()); break;
case ByteCodeInstruction::kCallExternal: {
@@ -85,6 +86,7 @@
VECTOR_DISASSEMBLE(kDivideS, "divideS")
VECTOR_DISASSEMBLE(kDivideU, "divideu")
VECTOR_MATRIX_DISASSEMBLE(kDup, "dup")
+ VECTOR_DISASSEMBLE(kFract, "fract")
case ByteCodeInstruction::kInverse2x2: printf("inverse2x2"); break;
case ByteCodeInstruction::kInverse3x3: printf("inverse3x3"); break;
case ByteCodeInstruction::kInverse4x4: printf("inverse4x4"); break;
@@ -654,6 +656,8 @@
continue;
}
+ VECTOR_UNARY_FN(kFract, skvx::fract, fFloat)
+
case ByteCodeInstruction::kInverse2x2:
Inverse2x2(sp);
continue;
@@ -1062,6 +1066,7 @@
continue;
}
+ VECTOR_UNARY_FN(kATan, skvx::atan, fFloat)
VECTOR_UNARY_FN(kTan, skvx::tan, fFloat)
case ByteCodeInstruction::kWriteExternal4: