length()

 - add length() as a special intrinsic
 - style refactoring I wrote to help debug the CL
 - impl dup2,3,4 in program_fn
 - (better) fix dup2,3,4 in byte code interpreter

Change-Id: I7cd94a4bc03efc6af2053e9e6ae18b4da94363ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286896
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/gm/runtimeshader.cpp b/gm/runtimeshader.cpp
index 24c5534..6ba36e6 100644
--- a/gm/runtimeshader.cpp
+++ b/gm/runtimeshader.cpp
@@ -189,7 +189,7 @@
 
             void main(float2 p, inout half4 color) {
                 float2 pp = p - in_center;
-                float radius = sqrt(dot(pp, pp));
+                float radius = length(pp);
                 radius = sqrt(radius);
                 float angle = atan(pp.y / pp.x);
                 float t = (angle + 3.1415926/2) / (3.1415926);