8026871: NASHORN TEST: Enable possibility to test Nashorn use of JavaFX canvas.

Mon, 21 Oct 2013 13:31:03 +0400

author
kshefov
date
Mon, 21 Oct 2013 13:31:03 +0400
changeset 638
f22742d5daa3
parent 637
612886fe324d
child 643
d04028e6b624

8026871: NASHORN TEST: Enable possibility to test Nashorn use of JavaFX canvas.
Reviewed-by: jlaskey, sundar

make/build.xml file | annotate | diff | comparison | revisions
make/project.properties file | annotate | diff | comparison | revisions
test/script/jfx.js file | annotate | diff | comparison | revisions
test/script/jfx/flyingimage.js file | annotate | diff | comparison | revisions
test/script/jfx/flyingimage/flyingimage.png file | annotate | diff | comparison | revisions
test/script/jfx/flyingimage/golden/linux.png file | annotate | diff | comparison | revisions
test/script/jfx/flyingimage/golden/macosx.png file | annotate | diff | comparison | revisions
test/script/jfx/flyingimage/golden/windows.png file | annotate | diff | comparison | revisions
test/script/jfx/kaleidoscope.js file | annotate | diff | comparison | revisions
test/script/jfx/kaleidoscope/golden/linux.png file | annotate | diff | comparison | revisions
test/script/jfx/kaleidoscope/golden/macosx.png file | annotate | diff | comparison | revisions
test/script/jfx/kaleidoscope/golden/windows.png file | annotate | diff | comparison | revisions
     1.1 --- a/make/build.xml	Mon Oct 21 10:09:19 2013 +0530
     1.2 +++ b/make/build.xml	Mon Oct 21 13:31:03 2013 +0400
     1.3 @@ -46,6 +46,16 @@
     1.4      <available property="asm.available" classname="jdk.internal.org.objectweb.asm.Type"/>
     1.5      <!-- check if testng.jar is avaiable -->
     1.6      <available property="testng.available" file="${file.reference.testng.jar}"/>
     1.7 +    <!-- check if Jemmy ang testng.jar are avaiable -->
     1.8 +    <condition property="jemmy.jfx.testng.available" value="true">
     1.9 +      <and> 
    1.10 +        <available file="${file.reference.jemmyfx.jar}"/>
    1.11 +        <available file="${file.reference.jemmycore.jar}"/>
    1.12 +        <available file="${file.reference.jemmyawtinput.jar}"/>
    1.13 +        <available file="${file.reference.jfxrt.jar}"/>
    1.14 +        <isset property="testng.available"/>
    1.15 +      </and>
    1.16 +    </condition>
    1.17  
    1.18      <!-- enable/disable make code coverage -->
    1.19      <condition property="cc.enabled">
    1.20 @@ -351,6 +361,31 @@
    1.21        </java>
    1.22    </target>
    1.23  
    1.24 +  <target name="check-jemmy.jfx.testng" unless="jemmy.jfx.testng.available">
    1.25 +    <echo message="WARNING: Jemmy or JavaFX or TestNG not available, will not run tests. Please copy testng.jar, JemmyCore.jar, JemmyFX.jar, JemmyAWTInput.jar under test${file.separator}lib directory. And make sure you have jfxrt.jar in ${java.home}${file.separator}lib${file.separator}ext dir."/>
    1.26 +  </target>
    1.27 +
    1.28 +  <target name="testjfx" depends="jar, check-jemmy.jfx.testng, compile-test" if="jemmy.jfx.testng.available">
    1.29 +    <fileset id="test.classes" dir="${build.test.classes.dir}">
    1.30 +       <include name="**/framework/*Test.class"/>
    1.31 +    </fileset>
    1.32 +    
    1.33 +    <copy file="${file.reference.jfxrt.jar}" todir="dist"/>
    1.34 +    
    1.35 +    <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
    1.36 +       verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
    1.37 +      <jvmarg line="${ext.class.path}"/>
    1.38 +      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
    1.39 +      <propertyset>
    1.40 +        <propertyref prefix="testjfx-test-sys-prop."/>
    1.41 +        <mapper from="testjfx-test-sys-prop.*" to="*" type="glob"/>
    1.42 +      </propertyset>
    1.43 +      <classpath>
    1.44 +          <pathelement path="${testjfx.run.test.classpath}"/>
    1.45 +      </classpath>
    1.46 +    </testng>
    1.47 +  </target>
    1.48 +  
    1.49    <target name="test262" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
    1.50      <fileset id="test.classes" dir="${build.test.classes.dir}">
    1.51         <include name="**/framework/*Test.class"/>
     2.1 --- a/make/project.properties	Mon Oct 21 10:09:19 2013 +0530
     2.2 +++ b/make/project.properties	Mon Oct 21 13:31:03 2013 +0400
     2.3 @@ -118,6 +118,7 @@
     2.4  test.external.dir=test/script/external
     2.5  test262.dir=${test.external.dir}/test262
     2.6  test262.suite.dir=${test262.dir}/test/suite
     2.7 +testjfx.dir=${test.script.dir}/jfx
     2.8  
     2.9  test-sys-prop.test.dir=${test.dir}
    2.10  test-sys-prop.test.js.roots=${test.basic.dir} ${test.error.dir} ${test.sandbox.dir} ${test.trusted.dir}
    2.11 @@ -208,6 +209,32 @@
    2.12      ${test262.dir}/test/harness/framework.js \
    2.13      ${test262.dir}/test/harness/sta.js
    2.14  
    2.15 +# testjfx test root
    2.16 +testjfx-test-sys-prop.test.js.roots=${testjfx.dir}   
    2.17 +
    2.18 +# execute testjfx tests in shared nashorn context or not?
    2.19 +testjfx-test-sys-prop.test.js.shared.context=false
    2.20 +
    2.21 +# framework root for our script tests
    2.22 +testjfx-test-sys-prop.test.js.framework=\
    2.23 +    -fx \
    2.24 +    ${test.script.dir}${file.separator}jfx.js
    2.25 +
    2.26 +file.reference.jemmyfx.jar=test${file.separator}lib${file.separator}JemmyFX.jar
    2.27 +file.reference.jemmycore.jar=test${file.separator}lib${file.separator}JemmyCore.jar
    2.28 +file.reference.jemmyawtinput.jar=test${file.separator}lib${file.separator}JemmyAWTInput.jar
    2.29 +file.reference.jfxrt.jar=${java.home}${file.separator}lib${file.separator}ext${file.separator}jfxrt.jar
    2.30 +testjfx.run.test.classpath=\
    2.31 +    ${file.reference.jemmyfx.jar}${path.separator}\
    2.32 +    ${file.reference.jemmycore.jar}${path.separator}\
    2.33 +    ${file.reference.jemmyawtinput.jar}${path.separator}\
    2.34 +    ${file.reference.testng.jar}${path.separator}\
    2.35 +    ${nashorn.internal.tests.jar}${path.separator}\
    2.36 +    ${nashorn.api.tests.jar}    
    2.37 +
    2.38 +# testjfx VM options for script tests with @fork option
    2.39 +testjfx-test-sys-prop.test.fork.jvm.options=${run.test.jvmargs.main} -Xmx${run.test.xmx} -cp ${testjfx.run.test.classpath}
    2.40 +
    2.41  run.test.classpath=\
    2.42      ${file.reference.testng.jar}:\
    2.43      ${nashorn.internal.tests.jar}:\
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/test/script/jfx.js	Mon Oct 21 13:31:03 2013 +0400
     3.3 @@ -0,0 +1,92 @@
     3.4 +/*
     3.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
     3.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.7 + * 
     3.8 + * This code is free software; you can redistribute it and/or modify it
     3.9 + * under the terms of the GNU General Public License version 2 only, as
    3.10 + * published by the Free Software Foundation.
    3.11 + * 
    3.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    3.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    3.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    3.15 + * version 2 for more details (a copy is included in the LICENSE file that
    3.16 + * accompanied this code).
    3.17 + * 
    3.18 + * You should have received a copy of the GNU General Public License version
    3.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    3.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    3.21 + * 
    3.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    3.23 + * or visit www.oracle.com if you need additional information or have any
    3.24 + * questions.
    3.25 + */
    3.26 +
    3.27 +/**
    3.28 + * Base library for JavaFX canvas run by Nashorn testing.
    3.29 + * @subtest
    3.30 + * 
    3.31 + * 
    3.32 + */
    3.33 +
    3.34 +var System               = Java.type("java.lang.System");
    3.35 +var AWTImage             = Java.type("org.jemmy.image.AWTImage");
    3.36 +var PNGDecoder           = Java.type("org.jemmy.image.PNGDecoder");
    3.37 +var JemmyFxRoot          = Java.type("org.jemmy.fx.Root");
    3.38 +var AWTRobotCapturer     = Java.type("org.jemmy.image.AWTRobotCapturer");
    3.39 +var ByWindowType         = Java.type("org.jemmy.fx.ByWindowType");
    3.40 +var Scene                = Java.type("javafx.scene.Scene");
    3.41 +var Stage                = Java.type("javafx.stage.Stage");
    3.42 +var File                 = Java.type("java.io.File");
    3.43 +var Timer                = Java.type("java.util.Timer");
    3.44 +var TimerTask            = Java.type("java.util.TimerTask");
    3.45 +var OSInfo               = Java.type("sun.awt.OSInfo");
    3.46 +var OSType               = Java.type("sun.awt.OSInfo.OSType");
    3.47 +var StringBuffer         = Java.type("java.lang.StringBuffer");
    3.48 +
    3.49 +var WAIT = 2000;
    3.50 +var TESTNAME = "test";
    3.51 +var fsep = System.getProperty("file.separator");
    3.52 +
    3.53 +function checkImageAndExit() {
    3.54 +    var raceTimer = new Timer(true);
    3.55 +    var timerTask = new TimerTask() {
    3.56 +        run: function run() {
    3.57 +            var tmpdir = System.getProperty("java.io.tmpdir");
    3.58 +            var timenow = (new Date()).getTime();
    3.59 +            makeScreenShot(tmpdir + fsep + "screenshot" + timenow +".png");
    3.60 +            var dupImg = isDuplicateImages(tmpdir + fsep + "screenshot" + timenow +".png", __DIR__ + "jfx" + fsep + TESTNAME + fsep + "golden");
    3.61 +            (new File(mpdir + fsep + "screenshot" + timenow +".png")).delete();
    3.62 +            if (!dupImg) System.err.println("ERROR: screenshot does not match golden image");
    3.63 +            exit(0);
    3.64 +        }
    3.65 +    };
    3.66 +    raceTimer.schedule(timerTask, WAIT);
    3.67 +}
    3.68 +
    3.69 +function makeScreenShot(shootToImg) {
    3.70 +   JemmyFxRoot.ROOT.getEnvironment().setImageCapturer(new AWTRobotCapturer());
    3.71 +   var wrap = JemmyFxRoot.ROOT.lookup(new ByWindowType($STAGE.class)).lookup(Scene.class).wrap(0);
    3.72 +   var imageJemmy = wrap.getScreenImage();
    3.73 +   imageJemmy.save(shootToImg);
    3.74 +}
    3.75 +
    3.76 +function isDuplicateImages(file1, file2) {
    3.77 +    var f1 = new File(file1);
    3.78 +    var f2;
    3.79 +    var sb = new StringBuffer(file2);
    3.80 +    if (OSInfo.getOSType() == OSType.WINDOWS) {
    3.81 +        f2 = new File(sb.append(fsep + "windows.png").toString());
    3.82 +    } else if (OSInfo.getOSType() == OSType.LINUX) {
    3.83 +        f2 = new File(sb.append(fsep + "linux.png").toString());
    3.84 +    } else if (OSInfo.getOSType() == OSType.MACOSX) {
    3.85 +        f2 = new File(sb.append(fsep + "macosx.png").toString());
    3.86 +    }
    3.87 +    print(f1.getAbsolutePath());
    3.88 +    print(f2.getAbsolutePath());
    3.89 +    if (f1.exists() && f2.exists()) {
    3.90 +        var image1 = new AWTImage(PNGDecoder.decode(f1.getAbsolutePath()));
    3.91 +        var image2 = new AWTImage(PNGDecoder.decode(f2.getAbsolutePath()));
    3.92 +        return image1.compareTo(image2) == null ? true : false;
    3.93 +    }
    3.94 +    return false;
    3.95 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/test/script/jfx/flyingimage.js	Mon Oct 21 13:31:03 2013 +0400
     4.3 @@ -0,0 +1,83 @@
     4.4 +/*
     4.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
     4.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.7 + * 
     4.8 + * This code is free software; you can redistribute it and/or modify it
     4.9 + * under the terms of the GNU General Public License version 2 only, as
    4.10 + * published by the Free Software Foundation.
    4.11 + * 
    4.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    4.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    4.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    4.15 + * version 2 for more details (a copy is included in the LICENSE file that
    4.16 + * accompanied this code).
    4.17 + * 
    4.18 + * You should have received a copy of the GNU General Public License version
    4.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    4.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    4.21 + * 
    4.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    4.23 + * or visit www.oracle.com if you need additional information or have any
    4.24 + * questions.
    4.25 + */
    4.26 +
    4.27 +/**
    4.28 + * Testing JavaFX canvas run by Nashorn.
    4.29 + *
    4.30 + * @test/nocompare
    4.31 + * @run
    4.32 + * @fork
    4.33 + */
    4.34 +
    4.35 +TESTNAME = "flyingimage";
    4.36 +
    4.37 +var Image                = Java.type("javafx.scene.image.Image");
    4.38 +var Color                = Java.type("javafx.scene.paint.Color");
    4.39 +var Canvas               = Java.type("javafx.scene.canvas.Canvas");
    4.40 +var BorderPane           = Java.type("javafx.scene.layout.BorderPane");
    4.41 +var StackPane            = Java.type("javafx.scene.layout.StackPane");
    4.42 +var Font                 = Java.type("javafx.scene.text.Font");
    4.43 +var FontSmoothingType    = Java.type("javafx.scene.text.FontSmoothingType");
    4.44 +var Text                 = Java.type("javafx.scene.text.Text");
    4.45 +
    4.46 +var WIDTH = 800;
    4.47 +var HEIGHT = 600;
    4.48 +var canvas = new Canvas(WIDTH, HEIGHT);
    4.49 +function fileToURL(file) {
    4.50 +    return new File(file).toURI().toURL().toExternalForm();
    4.51 +}
    4.52 +var imageUrl = fileToURL(__DIR__ + "flyingimage/flyingimage.png");
    4.53 +var img = new Image(imageUrl);
    4.54 +var font = new Font("Arial", 16);
    4.55 +var t = 0;
    4.56 +var isFrameRendered = false;
    4.57 +function renderFrame() {
    4.58 +    var gc = canvas.graphicsContext2D;
    4.59 +    gc.setFill(Color.web("#cccccc"));
    4.60 +    gc.fillRect(0, 0, WIDTH, HEIGHT);
    4.61 +    gc.setStroke(Color.web("#000000"));
    4.62 +    gc.setLineWidth(1);
    4.63 +    gc.strokeRect(5, 5, WIDTH - 10, HEIGHT - 10);
    4.64 +    var c = 200;
    4.65 +    var msc= 0.5 * HEIGHT / img.height;
    4.66 +    var sp0 = 0.003;
    4.67 +    for (var h = 0; h < c; h++, t++) {
    4.68 +        gc.setTransform(1, 0, 0, 1, 0, 0);
    4.69 +        var yh = h / (c - 1);
    4.70 +        gc.translate((0.5 + Math.sin(t * sp0 + h * 0.1) / 3) * WIDTH, 25 + (HEIGHT * 3 / 4 - 40) * (yh * yh));
    4.71 +        var sc = 30 / img.height + msc * yh * yh;
    4.72 +        gc.rotate(90 * Math.sin(t * sp0 + h * 0.1 + Math.PI));
    4.73 +        gc.scale(sc, sc);
    4.74 +        gc.drawImage(img, -img.width / 2, -img.height / 2);
    4.75 +     }
    4.76 +    gc.setTransform(1, 0, 0, 1, 0, 0);
    4.77 +    isFrameRendered = true;
    4.78 +}
    4.79 +var stack = new StackPane();
    4.80 +var pane = new BorderPane();
    4.81 +
    4.82 +pane.setCenter(canvas);
    4.83 +stack.getChildren().add(pane);
    4.84 +$STAGE.scene = new Scene(stack);
    4.85 +renderFrame();
    4.86 +checkImageAndExit();
     5.1 Binary file test/script/jfx/flyingimage/flyingimage.png has changed
     6.1 Binary file test/script/jfx/flyingimage/golden/linux.png has changed
     7.1 Binary file test/script/jfx/flyingimage/golden/macosx.png has changed
     8.1 Binary file test/script/jfx/flyingimage/golden/windows.png has changed
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/test/script/jfx/kaleidoscope.js	Mon Oct 21 13:31:03 2013 +0400
     9.3 @@ -0,0 +1,162 @@
     9.4 +/*
     9.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
     9.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     9.7 + * 
     9.8 + * This code is free software; you can redistribute it and/or modify it
     9.9 + * under the terms of the GNU General Public License version 2 only, as
    9.10 + * published by the Free Software Foundation.
    9.11 + * 
    9.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    9.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    9.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    9.15 + * version 2 for more details (a copy is included in the LICENSE file that
    9.16 + * accompanied this code).
    9.17 + * 
    9.18 + * You should have received a copy of the GNU General Public License version
    9.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    9.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    9.21 + * 
    9.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    9.23 + * or visit www.oracle.com if you need additional information or have any
    9.24 + * questions.
    9.25 + */
    9.26 +
    9.27 +/**
    9.28 + * Testing JavaFX canvas run by Nashorn.
    9.29 + *
    9.30 + * @test/nocompare
    9.31 + * @run
    9.32 + * @fork
    9.33 + */
    9.34 +
    9.35 +TESTNAME = "kaleidoscope";
    9.36 +WAIT = 4000;
    9.37 +
    9.38 +var Paint                = Java.type("javafx.scene.paint.Paint");
    9.39 +var Canvas               = Java.type("javafx.scene.canvas.Canvas");
    9.40 +var BorderPane           = Java.type("javafx.scene.layout.BorderPane");
    9.41 +var StackPane            = Java.type("javafx.scene.layout.StackPane");
    9.42 +var StrokeLineCap        = Java.type("javafx.scene.shape.StrokeLineCap");
    9.43 +        
    9.44 +var WIDTH = 800;
    9.45 +var HEIGHT = 600;
    9.46 +var canvas = new Canvas(WIDTH, HEIGHT);
    9.47 +var context = canvas.graphicsContext2D;
    9.48 +
    9.49 +var x,y;
    9.50 +var p_x,p_y;
    9.51 +var a=0;
    9.52 +var b=0;
    9.53 +var angle=Math.PI/180*8;
    9.54 +var color=0;
    9.55 +var limit1=Math.PI*1.5;
    9.56 +var limit2=Math.PI*1.79;
    9.57 +var c=new Array(6);
    9.58 +var d=new Array(6);
    9.59 +var r,e;
    9.60 +var fade;
    9.61 +var prv_x,prv_y,prv_x2,prv_y2;
    9.62 +
    9.63 +function renderFrame() {
    9.64 +	a=0.2*angle;
    9.65 +	b=0.7*angle;
    9.66 +	r=0;
    9.67 +	fade=32;
    9.68 +	for(var i=0;i<6;i++)
    9.69 +		{
    9.70 +		c[i]=1.0/(i+1)/2;
    9.71 +		d[i]=1.0/(i+1)/2;
    9.72 +		}
    9.73 +	radius=Math.round((WIDTH+HEIGHT)/8);
    9.74 +	e=radius*0.2;
    9.75 +	p_x=Math.round(WIDTH/2);
    9.76 +	p_y=Math.round(HEIGHT/2);
    9.77 +	x=(radius*c[0])*Math.cos(a*d[1])+(radius*c[2])*Math.sin(a*d[3])+(radius*c[4])*Math.sin(a*d[5]);
    9.78 +	y=(radius*c[5])*Math.sin(a*d[4])+(radius*c[3])*Math.cos(a*d[2])+(radius*c[1])*Math.cos(a*d[0]);
    9.79 +    for (i = 0; i < 800; i++) {
    9.80 +        anim();
    9.81 +    }
    9.82 +}
    9.83 +
    9.84 +function anim() {
    9.85 +	var a1=Math.cos(a*2);
    9.86 +	var a2=Math.cos(a*4);
    9.87 +	var a3=Math.cos(a);
    9.88 +	var a4=Math.sin(a);
    9.89 +	if(b>limit1&&b<limit2) {
    9.90 +		r+=radius*0.02*a1;
    9.91 +		prv_x=x;
    9.92 +		prv_y=y;
    9.93 +		x=prv_x2+r*a3;
    9.94 +		y=prv_y2+r*a4;
    9.95 +	} else {
    9.96 +		prv_x=x;
    9.97 +		prv_y=y;
    9.98 +		prv_x2=x;
    9.99 +		prv_y2=y;
   9.100 +		x=(radius*c[0])*Math.cos(a*d[1])+(radius*c[2])*Math.sin(a*d[3])+(radius*c[4])*Math.sin(a*d[5]);
   9.101 +		y=(radius*c[5])*Math.sin(a*d[4])+(radius*c[3])*Math.cos(a*d[2])+(radius*c[1])*Math.cos(a*d[0]);
   9.102 +	}
   9.103 +	var c3=16*Math.cos(a*10);
   9.104 +	var c1=Math.floor(56*Math.cos(a*angle*4)+c3);
   9.105 +	var c2=Math.floor(56*Math.sin(a*angle*4)-c3);
   9.106 +	context.lineCap=StrokeLineCap.ROUND;
   9.107 +	context.setStroke(Paint.valueOf('rgba('+(192+c1)+','+(192+c2)+','+(192-c1)+','+(0.01-0.005*-a1)+')'));
   9.108 +	context.lineWidth=e*1.4+e*0.8*a3;
   9.109 +	draw_line(p_x,p_y,prv_x,prv_y,x,y);
   9.110 +	context.lineWidth=e+e*0.8*a3;
   9.111 +	draw_line(p_x,p_y,prv_x,prv_y,x,y);
   9.112 +	context.setStroke(Paint.valueOf('rgba('+(192+c1)+','+(192+c2)+','+(192-c1)+','+(0.06-0.03*-a1)+')'));
   9.113 +	context.lineWidth=e*0.6+e*0.35*a3;
   9.114 +	draw_line(p_x,p_y,prv_x,prv_y,x,y);
   9.115 +	context.setStroke(Paint.valueOf('rgba(0,0,0,0.06)'));
   9.116 +	context.lineWidth=e*0.4+e*0.225*a3;
   9.117 +	draw_line(p_x,p_y,prv_x,prv_y,x,y);
   9.118 +	context.setStroke(Paint.valueOf('rgba('+(192+c1)+','+(192+c2)+','+(192-c1)+','+(0.1-0.075*-a1)+')'));
   9.119 +	context.lineWidth=e*0.2+e*0.1*a3;
   9.120 +	draw_line(p_x,p_y,prv_x,prv_y,x,y);
   9.121 +	context.setStroke(Paint.valueOf('rgba(255,255,255,0.4)'));
   9.122 +	context.lineWidth=e*(0.1-0.05*-a2);
   9.123 +	draw_line(p_x,p_y,prv_x,prv_y,x,y);
   9.124 +	a+=angle*Math.cos(b);
   9.125 +	b+=angle*0.1;
   9.126 +}
   9.127 +
   9.128 +function draw_line(x,y,x1,y1,x2,y2) {
   9.129 +	context.beginPath();
   9.130 +	context.moveTo(x+x1,y+y1);
   9.131 +	context.lineTo(x+x2,y+y2);
   9.132 +	context.moveTo(x-x1,y+y1);
   9.133 +	context.lineTo(x-x2,y+y2);
   9.134 +	context.moveTo(x-x1,y-y1);
   9.135 +	context.lineTo(x-x2,y-y2);
   9.136 +	context.moveTo(x+x1,y-y1);
   9.137 +	context.lineTo(x+x2,y-y2);
   9.138 +	context.moveTo(x+y1,y+x1);
   9.139 +	context.lineTo(x+y2,y+x2);
   9.140 +	context.moveTo(x-y1,y+x1);
   9.141 +	context.lineTo(x-y2,y+x2);
   9.142 +	context.moveTo(x-y1,y-x1);
   9.143 +	context.lineTo(x-y2,y-x2);
   9.144 +	context.moveTo(x+y1,y-x1);
   9.145 +	context.lineTo(x+y2,y-x2);
   9.146 +	context.moveTo(x,y+x2);
   9.147 +	context.lineTo(x,y+x1);
   9.148 +	context.moveTo(x,y-x2);
   9.149 +	context.lineTo(x,y-x1);
   9.150 +	context.moveTo(x+x2,y);
   9.151 +	context.lineTo(x+x1,y);
   9.152 +	context.moveTo(x-x2,y);
   9.153 +	context.lineTo(x-x1,y);
   9.154 +	context.stroke();
   9.155 +	context.closePath();
   9.156 +}
   9.157 +
   9.158 +var stack = new StackPane();
   9.159 +var pane = new BorderPane();
   9.160 +
   9.161 +pane.setCenter(canvas);
   9.162 +stack.getChildren().add(pane);
   9.163 +$STAGE.scene = new Scene(stack);
   9.164 +renderFrame();
   9.165 +checkImageAndExit();
   9.166 \ No newline at end of file
    10.1 Binary file test/script/jfx/kaleidoscope/golden/linux.png has changed
    11.1 Binary file test/script/jfx/kaleidoscope/golden/macosx.png has changed
    12.1 Binary file test/script/jfx/kaleidoscope/golden/windows.png has changed

mercurial