changeset 4408:4faca009f76b 8.0-b100

Merge
author mhowe
date Tue, 23 Jul 2013 17:23:49 -0700
parents b21a9e0f47cf c808d2104719
children 9e12c08f2a51 1124ff0356aa
files modules/graphics/src/main/java/com/sun/prism/impl/ps/AATessArcRep.java modules/graphics/src/main/java/com/sun/prism/impl/ps/AATessEllipseRep.java modules/graphics/src/main/java/com/sun/prism/impl/ps/AATessRoundRectRep.java modules/graphics/src/main/java/com/sun/prism/impl/ps/AATessShapeRep.java modules/graphics/src/main/java/com/sun/prism/impl/ps/AATesselatorImpl.java modules/graphics/src/main/java/com/sun/prism/impl/ps/TessArcRep.java modules/graphics/src/main/java/com/sun/prism/impl/ps/TessEllipseRep.java modules/graphics/src/main/java/com/sun/prism/impl/ps/TessRoundRectRep.java modules/graphics/src/main/java/com/sun/prism/impl/ps/TessShapeRep.java modules/graphics/src/main/java/com/sun/prism/impl/shape/TesselatorImpl.java modules/graphics/src/main/java/com/sun/prism/util/tess/Tess.java modules/graphics/src/main/java/com/sun/prism/util/tess/Tessellator.java modules/graphics/src/main/java/com/sun/prism/util/tess/TessellatorCallback.java modules/graphics/src/main/java/com/sun/prism/util/tess/TessellatorCallbackAdapter.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/ActiveRegion.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/CachedVertex.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/Dict.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/DictNode.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/GLUface.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/GLUhalfEdge.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/GLUmesh.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/GLUvertex.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/Geom.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/Mesh.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/Normal.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/PriorityQ.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/PriorityQHeap.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/PriorityQSort.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/Render.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/Sweep.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/TessMono.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/TessState.java modules/graphics/src/main/java/com/sun/prism/util/tess/impl/tess/TessellatorImpl.java modules/graphics/src/test/java/com/sun/prism/impl/ps/HullTest.java modules/web/src/main/native/README-build.html modules/web/src/main/native/README-security.html modules/web/src/main/native/WebKitLibraries/WebCoreSQLite3/sqlite3.h modules/web/src/main/native/WebKitLibraries/WebCoreSQLite3/sqlite3ext.h modules/web/src/main/native/WebKitLibraries/WebKitSystemInterface.h modules/web/src/main/native/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h modules/web/src/main/native/WebKitLibraries/win/lib/WebKitSystemInterface.lib modules/web/src/main/native/WebKitLibraries/win/tools/WinTools.make modules/web/src/main/native/WebKitLibraries/win/tools/scripts/COPYRIGHT-END-YEAR modules/web/src/main/native/WebKitLibraries/win/tools/scripts/VERSION modules/web/src/main/native/WebKitLibraries/win/tools/scripts/auto-version.sh modules/web/src/main/native/WebKitLibraries/win/tools/scripts/feature-defines.sh modules/web/src/main/native/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops modules/web/src/main/native/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops modules/web/src/main/native/WebKitLibraries/win/tools/vsprops/WinCairo.vsprops modules/web/src/main/native/WebKitLibraries/win/tools/vsprops/cURL.vsprops modules/web/src/main/native/WebKitLibraries/win/tools/vsprops/common.vsprops modules/web/src/main/native/WebKitLibraries/win/tools/vsprops/debug.vsprops modules/web/src/main/native/WebKitLibraries/win/tools/vsprops/debug_all.vsprops modules/web/src/main/native/WebKitLibraries/win/tools/vsprops/debug_wincairo.vsprops modules/web/src/main/native/WebKitLibraries/win/tools/vsprops/release.vsprops modules/web/src/main/native/build-native.xml modules/web/src/main/native/build.xml modules/web/src/main/native/create_mapfiles.no-files modules/web/src/main/native/create_mapfiles.sh modules/web/src/main/native/project.properties
diffstat 224 files changed, 3910 insertions(+), 19495 deletions(-) [+]
line wrap: on
line diff
--- a/.idea/3DViewer.iml	Tue Jul 23 09:18:52 2013 -0700
+++ b/.idea/3DViewer.iml	Tue Jul 23 17:23:49 2013 -0700
@@ -30,6 +30,7 @@
     </orderEntry>
     <orderEntry type="module" module-name="rt" />
     <orderEntry type="inheritedJdk" />
+    <orderEntry type="module" module-name="builders" />
   </component>
 </module>
 
--- a/.idea/Ensemble8.iml	Tue Jul 23 09:18:52 2013 -0700
+++ b/.idea/Ensemble8.iml	Tue Jul 23 17:23:49 2013 -0700
@@ -46,6 +46,16 @@
     </orderEntry>
     <orderEntry type="module" module-name="rt" />
     <orderEntry type="inheritedJdk" />
+    <orderEntry type="module" module-name="builders" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../caches/sdk/rt/lib/ext/jfxrt.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
   </component>
 </module>
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.idea/Hello.iml	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/apps/toys/Hello">
+      <sourceFolder url="file://$MODULE_DIR$/apps/toys/Hello/src/main/java" isTestSource="false" />
+    </content>
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="base" />
+    <orderEntry type="module" module-name="controls" />
+    <orderEntry type="module" module-name="fxml" />
+    <orderEntry type="module" module-name="graphics" />
+    <orderEntry type="module" module-name="media" />
+    <orderEntry type="module" module-name="swing" />
+    <orderEntry type="module" module-name="swt" />
+    <orderEntry type="module" module-name="web" />
+    <orderEntry type="inheritedJdk" />
+  </component>
+</module>
+
--- a/.idea/Modena.iml	Tue Jul 23 09:18:52 2013 -0700
+++ b/.idea/Modena.iml	Tue Jul 23 17:23:49 2013 -0700
@@ -10,6 +10,7 @@
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="module" module-name="rt" />
     <orderEntry type="inheritedJdk" />
+    <orderEntry type="module" module-name="builders" />
   </component>
 </module>
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.idea/Shape3DToy.iml	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$/apps/toys/Shape3DToy">
+      <sourceFolder url="file://$MODULE_DIR$/apps/toys/Shape3DToy/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/apps/toys/Shape3DToy/src/main/resources" isTestSource="false" />
+    </content>
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="base" />
+    <orderEntry type="module" module-name="controls" />
+    <orderEntry type="module" module-name="fxml" />
+    <orderEntry type="module" module-name="graphics" />
+    <orderEntry type="module" module-name="media" />
+    <orderEntry type="module" module-name="swing" />
+    <orderEntry type="module" module-name="swt" />
+    <orderEntry type="module" module-name="web" />
+    <orderEntry type="inheritedJdk" />
+  </component>
+</module>
+
--- a/.idea/deploy.iml	Tue Jul 23 09:18:52 2013 -0700
+++ b/.idea/deploy.iml	Tue Jul 23 17:23:49 2013 -0700
@@ -30,6 +30,15 @@
     </orderEntry>
     <orderEntry type="module" module-name="rt" exported="" />
     <orderEntry type="inheritedJdk" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../caches/sdk/rt/lib/ext/jfxrt.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
   </component>
 </module>
 
--- a/.idea/designTime.iml	Tue Jul 23 09:18:52 2013 -0700
+++ b/.idea/designTime.iml	Tue Jul 23 17:23:49 2013 -0700
@@ -4,6 +4,8 @@
     <exclude-output />
     <content url="file://$MODULE_DIR$/modules/designTime">
       <sourceFolder url="file://$MODULE_DIR$/modules/designTime/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/modules/designTime/src/test/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/modules/designTime/src/test/resources" isTestSource="false" />
       <excludeFolder url="file://$MODULE_DIR$/modules/designTime/build" />
     </content>
     <orderEntry type="sourceFolder" forTests="false" />
--- a/.idea/modules.xml	Tue Jul 23 09:18:52 2013 -0700
+++ b/.idea/modules.xml	Tue Jul 23 17:23:49 2013 -0700
@@ -4,7 +4,9 @@
     <modules>
       <module fileurl="file://$PROJECT_DIR$/.idea/3DViewer.iml" filepath="$PROJECT_DIR$/.idea/3DViewer.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/Ensemble8.iml" filepath="$PROJECT_DIR$/.idea/Ensemble8.iml" />
+      <module fileurl="file://$PROJECT_DIR$/.idea/Hello.iml" filepath="$PROJECT_DIR$/.idea/Hello.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/Modena.iml" filepath="$PROJECT_DIR$/.idea/Modena.iml" />
+      <module fileurl="file://$PROJECT_DIR$/.idea/Shape3DToy.iml" filepath="$PROJECT_DIR$/.idea/Shape3DToy.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/base.iml" filepath="$PROJECT_DIR$/.idea/base.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/buildSrc.iml" filepath="$PROJECT_DIR$/.idea/buildSrc.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/builders.iml" filepath="$PROJECT_DIR$/.idea/builders.iml" />
--- a/.idea/rt-closed.iml	Tue Jul 23 09:18:52 2013 -0700
+++ b/.idea/rt-closed.iml	Tue Jul 23 17:23:49 2013 -0700
@@ -114,6 +114,15 @@
     <orderEntry type="module" module-name="deploy" exported="" />
     <orderEntry type="module" module-name="rt" exported="" />
     <orderEntry type="inheritedJdk" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../caches/sdk/rt/lib/ext/jfxrt.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
   </component>
 </module>
 
--- a/.idea/web.iml	Tue Jul 23 09:18:52 2013 -0700
+++ b/.idea/web.iml	Tue Jul 23 17:23:49 2013 -0700
@@ -12,7 +12,7 @@
     <orderEntry type="module" module-name="graphics" exported="" />
     <orderEntry type="module" module-name="controls" exported="" />
     <orderEntry type="module" module-name="media" exported="" />
-    <orderEntry type="module-library" exported="">
+    <orderEntry type="module-library">
       <library>
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../caches/sdk/rt/lib/ext/jfxrt.jar!/" />
--- a/apps/samples/Ensemble8/build.xml	Tue Jul 23 09:18:52 2013 -0700
+++ b/apps/samples/Ensemble8/build.xml	Tue Jul 23 17:23:49 2013 -0700
@@ -76,11 +76,9 @@
     <target name="-pre-compile">
         <echo>Copying all sample source files to build dir</echo>
          <copy todir="${build.classes.dir}">
-            <fileset dir="${basedir}/src/samples">
+            <fileset dir="${basedir}/src/samples/java">
                 <include name="**/samples/**/*.java"/>
                 <include name="**/*.js"/> <!-- include javascript files -->
-                <include name="**/*.wav"/> <!-- include wav files -->
-                <include name="**/*.css"/> <!-- include css files -->
             </fileset>
         </copy>
     </target>
--- a/apps/samples/Ensemble8/src/compiletime/java/ensemble/compiletime/BuildSamplesList.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/apps/samples/Ensemble8/src/compiletime/java/ensemble/compiletime/BuildSamplesList.java	Tue Jul 23 17:23:49 2013 -0700
@@ -53,16 +53,19 @@
     private static final Pattern findJavaDocComment = Pattern.compile("\\/\\*\\*(.*?)\\*\\/\\s*",Pattern.DOTALL);
     private static final Pattern findSharedResource = Pattern.compile("\"(/ensemble/samples/shared-resources/[^\"]+)\"",Pattern.DOTALL);
     private static File samplesSrcDir;
+    private static File samplesResourcesDir;
     private static List<Sample> highlightedSamples = new ArrayList<>();
     private static List<Sample> allSamples = new ArrayList<>();
     
-    public static List<Sample> build(File samplesSrcDir, File samplesSourceFile) {
-        BuildSamplesList.samplesSrcDir = samplesSrcDir;
+    public static List<Sample> build(File samplesSrcDir, File samplesResourcesDir, File samplesSourceFile) {
+        BuildSamplesList.samplesSrcDir = samplesSrcDir;       
         File samplesDir = new File(samplesSrcDir,"ensemble/samples");
+        BuildSamplesList.samplesResourcesDir = samplesResourcesDir; //Resources are in a different location from *.java files
+        File resourcesDir = new File(samplesResourcesDir, "ensemble/samples");
         SampleCategory rootCategory = new SampleCategory("ROOT","",null);
         for(File dir: samplesDir.listFiles()) {
             if (dir.getName().charAt(0) != '.' && !"shared-resources".equals(dir.getName())) {
-                processCategoryOrSampleDir(rootCategory, dir);
+                processCategoryOrSampleDir(rootCategory, dir, resourcesDir);
             }
         }
         // generate code chunks so we have all samples in ALL_SAMPLES
@@ -115,7 +118,7 @@
         return allSamples;
     }
     
-    private static void processCategoryOrSampleDir(SampleCategory category, File dir) {
+    private static void processCategoryOrSampleDir(SampleCategory category, File dir, File resourcesDir) {
         if (!dir.isDirectory()) {
             System.out.println("        found unexpected file: "+dir.getAbsolutePath());
             return;
@@ -129,13 +132,13 @@
             }
         }
         if (containsJavaFile) {
-            processSampleDir(category, dir);
+            processSampleDir(category, dir, resourcesDir);
         } else {
-            processCategoryDir(category, dir);
+            processCategoryDir(category, dir, resourcesDir);
         }
     }
     
-    private static void processCategoryDir(SampleCategory category, File dir) {
+    private static void processCategoryDir(SampleCategory category, File dir, File resourcesDir) {
         System.out.println("========= CATEGORY ["+formatName(dir.getName())+"] ===============");
         // create new category
         SampleCategory subCategory = new SampleCategory(
@@ -146,12 +149,12 @@
         // process each subdir
         for(File subDir: dir.listFiles()) {
             if (subDir.getName().charAt(0) != '.' && !"shared-resources".equals(subDir.getName())) {
-                processCategoryOrSampleDir(subCategory, subDir);
+                processCategoryOrSampleDir(subCategory, subDir, resourcesDir);
             }
         }
     }
     
-    private static void processSampleDir(SampleCategory category, File dir) {
+    private static void processSampleDir(SampleCategory category, File dir, File resourcesDir) {
         Sample sample = new Sample();
         Matcher matcher;
         System.out.println("============== SAMPLE ["+formatName(dir.getName())+"] ===============");
@@ -168,7 +171,7 @@
         if (appFile == null) {
             throw new IllegalArgumentException("Could not find JavaFX Application class for sample ["+dir.getName()+"] in ["+dir.getAbsolutePath()+"]");
         }
-        sample.mainFileUrl = calculateRelativePath(appFile);
+        sample.mainFileUrl = calculateRelativePath(appFile, samplesSrcDir);
         sample.appClass = sample.mainFileUrl.substring(1, sample.mainFileUrl.length()-5).replace('/', '.');
         // load app main file
         StringBuilder appFileContents = loadFile(appFile);
@@ -231,8 +234,10 @@
         }
         sample.description = descBuilder.toString();
         sample.ensemblePath = category.ensemblePath + "/" + sample.name;
-        // scan sample dir for resources
-        compileResources(sample, dir, true);
+        // scan sample dir for resources 
+        compileResources(sample, dir, true, samplesSrcDir);
+        // scan samples/resources dir for resources too
+        compileExtraResources(sample, resourcesDir, true, samplesResourcesDir); 
         // add sample to category
         System.out.println(sample);
         category.addSample(sample);
@@ -240,11 +245,11 @@
         allSamples.add(sample);
     }
     
-    private static void compileResources(Sample sample, File dir, boolean root) {
+    private static void compileResources(Sample sample, File dir, boolean root, File baseDir) {
         for (File file: dir.listFiles()) {
             if (file.getName().charAt(0) != '.') { // ignore hidden unix files
                 if (file.isDirectory()) {
-                    compileResources(sample, file, false);
+                    compileResources(sample, file, false, baseDir);
                 } else {
                     if (root && (file.getName().equalsIgnoreCase("preview.png") 
                             || file.getName().equalsIgnoreCase("preview@2x.png"))) {
@@ -259,14 +264,32 @@
                         }
                     }
                     // add file to resources list
-                    sample.resourceUrls.add(calculateRelativePath(file));
+                    sample.resourceUrls.add(calculateRelativePath(file, baseDir));
                 }
             }
         }
     }
-    
-    private static String calculateRelativePath(File file) {
-        return file.getAbsolutePath().substring(samplesSrcDir.getAbsolutePath().length()).replace('\\', '/');
+   
+  private static void compileExtraResources(Sample sample, File dir, boolean root, File baseDir) {
+      File specificResDir = new File(samplesResourcesDir, sample.baseUri.toString());
+        for (File file: specificResDir.listFiles()) {
+            if (file.getName().charAt(0) != '.') { // ignore hidden unix files
+                if (file.isDirectory()) {
+                    compileResources(sample, file, false, baseDir);
+                } else {
+                    if (file.getName().equalsIgnoreCase("preview.png")
+                            || file.getName().equalsIgnoreCase("preview@2x.png")) {
+                        continue; // ignore preview files
+                    }
+                    // add file to resources list
+                    sample.resourceUrls.add(calculateRelativePath(file, baseDir));
+                }
+            }
+        }
+    }
+     
+    private static String calculateRelativePath(File file, File baseDir) {
+        return file.getAbsolutePath().substring(baseDir.getAbsolutePath().length()).replace('\\', '/');
     }
     
     private static StringBuilder loadFile(File file) {
--- a/apps/samples/Ensemble8/src/compiletime/java/ensemble/compiletime/EnsembleCompiletimeMain.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/apps/samples/Ensemble8/src/compiletime/java/ensemble/compiletime/EnsembleCompiletimeMain.java	Tue Jul 23 17:23:49 2013 -0700
@@ -56,12 +56,14 @@
         System.out.println("==================================================================");
         File ensembleDir = new File(System.getProperty("user.dir"));
         System.out.println("ensembleDir = " + ensembleDir+" - "+ensembleDir.exists());
-        File generatedSrcDir = new File(ensembleDir,"src/generated/ensemble/generated");
+        File generatedSrcDir = new File(ensembleDir,"src/generated/java/ensemble/generated");
         System.out.println("generatedSrcDir = " + generatedSrcDir+" - "+generatedSrcDir.exists());
         generatedSrcDir.mkdirs();
         System.out.println("generatedSrcDir = " + generatedSrcDir.getAbsolutePath());
-        File samplesDir = new File(ensembleDir,"src/samples");
+        File samplesDir = new File(ensembleDir,"src/samples/java");
         System.out.println("samplesDir = " + samplesDir.getAbsolutePath());
+        File resourcesDir = new File(ensembleDir,"src/samples/resources");
+        System.out.println("resourcesDir = " + resourcesDir.getAbsolutePath());
         // process args
         boolean buildSearchIndex = false, buildSampleClass = false;
         for (int a=0; a< args.length; a++) {
@@ -71,7 +73,7 @@
         System.out.println("buildSearchIndex = " + buildSearchIndex);
         System.out.println("buildSampleClass = " + buildSampleClass);
         // build samples list
-        List<Sample> allSamples = BuildSamplesList.build(samplesDir, buildSampleClass ? new File(generatedSrcDir,"Samples.java") : null);
+        List<Sample> allSamples = BuildSamplesList.build(samplesDir, resourcesDir, buildSampleClass ? new File(generatedSrcDir,"Samples.java") : null);
         System.out.println("TOTAL SAMPLES = " + allSamples.size());
         if (buildSampleClass) {
             System.out.println("==================================================================");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/toys/Hello/src/main/java/hello/HelloRectangle3D.java	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package hello;
+
+import javafx.animation.Interpolator;
+import javafx.animation.KeyFrame;
+import javafx.animation.RotateTransition;
+import javafx.animation.Timeline;
+import javafx.application.Application;
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.scene.Group;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.paint.Color;
+import javafx.scene.paint.CycleMethod;
+import javafx.scene.paint.LinearGradient;
+import javafx.scene.paint.Stop;
+import javafx.scene.shape.Rectangle;
+import javafx.scene.shape.StrokeType;
+import javafx.scene.transform.Rotate;
+import javafx.stage.Stage;
+import javafx.util.Duration;
+import com.sun.javafx.perf.PerformanceTracker;
+
+/**
+ */
+public class HelloRectangle3D extends Application {
+    @Override public void start(Stage stage) throws Exception {
+        final double sceneWidth = 640;
+        final double sceneHeight = 480;
+
+        Rectangle background = new Rectangle((sceneWidth - 300) / 2, (sceneHeight - 300) / 2, 300, 300);
+        background.setFill(Color.PURPLE);
+        background.setRotationAxis(Rotate.Y_AXIS);
+        background.setRotate(10);
+
+        final Rectangle rect = rect((sceneWidth - 200) / 2, (sceneHeight - 200) / 2, 200, 200, Color.LIME);
+        rect.setRotationAxis(Rotate.Y_AXIS);
+        rect.setCache(true);
+        rect.setOnMouseClicked(new EventHandler<MouseEvent>() {
+            @Override
+            public void handle(MouseEvent event) {
+                // This is used to test that the texture gets recreated as needed
+                if (event.isShiftDown()) {
+                    rect.setStrokeWidth(Math.random() * 10);
+                } else {
+                    rect.setFill(new Color(Math.random(), Math.random(), Math.random(), 1));
+                }
+            }
+        });
+
+        Group stack = new Group(background, rect);
+
+        Scene scene = new Scene(stack, sceneWidth, sceneHeight, true);
+        scene.setCamera(new PerspectiveCamera());
+        scene.setFill(Color.BLACK);
+        stage.setScene(scene);
+        stage.setTitle("HelloRectangle3D");
+        stage.show();
+
+        RotateTransition tx = new RotateTransition(Duration.seconds(20), rect);
+        tx.setToAngle(360);
+        tx.setCycleCount(RotateTransition.INDEFINITE);
+        tx.setInterpolator(Interpolator.LINEAR);
+        tx.play();
+
+        PerformanceTracker tracker = PerformanceTracker.getSceneTracker(scene);
+        Timeline t = new Timeline(
+            new KeyFrame(Duration.seconds(1), new EventHandler<ActionEvent>() {
+                @Override
+                public void handle(ActionEvent event) {
+                    System.out.println("" + tracker.getAverageFPS() + " average fps, " + tracker.getInstantFPS() + " instant fps");
+                }
+            })
+        );
+        t.setCycleCount(Timeline.INDEFINITE);
+        t.play();
+    }
+
+    private Rectangle rect(double x, double y, double width, double height, Color color) {
+        Rectangle rect = new Rectangle(x, y, width, height);
+        rect.setFill(new LinearGradient(0, 0, 0, 1, true, CycleMethod.NO_CYCLE, new Stop(0, color), new Stop(1, color.darker().darker())));
+        rect.setArcHeight(42);
+        rect.setArcWidth(42);
+        rect.setStroke(Color.WHITE);
+        rect.setStrokeWidth(5);
+        rect.setStrokeType(StrokeType.OUTSIDE);
+        return rect;
+    }
+
+    public static void main(String[] args) {
+        launch(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/toys/Shape3DToy/src/main/java/shapet3dtest/CircleT3D.java	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapet3dtest;
+
+import javafx.animation.Interpolator;
+import javafx.animation.PauseTransition;
+import javafx.animation.RotateTransition;
+import javafx.animation.SequentialTransition;
+import javafx.application.Application;
+import javafx.application.ConditionalFeature;
+import javafx.application.Platform;
+import javafx.scene.Group;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.paint.Color;
+import javafx.scene.paint.CycleMethod;
+import javafx.scene.paint.LinearGradient;
+import javafx.scene.paint.Stop;
+import javafx.scene.shape.Circle;
+import javafx.scene.transform.Rotate;
+import javafx.stage.Stage;
+import javafx.util.Duration;
+
+public class CircleT3D extends Application {
+
+    @Override public void start(Stage stage) {
+        final double sceneWidth = 640;
+        final double sceneHeight = 480;
+
+        final Circle circle = new Circle(sceneWidth / 2, sceneHeight / 2, 120);
+        circle.setFill(new LinearGradient(0, 0, 1, 1, true,
+                CycleMethod.NO_CYCLE,
+                new Stop(0, Color.LIME),
+                new Stop(1, Color.GREEN)));
+        circle.setStroke(Color.WHITE);
+        circle.setStrokeWidth(5);
+        circle.setRotationAxis(Rotate.Y_AXIS);
+
+        final Scene scene = new Scene(new Group(circle), sceneWidth, sceneHeight);
+        scene.setCamera(new PerspectiveCamera());
+        scene.setFill(Color.BLACK);
+        stage.setScene(scene);
+        stage.sizeToScene();
+        stage.show();
+
+        if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
+            System.out.println("*************************************************************");
+            System.out.println("*    WARNING: common conditional SCENE3D isn't supported    *");
+            System.out.println("*************************************************************");
+        }
+
+        final RotateTransition tx = new RotateTransition(Duration.seconds(2), circle);
+        tx.setToAngle(360);
+        tx.setCycleCount(RotateTransition.INDEFINITE);
+        tx.setInterpolator(Interpolator.LINEAR);
+
+        PauseTransition ptx = new PauseTransition(Duration.seconds(5));
+        SequentialTransition stx = new SequentialTransition(ptx, tx);
+        stx.play();
+    }
+
+    public static void main(String[] args) {
+        Application.launch(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/toys/Shape3DToy/src/main/java/shapet3dtest/CubicCurveT3D.java	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapet3dtest;
+
+import javafx.animation.Interpolator;
+import javafx.animation.RotateTransition;
+import javafx.application.Application;
+import javafx.application.ConditionalFeature;
+import javafx.application.Platform;
+import javafx.event.EventHandler;
+import javafx.scene.Group;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.paint.Color;
+import javafx.scene.paint.CycleMethod;
+import javafx.scene.paint.LinearGradient;
+import javafx.scene.paint.Stop;
+import javafx.scene.shape.CubicCurve;
+import javafx.scene.transform.Rotate;
+import javafx.stage.Stage;
+import javafx.util.Duration;
+
+public class CubicCurveT3D extends Application {
+
+    @Override public void start(Stage stage) {
+        final double sceneWidth = 640;
+        final double sceneHeight = 480;
+
+        final CubicCurve cubiccurve = new CubicCurve();
+        cubiccurve.setStartX(0);
+        cubiccurve.setStartY(0);
+        cubiccurve.setControlX1(150);
+        cubiccurve.setControlY1(-300);
+        cubiccurve.setControlX2(200);
+        cubiccurve.setControlY2(300);
+        cubiccurve.setEndX(300);
+        cubiccurve.setEndY(0);
+        cubiccurve.setStroke(Color.WHITE);
+        cubiccurve.setStrokeWidth(5);
+        cubiccurve.setFill(new LinearGradient(0, 0, 1, 1, true,
+                CycleMethod.NO_CYCLE,
+                new Stop(0, Color.LIME),
+                new Stop(1, Color.GREEN)));
+        cubiccurve.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Mouse Clicked:" + e);
+                }
+            });
+        cubiccurve.setOnMouseEntered(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Mouse Entered");
+                }
+            });
+        cubiccurve.setOnMouseExited(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Mouse Exited");
+                }
+            });
+        final Group group = new Group(cubiccurve);
+        group.setRotate(30);
+        group.setTranslateX((sceneWidth - 300) / 2);
+        group.setTranslateY(sceneHeight / 2);
+        group.setRotationAxis(Rotate.Y_AXIS);
+        final Scene scene = new Scene(group, sceneWidth, sceneHeight);
+        scene.setFill(Color.BLACK);
+        scene.setCamera(new PerspectiveCamera());
+        stage.setScene(scene);
+        stage.sizeToScene();
+        stage.show();
+
+        if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
+            System.out.println("*************************************************************");
+            System.out.println("*    WARNING: common conditional SCENE3D isn't supported    *");
+            System.out.println("*************************************************************");
+        }
+
+        final RotateTransition tx = new RotateTransition(Duration.seconds(20), group);
+        tx.setToAngle(360);
+        tx.setCycleCount(RotateTransition.INDEFINITE);
+        tx.setInterpolator(Interpolator.LINEAR);
+        tx.play();
+    }
+
+    public static void main(String[] args) {
+        Application.launch(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/toys/Shape3DToy/src/main/java/shapet3dtest/EllipsesT3D.java	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapet3dtest;
+
+import javafx.animation.Interpolator;
+import javafx.animation.RotateTransition;
+import javafx.application.Application;
+import javafx.application.ConditionalFeature;
+import javafx.application.Platform;
+import javafx.scene.Group;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.paint.Color;
+import javafx.scene.shape.Ellipse;
+import javafx.scene.transform.Rotate;
+import javafx.stage.Stage;
+import javafx.util.Duration;
+
+public class EllipsesT3D extends Application {
+
+    @Override public void start(Stage stage) {
+        final double sceneWidth = 640;
+        final double sceneHeight = 480;
+
+        final Ellipse ellipse = new Ellipse(sceneWidth / 2, sceneHeight / 2, 200, 100);
+        ellipse.setFill(Color.BLUE);
+        ellipse.setTranslateX(-100);
+        ellipse.setTranslateY(-100);
+        ellipse.setTranslateZ(-100);
+        final Ellipse ellipse2 = new Ellipse(sceneWidth / 2, sceneHeight / 2, 200, 100);
+        ellipse2.setFill(Color.GREEN);
+        final Ellipse ellipse3 = new Ellipse(sceneWidth / 2, sceneHeight / 2, 200, 100);
+        ellipse3.setFill(Color.RED);
+        ellipse3.setTranslateX(100);
+        ellipse3.setTranslateY(100);
+        ellipse3.setTranslateZ(100);
+        final Group group = new Group(ellipse, ellipse2, ellipse3);
+        group.setRotationAxis(Rotate.Y_AXIS);
+        final Scene scene = new Scene(group, 640, 480, true);
+        scene.setFill(Color.BLACK);
+        scene.setCamera(new PerspectiveCamera());
+        stage.setScene(scene);
+        stage.sizeToScene();
+        stage.show();
+
+        if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
+            System.out.println("*************************************************************");
+            System.out.println("*    WARNING: common conditional SCENE3D isn't supported    *");
+            System.out.println("*************************************************************");
+        }
+
+        final RotateTransition tx = new RotateTransition(Duration.seconds(20), group);
+        tx.setToAngle(360);
+        tx.setCycleCount(RotateTransition.INDEFINITE);
+        tx.setInterpolator(Interpolator.LINEAR);
+        tx.play();
+    }
+
+    public static void main(String[] args) {
+        Application.launch(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/toys/Shape3DToy/src/main/java/shapet3dtest/ImageViewT3D.java	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapet3dtest;
+
+import javafx.animation.Interpolator;
+import javafx.animation.RotateTransition;
+import javafx.application.Application;
+import javafx.application.ConditionalFeature;
+import javafx.application.Platform;
+import javafx.scene.Group;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.image.Image;
+import javafx.scene.image.ImageView;
+import javafx.scene.transform.Rotate;
+import javafx.stage.Stage;
+import javafx.util.Duration;
+
+public class ImageViewT3D extends Application {
+
+    @Override public void start(Stage stage) {
+        final double sceneWidth = 640;
+        final double sceneHeight = 480;
+        final String imageURL = ImageViewT3D.class.getResource("JavaFX.png").toExternalForm();
+
+        final Image image = new Image(imageURL);
+        final ImageView imageView = new ImageView();
+        imageView.setPreserveRatio(true);
+        imageView.setImage(image);
+        imageView.setRotate(60);
+        imageView.setRotationAxis(Rotate.Y_AXIS);
+        imageView.setX((sceneWidth - image.getWidth()) / 2);
+        imageView.setY((sceneHeight - image.getHeight()) / 2);
+        final Scene scene = new Scene(new Group(imageView), sceneWidth, sceneHeight);
+        scene.setCamera(new PerspectiveCamera());
+        stage.setScene(scene);
+        stage.sizeToScene();
+        stage.show();
+
+        if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
+            System.out.println("*************************************************************");
+            System.out.println("*    WARNING: common conditional SCENE3D isn't supported    *");
+            System.out.println("*************************************************************");
+        }
+
+        final RotateTransition tx = new RotateTransition(Duration.seconds(20), imageView);
+        tx.setToAngle(360);
+        tx.setCycleCount(RotateTransition.INDEFINITE);
+        tx.setInterpolator(Interpolator.LINEAR);
+        tx.play();
+    }
+
+    public static void main(String[] args) {
+        Application.launch(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/toys/Shape3DToy/src/main/java/shapet3dtest/MixedShapesT3D.java	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapet3dtest;
+
+import javafx.application.Application;
+import javafx.application.ConditionalFeature;
+import javafx.application.Platform;
+import javafx.collections.ObservableList;
+import javafx.event.EventHandler;
+import javafx.scene.Group;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.paint.Color;
+import javafx.scene.paint.CycleMethod;
+import javafx.scene.paint.LinearGradient;
+import javafx.scene.paint.Stop;
+import javafx.scene.shape.Arc;
+import javafx.scene.shape.ArcType;
+import javafx.scene.shape.Ellipse;
+import javafx.scene.shape.Polygon;
+import javafx.scene.shape.Rectangle;
+import javafx.scene.transform.Rotate;
+import javafx.stage.Stage;
+
+public class MixedShapesT3D extends Application {
+    private static final Stop[] stops = new Stop[]{new Stop(0, Color.web("#992222")),
+            new Stop(0.7f, Color.web("#772222")), new Stop(1, Color.web("#552222"))};
+    private static final LinearGradient lg = new LinearGradient(0, 0, 0, 1, true,
+            CycleMethod.NO_CYCLE, stops);
+
+    @Override public void start(Stage stage) {
+        Scene scene = new Scene(new Group(), 400.0f, 300.0f);
+        scene.setCamera(new PerspectiveCamera());
+        Group group = new Group();
+        group.setRotate(60.0F);
+        group.setRotationAxis(Rotate.Y_AXIS);
+        Ellipse ellipse = new Ellipse(100.0F, 80.0F, 50.0F, 25.0F);
+        ellipse.setFill(lg);
+        ellipse.setStroke(Color.BLUE);
+        ellipse.setStrokeWidth(5.0F);
+        ellipse.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Ellipse: Mouse Clicked:" + e);
+                }
+            });
+        ellipse.setOnMouseEntered(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Ellipse: Mouse Entered");
+                }
+            });
+        ellipse.setOnMouseExited(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Ellipse: Mouse Exited");
+                }
+            });
+        Arc arc = new Arc(250.0F, 80.0F, 50.0F, 25.0F, 45.0F, 270.0F);
+        arc.setType(ArcType.ROUND);
+        arc.setFill(lg);
+        arc.setStroke(Color.BLUE);
+        arc.setStrokeWidth(5.0F);
+        arc.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Arc: Mouse Clicked:" + e);
+                }
+            });
+        arc.setOnMouseEntered(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Arc: Mouse Entered");
+                }
+            });
+        arc.setOnMouseExited(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Arc: Mouse Exited");
+                }
+            });
+        Rectangle rectangle = new Rectangle(50.0F, 150.0F, 100.0F, 75.0F);
+        rectangle.setArcHeight(20.0F);
+        rectangle.setArcWidth(20.0F);
+        rectangle.setFill(lg);
+        rectangle.setStroke(Color.BLUE);
+        rectangle.setStrokeWidth(5.0F);
+        rectangle.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Rectangle: Mouse Clicked:" + e);
+                }
+            });
+        rectangle.setOnMouseEntered(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Rectangle: Mouse Entered");
+                }
+            });
+        rectangle.setOnMouseExited(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Rectangle: Mouse Exited");
+                }
+            });
+        ObservableList<Double> floats = javafx.collections.FXCollections.<Double>observableArrayList();
+        floats.addAll(200.0, 150.0, 250.0, 220.0, 300.0, 150.0);
+        Polygon polygon = new Polygon();
+        polygon.getPoints().addAll(floats);
+        polygon.setFill(lg);
+        polygon.setStroke(Color.BLUE);
+        polygon.setStrokeWidth(5.0F);
+        polygon.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Polygon: Mouse Clicked:" + e);
+                }
+            });
+        polygon.setOnMouseEntered(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Polygon: Mouse Entered");
+                }
+            });
+        polygon.setOnMouseExited(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Polygon: Mouse Exited");
+                }
+            });
+        group.getChildren().addAll(ellipse, arc, rectangle, polygon);
+        ((Group)scene.getRoot()).getChildren().addAll(group);
+        stage.setScene(scene);
+        stage.sizeToScene();
+        if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
+            System.out.println("*************************************************************");
+            System.out.println("*    WARNING: common conditional SCENE3D isn\'t supported    *");
+            System.out.println("*************************************************************");
+        }
+        stage.show();
+    }
+
+    public static void main(String[] args) {
+        Application.launch(args);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/toys/Shape3DToy/src/main/java/shapet3dtest/MixedShapesT3DEffect1.java	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapet3dtest;
+
+import javafx.application.Application;
+import javafx.application.ConditionalFeature;
+import javafx.application.Platform;
+import javafx.collections.ObservableList;
+import javafx.event.EventHandler;
+import javafx.scene.Group;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.effect.DropShadow;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.paint.Color;
+import javafx.scene.shape.Arc;
+import javafx.scene.shape.ArcType;
+import javafx.scene.shape.Ellipse;
+import javafx.scene.shape.Polygon;
+import javafx.scene.shape.Rectangle;
+import javafx.scene.transform.Rotate;
+import javafx.stage.Stage;
+
+public class MixedShapesT3DEffect1 extends Application {
+    @Override public void start(Stage stage) {
+        Scene scene = new Scene(new Group(), 400.0f, 300.0f);
+        scene.setCamera(new PerspectiveCamera());
+        Group group = new Group();
+        Group group2 = new Group();
+        group2.setRotate(60.0F);
+        group2.setRotationAxis(Rotate.Y_AXIS);
+        Ellipse ellipse = new Ellipse(100.0F, 80.0F, 50.0F, 25.0F);
+        DropShadow dropshadow = new DropShadow();
+        dropshadow.setOffsetY(10.0F);
+        ellipse.setEffect(dropshadow);
+        ellipse.setFill(Color.ORANGE);
+        ellipse.setStroke(Color.BLUE);
+        ellipse.setStrokeWidth(5.0F);
+        ellipse.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Ellipse: Mouse Clicked:" + e);
+                }
+            });
+        Arc arc = new Arc(250.0F, 80.0F, 50.0F, 25.0F, 45.0F, 270.0F);
+        DropShadow dropshadow2 = new DropShadow();
+        dropshadow2.setOffsetY(10.0F);
+        arc.setEffect(dropshadow2);
+        arc.setType(ArcType.ROUND);
+        arc.setFill(Color.RED);
+        arc.setStroke(Color.BLUE);
+        arc.setStrokeWidth(5.0F);
+        arc.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Arc: Mouse Clicked:" + e);
+                }
+            });
+        Rectangle rectangle = new Rectangle(50.0F, 150.0F, 100.0F, 75.0F);
+        DropShadow dropshadow3 = new DropShadow();
+        dropshadow3.setOffsetY(10.0F);
+        rectangle.setEffect(dropshadow3);
+        rectangle.setArcHeight(20.0F);
+        rectangle.setArcWidth(20.0F);
+        rectangle.setFill(Color.GREEN);
+        rectangle.setStroke(Color.BLUE);
+        rectangle.setStrokeWidth(5.0F);
+        rectangle.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Rectangle: Mouse Clicked:" + e);
+                }
+            });
+        ObservableList<Double> floats = javafx.collections.FXCollections.<Double>observableArrayList();
+        floats.addAll(200.0, 150.0, 250.0, 220.0, 300.0, 150.0);
+        Polygon polygon = new Polygon();
+        polygon.getPoints().addAll(floats);
+        DropShadow dropshadow4 = new DropShadow();
+        dropshadow4.setOffsetY(10.0F);
+        polygon.setEffect(dropshadow4);
+        polygon.setFill(Color.YELLOW);
+        polygon.setStroke(Color.BLUE);
+        polygon.setStrokeWidth(5.0F);
+        polygon.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Polygon: Mouse Clicked:" + e);
+                }
+            });
+        group2.getChildren().addAll(ellipse, arc, rectangle, polygon);
+        group.getChildren().addAll(group2);
+        ((Group)scene.getRoot()).getChildren().addAll(group);
+        stage.setScene(scene);
+        stage.sizeToScene();
+        if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
+            System.out.println("*************************************************************");
+            System.out.println("*    WARNING: common conditional SCENE3D isn\'t supported    *");
+            System.out.println("*************************************************************");
+        }
+        stage.show();
+    }
+
+    public static void main(String[] args) {
+        Application.launch(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/toys/Shape3DToy/src/main/java/shapet3dtest/MixedShapesT3DEffect2.java	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapet3dtest;
+
+import javafx.application.Application;
+import javafx.application.ConditionalFeature;
+import javafx.application.Platform;
+import javafx.collections.ObservableList;
+import javafx.event.EventHandler;
+import javafx.scene.Group;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.effect.DropShadow;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.paint.Color;
+import javafx.scene.shape.Arc;
+import javafx.scene.shape.ArcType;
+import javafx.scene.shape.Ellipse;
+import javafx.scene.shape.Polygon;
+import javafx.scene.shape.Rectangle;
+import javafx.scene.transform.Rotate;
+import javafx.stage.Stage;
+
+public class MixedShapesT3DEffect2 extends Application {
+    @Override public void start(Stage stage) {
+        Scene scene = new Scene(new Group(), 400.0f, 300.0f);
+        scene.setCamera(new PerspectiveCamera());
+        Group group = new Group();
+        Group group2 = new Group();
+        DropShadow dropshadow = new DropShadow();
+        dropshadow.setOffsetY(10.0F);
+        group2.setEffect(dropshadow);
+        group2.setRotate(60.0F);
+        group2.setRotationAxis(Rotate.Y_AXIS);
+        //                                    effect: DropShadow { offsetY: 10 }
+        Ellipse ellipse = new Ellipse(100.0F, 80.0F, 50.0F, 25.0F);
+        ellipse.setFill(Color.ORANGE);
+        ellipse.setStroke(Color.BLUE);
+        ellipse.setStrokeWidth(5.0F);
+        ellipse.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Ellipse: Mouse Clicked:" + e);
+                }
+            });
+        //                                    effect: DropShadow { offsetY: 10 }
+        Arc arc = new Arc(250.0F, 80.0F, 50.0F, 25.0F, 45.0F, 270.0F);
+        arc.setType(ArcType.ROUND);
+        arc.setFill(Color.RED);
+        arc.setStroke(Color.BLUE);
+        arc.setStrokeWidth(5.0F);
+        arc.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Arc: Mouse Clicked:" + e);
+                }
+            });
+        //                                    effect: DropShadow { offsetY: 10 }
+        Rectangle rectangle = new Rectangle(50.0F, 150.0F, 100.0F, 75.0F);
+        rectangle.setArcHeight(20.0F);
+        rectangle.setArcWidth(20.0F);
+        rectangle.setFill(Color.GREEN);
+        rectangle.setStroke(Color.BLUE);
+        rectangle.setStrokeWidth(5.0F);
+        rectangle.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Rectangle: Mouse Clicked:" + e);
+                }
+            });
+        //                                    effect: DropShadow { offsetY: 10 }
+        ObservableList<Double> floats = javafx.collections.FXCollections.<Double>observableArrayList();
+        floats.addAll(200.0, 150.0, 250.0, 220.0, 300.0, 150.0);
+        Polygon polygon = new Polygon();
+        polygon.getPoints().addAll(floats);
+        polygon.setFill(Color.YELLOW);
+        polygon.setStroke(Color.BLUE);
+        polygon.setStrokeWidth(5.0F);
+        polygon.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Polygon: Mouse Clicked:" + e);
+                }
+            });
+        group2.getChildren().addAll(ellipse, arc, rectangle, polygon);
+        group.getChildren().addAll(group2);
+        ((Group)scene.getRoot()).getChildren().addAll(group);
+        stage.setScene(scene);
+        stage.sizeToScene();
+        if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
+            System.out.println("*************************************************************");
+            System.out.println("*    WARNING: common conditional SCENE3D isn\'t supported    *");
+            System.out.println("*************************************************************");
+        }
+        stage.show();
+    }
+
+    public static void main(String[] args) {
+        Application.launch(args);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/toys/Shape3DToy/src/main/java/shapet3dtest/MixedShapesT3DEffect3.java	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapet3dtest;
+
+import javafx.application.Application;
+import javafx.application.ConditionalFeature;
+import javafx.application.Platform;
+import javafx.collections.ObservableList;
+import javafx.event.EventHandler;
+import javafx.scene.Group;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.effect.DropShadow;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.paint.Color;
+import javafx.scene.shape.Arc;
+import javafx.scene.shape.ArcType;
+import javafx.scene.shape.Ellipse;
+import javafx.scene.shape.Polygon;
+import javafx.scene.shape.Rectangle;
+import javafx.scene.transform.Rotate;
+import javafx.stage.Stage;
+
+public class MixedShapesT3DEffect3 extends Application {
+    @Override public void start(Stage stage) {
+        Scene scene = new Scene(new Group(), 400.0f, 300.0f);
+        scene.setCamera(new PerspectiveCamera());
+        Group group = new Group();
+        DropShadow dropshadow = new DropShadow();
+        dropshadow.setOffsetY(10.0F);
+        group.setEffect(dropshadow);
+        Group group2 = new Group();
+        //                           effect: DropShadow { offsetY: 10 }
+        group2.setRotate(60.0F);
+        group2.setRotationAxis(Rotate.Y_AXIS);
+        //                                    effect: DropShadow { offsetY: 10 }
+        Ellipse ellipse = new Ellipse(100.0F, 80.0F, 50.0F, 25.0F);
+        ellipse.setFill(Color.ORANGE);
+        ellipse.setStroke(Color.BLUE);
+        ellipse.setStrokeWidth(5.0F);
+        ellipse.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Ellipse: Mouse Clicked:" + e);
+                }
+            });
+        //                                    effect: DropShadow { offsetY: 10 }
+        Arc arc = new Arc(250.0F, 80.0F, 50.0F, 25.0F, 45.0F, 270.0F);
+        arc.setType(ArcType.ROUND);
+        arc.setFill(Color.RED);
+        arc.setStroke(Color.BLUE);
+        arc.setStrokeWidth(5.0F);
+        arc.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Arc: Mouse Clicked:" + e);
+                }
+            });
+        //                                    effect: DropShadow { offsetY: 10 }
+        Rectangle rectangle = new Rectangle(50.0F, 150.0F, 100.0F, 75.0F);
+        rectangle.setArcHeight(20.0F);
+        rectangle.setArcWidth(20.0F);
+        rectangle.setFill(Color.GREEN);
+        rectangle.setStroke(Color.BLUE);
+        rectangle.setStrokeWidth(5.0F);
+        rectangle.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Rectangle: Mouse Clicked:" + e);
+                }
+            });
+        //                                    effect: DropShadow { offsetY: 10 }
+        ObservableList<Double> floats = javafx.collections.FXCollections.<Double>observableArrayList();
+        floats.addAll(200.0, 150.0, 250.0, 220.0, 300.0, 150.0);
+        Polygon polygon = new Polygon();
+        polygon.getPoints().addAll(floats);
+        polygon.setFill(Color.YELLOW);
+        polygon.setStroke(Color.BLUE);
+        polygon.setStrokeWidth(5.0F);
+        polygon.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Polygon: Mouse Clicked:" + e);
+                }
+            });
+        group2.getChildren().addAll(ellipse, arc, rectangle, polygon);
+        group.getChildren().addAll(group2);
+        ((Group)scene.getRoot()).getChildren().addAll(group);
+        stage.setScene(scene);
+        stage.sizeToScene();
+        if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
+            System.out.println("*************************************************************");
+            System.out.println("*    WARNING: common conditional SCENE3D isn\'t supported    *");
+            System.out.println("*************************************************************");
+        }
+        stage.show();
+    }
+
+    public static void main(String[] args) {
+        Application.launch(args);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/toys/Shape3DToy/src/main/java/shapet3dtest/MixedShapesT3DEffectCache.java	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapet3dtest;
+
+import javafx.application.Application;
+import javafx.application.ConditionalFeature;
+import javafx.application.Platform;
+import javafx.collections.ObservableList;
+import javafx.event.EventHandler;
+import javafx.scene.Group;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.effect.DropShadow;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.paint.Color;
+import javafx.scene.paint.CycleMethod;
+import javafx.scene.paint.LinearGradient;
+import javafx.scene.paint.Stop;
+import javafx.scene.shape.Arc;
+import javafx.scene.shape.ArcType;
+import javafx.scene.shape.Ellipse;
+import javafx.scene.shape.Polygon;
+import javafx.scene.shape.Rectangle;
+import javafx.scene.transform.Rotate;
+import javafx.stage.Stage;
+
+public class MixedShapesT3DEffectCache extends Application {
+    private static final Stop[] stops = new Stop[]{new Stop(0, Color.web("#992222")),
+            new Stop(0.7f, Color.web("#772222")), new Stop(1, Color.web("#552222"))};
+    private static final LinearGradient lg = new LinearGradient(0, 0, 0, 1, true,
+            CycleMethod.NO_CYCLE, stops);
+
+    @Override public void start(Stage stage) {
+        Scene scene = new Scene(new Group(), 400.0f, 300.0f);
+        scene.setCamera(new PerspectiveCamera());
+        Group group = new Group();
+        Group group2 = new Group();
+        group2.setRotate(60.0F);
+        group2.setRotationAxis(Rotate.Y_AXIS);
+        Ellipse ellipse = new Ellipse(100.0F, 80.0F, 50.0F, 25.0F);
+        DropShadow dropshadow = new DropShadow();
+        dropshadow.setOffsetY(10.0F);
+        ellipse.setEffect(dropshadow);
+        ellipse.setCache(true);
+        ellipse.setFill(Color.ORANGE);
+        ellipse.setStroke(Color.BLUE);
+        ellipse.setStrokeWidth(5.0F);
+        ellipse.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Ellipse: Mouse Clicked:" + e);
+                }
+            });
+        Arc arc = new Arc(250.0F, 80.0F, 50.0F, 25.0F, 45.0F, 270.0F);
+        DropShadow dropshadow2 = new DropShadow();
+        dropshadow2.setOffsetY(10.0F);
+        arc.setEffect(dropshadow2);
+        arc.setCache(true);
+        arc.setType(ArcType.ROUND);
+        arc.setFill(lg);
+        arc.setStroke(Color.BLUE);
+        arc.setStrokeWidth(5.0F);
+        arc.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Arc: Mouse Clicked:" + e);
+                }
+            });
+        Rectangle rectangle = new Rectangle(50.0F, 150.0F, 100.0F, 75.0F);
+        DropShadow dropshadow3 = new DropShadow();
+        dropshadow3.setOffsetY(10.0F);
+        rectangle.setEffect(dropshadow3);
+        rectangle.setCache(true);
+        rectangle.setArcHeight(20.0F);
+        rectangle.setArcWidth(20.0F);
+        rectangle.setFill(Color.GREEN);
+        rectangle.setStroke(Color.BLUE);
+        rectangle.setStrokeWidth(5.0F);
+        rectangle.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Rectangle: Mouse Clicked:" + e);
+                }
+            });
+        ObservableList<Double> floats = javafx.collections.FXCollections.<Double>observableArrayList();
+        floats.addAll(200.0, 150.0, 250.0, 220.0, 300.0, 150.0);
+        Polygon polygon = new Polygon();
+        polygon.getPoints().addAll(floats);
+        DropShadow dropshadow4 = new DropShadow();
+        dropshadow4.setOffsetY(10.0F);
+        polygon.setEffect(dropshadow4);
+        polygon.setCache(true);
+        polygon.setFill(Color.YELLOW);
+        polygon.setStroke(Color.BLUE);
+        polygon.setStrokeWidth(5.0F);
+        polygon.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Polygon: Mouse Clicked:" + e);
+                }
+            });
+        group2.getChildren().addAll(ellipse, arc, rectangle, polygon);
+        group.getChildren().addAll(group2);
+        ((Group)scene.getRoot()).getChildren().addAll(group);
+        stage.setScene(scene);
+        stage.sizeToScene();
+        if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
+            System.out.println("*************************************************************");
+            System.out.println("*    WARNING: common conditional SCENE3D isn\'t supported    *");
+            System.out.println("*************************************************************");
+        }
+        stage.show();
+    }
+
+    public static void main(String[] args) {
+        Application.launch(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/toys/Shape3DToy/src/main/java/shapet3dtest/MixedShapesT3DOpacity1.java	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapet3dtest;
+
+import javafx.application.Application;
+import javafx.application.ConditionalFeature;
+import javafx.application.Platform;
+import javafx.collections.ObservableList;
+import javafx.event.EventHandler;
+import javafx.scene.Group;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.paint.Color;
+import javafx.scene.paint.CycleMethod;
+import javafx.scene.paint.LinearGradient;
+import javafx.scene.paint.Stop;
+import javafx.scene.shape.Arc;
+import javafx.scene.shape.ArcType;
+import javafx.scene.shape.Ellipse;
+import javafx.scene.shape.Polygon;
+import javafx.scene.shape.Rectangle;
+import javafx.scene.transform.Rotate;
+import javafx.stage.Stage;
+
+public class MixedShapesT3DOpacity1 extends Application {
+    private static final Stop[] stops = new Stop[]{new Stop(0, Color.web("#992222")),
+            new Stop(0.7f, Color.web("#772222")), new Stop(1, Color.web("#552222"))};
+    private static final LinearGradient lg = new LinearGradient(0, 0, 0, 1, true,
+            CycleMethod.NO_CYCLE, stops);
+
+    @Override public void start(Stage stage) {
+        Scene scene = new Scene(new Group(), 400.0f, 300.0f);
+        scene.setCamera(new PerspectiveCamera());
+        Group group = new Group();
+        Group group2 = new Group();
+        group2.setRotate(60.0F);
+        group2.setRotationAxis(Rotate.Y_AXIS);
+        Ellipse ellipse = new Ellipse(100.0F, 80.0F, 50.0F, 25.0F);
+        ellipse.setOpacity(0.5F);
+        ellipse.setFill(Color.ORANGE);
+        ellipse.setStroke(Color.BLUE);
+        ellipse.setStrokeWidth(5.0F);
+        ellipse.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Ellipse: Mouse Clicked:" + e);
+                }
+            });
+        Arc arc = new Arc(250.0F, 80.0F, 50.0F, 25.0F, 45.0F, 270.0F);
+        arc.setOpacity(0.5F);
+        arc.setType(ArcType.ROUND);
+        arc.setFill(lg);
+        arc.setStroke(Color.BLUE);
+        arc.setStrokeWidth(5.0F);
+        arc.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Arc: Mouse Clicked:" + e);
+                }
+            });
+        Rectangle rectangle = new Rectangle(50.0F, 150.0F, 100.0F, 75.0F);
+        rectangle.setOpacity(0.5F);
+        rectangle.setArcHeight(20.0F);
+        rectangle.setArcWidth(20.0F);
+        rectangle.setFill(Color.GREEN);
+        rectangle.setStroke(Color.BLUE);
+        rectangle.setStrokeWidth(5.0F);
+        rectangle.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Rectangle: Mouse Clicked:" + e);
+                }
+            });
+        ObservableList<Double> floats = javafx.collections.FXCollections.<Double>observableArrayList();
+        floats.addAll(200.0, 150.0, 250.0, 220.0, 300.0, 150.0);
+        Polygon polygon = new Polygon();
+        polygon.getPoints().addAll(floats);
+        polygon.setOpacity(0.5F);
+        polygon.setFill(Color.YELLOW);
+        polygon.setStroke(Color.BLUE);
+        polygon.setStrokeWidth(5.0F);
+        polygon.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Polygon: Mouse Clicked:" + e);
+                }
+            });
+        group2.getChildren().addAll(ellipse, arc, rectangle, polygon);
+        group.getChildren().addAll(group2);
+        ((Group)scene.getRoot()).getChildren().addAll(group);
+        stage.setScene(scene);
+        stage.sizeToScene();
+        if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
+            System.out.println("*************************************************************");
+            System.out.println("*    WARNING: common conditional SCENE3D isn\'t supported    *");
+            System.out.println("*************************************************************");
+        }
+        stage.show();
+    }
+
+    public static void main(String[] args) {
+        Application.launch(args);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/toys/Shape3DToy/src/main/java/shapet3dtest/MixedShapesT3DOpacity2.java	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapet3dtest;
+
+import javafx.application.Application;
+import javafx.application.ConditionalFeature;
+import javafx.application.Platform;
+import javafx.collections.ObservableList;
+import javafx.event.EventHandler;
+import javafx.scene.Group;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.paint.Color;
+import javafx.scene.paint.CycleMethod;
+import javafx.scene.paint.LinearGradient;
+import javafx.scene.paint.Stop;
+import javafx.scene.shape.Arc;
+import javafx.scene.shape.ArcType;
+import javafx.scene.shape.Ellipse;
+import javafx.scene.shape.Polygon;
+import javafx.scene.shape.Rectangle;
+import javafx.scene.transform.Rotate;
+import javafx.stage.Stage;
+
+public class MixedShapesT3DOpacity2 extends Application {
+    private static final Stop[] stops = new Stop[]{new Stop(0, Color.web("#992222")),
+            new Stop(0.7f, Color.web("#772222")), new Stop(1, Color.web("#552222"))};
+    private static final LinearGradient lg = new LinearGradient(0, 0, 0, 1, true,
+            CycleMethod.NO_CYCLE, stops);
+
+    @Override public void start(Stage stage) {
+        Scene scene = new Scene(new Group(), 400.0f, 300.0f);
+        scene.setCamera(new PerspectiveCamera());
+        Group group = new Group();
+        Group group2 = new Group();
+        group2.setOpacity(0.5F);
+        group2.setRotate(60.0F);
+        group2.setRotationAxis(Rotate.Y_AXIS);
+        //                                    opacity: 0.5
+        Ellipse ellipse = new Ellipse(100.0F, 80.0F, 50.0F, 25.0F);
+        ellipse.setFill(Color.ORANGE);
+        ellipse.setStroke(Color.BLUE);
+        ellipse.setStrokeWidth(5.0F);
+        ellipse.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Ellipse: Mouse Clicked:" + e);
+                }
+            });
+        //                                    opacity: 0.5
+        Arc arc = new Arc(250.0F, 80.0F, 50.0F, 25.0F, 45.0F, 270.0F);
+        arc.setType(ArcType.ROUND);
+        arc.setFill(Color.RED);
+        arc.setStroke(Color.BLUE);
+        arc.setStrokeWidth(5.0F);
+        arc.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Arc: Mouse Clicked:" + e);
+                }
+            });
+        //                                    opacity: 0.5
+        Rectangle rectangle = new Rectangle(50.0F, 150.0F, 100.0F, 75.0F);
+        rectangle.setArcHeight(20.0F);
+        rectangle.setArcWidth(20.0F);
+        rectangle.setFill(Color.GREEN);
+        rectangle.setStroke(Color.BLUE);
+        rectangle.setStrokeWidth(5.0F);
+        rectangle.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Rectangle: Mouse Clicked:" + e);
+                }
+            });
+        //                                    opacity: 0.5
+        ObservableList<Double> floats = javafx.collections.FXCollections.<Double>observableArrayList();
+        floats.addAll(200.0, 150.0, 250.0, 220.0, 300.0, 150.0);
+        Polygon polygon = new Polygon();
+        polygon.getPoints().addAll(floats);
+        polygon.setFill(Color.YELLOW);
+        polygon.setStroke(Color.BLUE);
+        polygon.setStrokeWidth(5.0F);
+        polygon.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Polygon: Mouse Clicked:" + e);
+                }
+            });
+        group2.getChildren().addAll(ellipse, arc, rectangle, polygon);
+        group.getChildren().addAll(group2);
+        ((Group)scene.getRoot()).getChildren().addAll(group);
+        stage.setScene(scene);
+        stage.sizeToScene();
+        if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
+            System.out.println("*************************************************************");
+            System.out.println("*    WARNING: common conditional SCENE3D isn\'t supported    *");
+            System.out.println("*************************************************************");
+        }
+        stage.show();
+    }
+
+    public static void main(String[] args) {
+        Application.launch(args);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/toys/Shape3DToy/src/main/java/shapet3dtest/MixedShapesT3DOpacity3.java	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapet3dtest;
+
+import javafx.application.Application;
+import javafx.application.ConditionalFeature;
+import javafx.application.Platform;
+import javafx.collections.ObservableList;
+import javafx.event.EventHandler;
+import javafx.scene.Group;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.paint.Color;
+import javafx.scene.paint.CycleMethod;
+import javafx.scene.paint.LinearGradient;
+import javafx.scene.paint.Stop;
+import javafx.scene.shape.Arc;
+import javafx.scene.shape.ArcType;
+import javafx.scene.shape.Ellipse;
+import javafx.scene.shape.Polygon;
+import javafx.scene.shape.Rectangle;
+import javafx.scene.transform.Rotate;
+import javafx.stage.Stage;
+
+public class MixedShapesT3DOpacity3 extends Application {
+    private static final Stop[] stops = new Stop[]{new Stop(0, Color.web("#992222")),
+            new Stop(0.7f, Color.web("#772222")), new Stop(1, Color.web("#552222"))};
+    private static final LinearGradient lg = new LinearGradient(0, 0, 0, 1, true,
+            CycleMethod.NO_CYCLE, stops);
+
+    @Override public void start(Stage stage) {
+        Scene scene = new Scene(new Group(), 400.0f, 300.0f);
+        scene.setCamera(new PerspectiveCamera());
+        Group group = new Group();
+        group.setOpacity(0.5F);
+        Group group2 = new Group();
+        //                           opacity: 0.5
+        group2.setRotate(60.0F);
+        group2.setRotationAxis(Rotate.Y_AXIS);
+        //                                    opacity: 0.5
+        Ellipse ellipse = new Ellipse(100.0F, 80.0F, 50.0F, 25.0F);
+        ellipse.setFill(Color.ORANGE);
+        ellipse.setStroke(Color.BLUE);
+        ellipse.setStrokeWidth(5.0F);
+        ellipse.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Ellipse: Mouse Clicked:" + e);
+                }
+            });
+        //                                    opacity: 0.5
+        Arc arc = new Arc(250.0F, 80.0F, 50.0F, 25.0F, 45.0F, 270.0F);
+        arc.setType(ArcType.ROUND);
+        arc.setFill(Color.RED);
+        arc.setStroke(Color.BLUE);
+        arc.setStrokeWidth(5.0F);
+        arc.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Arc: Mouse Clicked:" + e);
+                }
+            });
+        //                                    opacity: 0.5
+        Rectangle rectangle = new Rectangle(50.0F, 150.0F, 100.0F, 75.0F);
+        rectangle.setArcHeight(20.0F);
+        rectangle.setArcWidth(20.0F);
+        rectangle.setFill(Color.GREEN);
+        rectangle.setStroke(Color.BLUE);
+        rectangle.setStrokeWidth(5.0F);
+        rectangle.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Rectangle: Mouse Clicked:" + e);
+                }
+            });
+        //                                    opacity: 0.5
+        ObservableList<Double> floats = javafx.collections.FXCollections.<Double>observableArrayList();
+        floats.addAll(200.0, 150.0, 250.0, 220.0, 300.0, 150.0);
+        Polygon polygon = new Polygon();
+        polygon.getPoints().addAll(floats);
+        polygon.setFill(Color.YELLOW);
+        polygon.setStroke(Color.BLUE);
+        polygon.setStrokeWidth(5.0F);
+        polygon.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Polygon: Mouse Clicked:" + e);
+                }
+            });
+        group2.getChildren().addAll(ellipse, arc, rectangle, polygon);
+        group.getChildren().addAll(group2);
+        ((Group)scene.getRoot()).getChildren().addAll(group);
+        stage.setScene(scene);
+        stage.sizeToScene();
+        if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
+            System.out.println("*************************************************************");
+            System.out.println("*    WARNING: common conditional SCENE3D isn\'t supported    *");
+            System.out.println("*************************************************************");
+        }
+        stage.show();
+    }
+
+    public static void main(String[] args) {
+        Application.launch(args);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/toys/Shape3DToy/src/main/java/shapet3dtest/PathAntiAliasingTest3D.java	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapet3dtest;
+
+import javafx.application.Application;
+import javafx.application.ConditionalFeature;
+import javafx.application.Platform;
+import javafx.scene.Group;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.paint.Color;
+import javafx.scene.shape.ClosePath;
+import javafx.scene.shape.CubicCurveTo;
+import javafx.scene.shape.HLineTo;
+import javafx.scene.shape.LineTo;
+import javafx.scene.shape.MoveTo;
+import javafx.scene.shape.Path;
+import javafx.scene.shape.QuadCurveTo;
+import javafx.scene.shape.VLineTo;
+import javafx.scene.transform.Rotate;
+import javafx.stage.Stage;
+
+public class PathAntiAliasingTest3D extends Application {
+    @Override public void start(Stage stage) {
+        stage.setTitle("Path Anti-Aliasing Test");
+        Scene scene = new Scene(new Group(), 800.0f, 800.0f);
+        scene.setCamera(new PerspectiveCamera());
+        scene.setFill(Color.BEIGE);
+        Path path = new Path();
+        path.setRotate(40.0F);
+        path.setRotationAxis(Rotate.Y_AXIS);
+        path.setStroke(Color.RED);
+        path.setStrokeWidth(8.0F);
+        path.getElements().clear();
+        path.getElements().addAll(new MoveTo(100.0F, 600.0F),
+                                  new LineTo(100.0F, 550.0F),
+                                  new CubicCurveTo(100.0F, 450.0F, 600.0F, 600.0F, 600.0F, 300.0F),
+                                  new VLineTo(150.0F),
+                                  new CubicCurveTo(600.0F, 40.0F, 700.0F, 80.0F, 700.0F, 200.0F),
+                                  new VLineTo(450.0F),
+                                  new QuadCurveTo(700.0F, 650.0F, 600.0F, 650.0F),
+                                  new HLineTo(150.0F),
+                                  new QuadCurveTo(100.0F, 650.0F, 100.0F, 600.0F),
+                                  new ClosePath());
+        ((Group)scene.getRoot()).getChildren().addAll(path);
+        stage.setScene(scene);
+        stage.sizeToScene();
+        if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
+            System.out.println("*************************************************************");
+            System.out.println("*    WARNING: common conditional SCENE3D isn\'t supported    *");
+            System.out.println("*************************************************************");
+        }
+        stage.show();
+    }
+
+    public static void main(String[] args) {
+        Application.launch(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/toys/Shape3DToy/src/main/java/shapet3dtest/PathT3D.java	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapet3dtest;
+
+import javafx.animation.Interpolator;
+import javafx.animation.RotateTransition;
+import javafx.application.Application;
+import javafx.application.ConditionalFeature;
+import javafx.application.Platform;
+import javafx.event.EventHandler;
+import javafx.scene.Group;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.paint.Color;
+import javafx.scene.shape.ArcTo;
+import javafx.scene.shape.HLineTo;
+import javafx.scene.shape.LineTo;
+import javafx.scene.shape.MoveTo;
+import javafx.scene.shape.Path;
+import javafx.scene.shape.QuadCurveTo;
+import javafx.scene.transform.Rotate;
+import javafx.stage.Stage;
+import javafx.util.Duration;
+
+public class PathT3D extends Application {
+    @Override public void start(Stage stage) {
+        Scene scene = new Scene(new Group(), 400.0f, 300.0f);
+        scene.setCamera(new PerspectiveCamera());
+        Group group = new Group();
+        group.setRotate(30.0F);
+        group.setRotationAxis(Rotate.Y_AXIS);
+        Path path = new Path();
+        ArcTo arcto = new ArcTo();
+        arcto.setX(10.0F);
+        arcto.setY(50.0F);
+        arcto.setRadiusX(100.0F);
+        arcto.setRadiusY(100.0F);
+        arcto.setSweepFlag(true);
+        path.getElements().clear();
+        path.getElements().addAll(new MoveTo(10.0F, 50.0F), new HLineTo(70.0F), new QuadCurveTo(100.0F, 0.0F, 120.0F, 60.0F), new LineTo(175.0F, 55.0F), arcto);
+        path.setFill(Color.BLUE);
+        path.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Mouse Clicked:" + e);
+                }
+            });
+        path.setOnMouseEntered(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Mouse Entered");
+                }
+            });
+        path.setOnMouseExited(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Mouse Exited");
+                }
+            });
+        group.getChildren().addAll(path);
+        ((Group)scene.getRoot()).getChildren().addAll(group);
+        stage.setScene(scene);
+        stage.sizeToScene();
+        if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
+            System.out.println("*************************************************************");
+            System.out.println("*    WARNING: common conditional SCENE3D isn\'t supported    *");
+            System.out.println("*************************************************************");
+        }
+        stage.show();
+
+        RotateTransition tx = new RotateTransition(Duration.seconds(20), group);
+        tx.setToAngle(360);
+        tx.setCycleCount(RotateTransition.INDEFINITE);
+        tx.setInterpolator(Interpolator.LINEAR);
+        tx.play();
+    }
+
+    public static void main(String[] args) {
+        Application.launch(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/toys/Shape3DToy/src/main/java/shapet3dtest/RectangleT3D.java	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapet3dtest;
+
+import javafx.application.Application;
+import javafx.application.ConditionalFeature;
+import javafx.application.Platform;
+import javafx.scene.Group;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.paint.Color;
+import javafx.scene.paint.CycleMethod;
+import javafx.scene.paint.LinearGradient;
+import javafx.scene.paint.Stop;
+import javafx.scene.shape.Rectangle;
+import javafx.scene.transform.Rotate;
+import javafx.stage.Stage;
+
+public class RectangleT3D extends Application {
+    private static final Stop[] stops = new Stop[]{new Stop(0, Color.web("#992222")),
+            new Stop(0.7f, Color.web("#772222")), new Stop(1, Color.web("#552222"))};
+    private static final LinearGradient lg = new LinearGradient(0, 0, 0, 1, true,
+            CycleMethod.NO_CYCLE, stops);
+
+    @Override public void start(Stage stage) {
+        Scene scene = new Scene(new Group(), 400.0f, 300.0f);
+        scene.setCamera(new PerspectiveCamera());
+        Rectangle rectangle = new Rectangle(100.0F, 100.0F, 200.0F, 100.0F);
+        rectangle.setArcHeight(20.0F);
+        rectangle.setArcWidth(20.0F);
+        rectangle.setFill(lg);
+        rectangle.setStroke(Color.BLUE);
+        rectangle.setStrokeWidth(5.0F);
+        rectangle.setRotate(60.0F);
+        rectangle.setRotationAxis(Rotate.Y_AXIS);
+        ((Group)scene.getRoot()).getChildren().addAll(rectangle);
+        stage.setScene(scene);
+        stage.sizeToScene();
+        if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
+            System.out.println("*************************************************************");
+            System.out.println("*    WARNING: common conditional SCENE3D isn\'t supported    *");
+            System.out.println("*************************************************************");
+        }
+        stage.show();
+    }
+
+    public static void main(String[] args) {
+        Application.launch(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/toys/Shape3DToy/src/main/java/shapet3dtest/TextAntiAliasingTest3D.java	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapet3dtest;
+
+import javafx.application.Application;
+import javafx.application.ConditionalFeature;
+import javafx.application.Platform;
+import javafx.scene.Group;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.paint.Color;
+import javafx.scene.text.Font;
+import javafx.scene.text.Text;
+import javafx.scene.transform.Rotate;
+import javafx.scene.transform.Scale;
+import javafx.stage.Stage;
+
+public class TextAntiAliasingTest3D extends Application {
+
+    @Override public void start(Stage stage) {
+        stage.setTitle("Path Anti-Aliasing Test");
+        Scene scene = new Scene(new Group(), 800.0f, 800.0f);
+        scene.setCamera(new PerspectiveCamera());
+        scene.setFill(Color.BEIGE);
+        Text text = new Text(-300.0F, 100.0F, "This is a test 0oO. This is a test 0oO. This is a test 0oO. This is a test 0oO.");
+        text.setFill(Color.RED);
+        text.setFont(new Font(40.0F));
+        Text text2 = new Text(-600.0F, 300.0F, "This is a test 0oO. This is a test 0oO. This is a test 0oO. This is a test 0oO.");
+        text2.getTransforms().clear();
+        text2.getTransforms().addAll(new Scale(0.5F, 0.5F));
+        text2.setFill(Color.RED);
+        text2.setFont(new Font(80.0F));
+        Text text3 = new Text(-300.0F, 500.0F, "This is a test 0oO. This is a test 0oO. This is a test 0oO. This is a test 0oO.");
+        text3.getTransforms().clear();
+        text3.getTransforms().addAll(new Scale(0.8F, 0.8F));
+        text3.setFill(Color.RED);
+        text3.setFont(new Font(60.0F));
+        text3.setRotate(60.0F);
+        text3.setRotationAxis(Rotate.Y_AXIS);
+        ((Group)scene.getRoot()).getChildren().addAll(text, text2, text3);
+        stage.setScene(scene);
+        stage.sizeToScene();
+        if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
+            System.out.println("*************************************************************");
+            System.out.println("*    WARNING: common conditional SCENE3D isn\'t supported    *");
+            System.out.println("*************************************************************");
+        }
+        stage.show();
+    }
+
+    public static void main(String[] args) {
+        Application.launch(args);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apps/toys/Shape3DToy/src/main/java/shapet3dtest/TextT3D.java	Tue Jul 23 17:23:49 2013 -0700
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapet3dtest;
+
+import javafx.animation.Interpolator;
+import javafx.animation.PauseTransition;
+import javafx.animation.RotateTransition;
+import javafx.animation.SequentialTransition;
+import javafx.application.Application;
+import javafx.application.ConditionalFeature;
+import javafx.application.Platform;
+import javafx.event.EventHandler;
+import javafx.scene.Group;
+import javafx.scene.PerspectiveCamera;
+import javafx.scene.Scene;
+import javafx.scene.input.MouseEvent;
+import javafx.scene.text.Font;
+import javafx.scene.text.Text;
+import javafx.scene.transform.Rotate;
+import javafx.stage.Stage;
+import javafx.util.Duration;
+
+public class TextT3D extends Application {
+
+    @Override public void start(Stage stage) {
+        Scene scene = new Scene(new Group(), 1200.0f, 300.0f);
+        scene.setCamera(new PerspectiveCamera());
+        Text text = new Text(50.0F, 150.0F, "This is a test LONGLONGLONG     LONG");
+        text.setFont(new Font(50.0F));
+        text.setRotationAxis(Rotate.Y_AXIS);
+        text.setOnMouseClicked(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Mouse Clicked:" + e);
+                }
+            });
+        text.setOnMouseEntered(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Mouse Entered");
+                }
+            });
+        text.setOnMouseExited(new EventHandler<MouseEvent>() {
+                @Override
+                public void handle(MouseEvent e) {
+                    System.out.println("Mouse Exited");
+                }
+            });
+        ((Group)scene.getRoot()).getChildren().addAll(text);
+        stage.setScene(scene);
+        stage.sizeToScene();
+        if (!Platform.isSupported(ConditionalFeature.SCENE3D)) {
+            System.out.println("*************************************************************");
+            System.out.println("*    WARNING: common conditional SCENE3D isn't supported    *");
+            System.out.println("*************************************************************");
+        }
+        stage.show();
+
+        final RotateTransition tx = new RotateTransition(Duration.seconds(20), text);
+        tx.setToAngle(360);
+        tx.setCycleCount(RotateTransition.INDEFINITE);
+        tx.setInterpolator(Interpolator.LINEAR);
+
+        PauseTransition ptx = new PauseTransition(Duration.seconds(1));
+        SequentialTransition stx = new SequentialTransition(ptx, tx);
+        stx.play();
+    }
+
+    public static void main(String[] args) {
+        Application.launch(args);
+    }
+}
Binary file apps/toys/Shape3DToy/src/main/resources/shapet3dtest/JavaFX.png has changed
--- a/build.gradle	Tue Jul 23 09:18:52 2013 -0700
+++ b/build.gradle	Tue Jul 23 17:23:49 2013 -0700
@@ -319,6 +319,10 @@
 defineProperty("USE_DEPEND", "true")
 ext.USE_DEPEND = Boolean.parseBoolean(USE_DEPEND)
 
+// Specifies whether to generate code coverage statistics when running tests
+defineProperty("JCOV", "false")
+ext.DO_JCOV = Boolean.parseBoolean(JCOV)
+
 // Define the number of threads to use when compiling (specifically for native compilation)
 defineProperty("NUM_COMPILE_THREADS", "${Runtime.runtime.availableProcessors()}")
 
@@ -853,7 +857,9 @@
     // setup this dependency here.
     dependencies {
         testCompile group: "junit", name: "junit", version: "4.8.2"
-        if (BUILD_CLOSED) testCompile name: "jcov"
+        if (BUILD_CLOSED && DO_JCOV)  {
+            testCompile name: "jcov"
+        }
     }
 
     // At the moment the ASM library shipped with Gradle that is used to
@@ -872,7 +878,7 @@
         include("**/*Test.*");
         exclude("**/DepthTest.*");
         exclude("**/*Abstract*.*");
-        if (BUILD_CLOSED) {
+        if (BUILD_CLOSED && DO_JCOV) {
             addJCov(project, test)
         }
     }
@@ -1197,7 +1203,7 @@
         test.scanForTestClasses = false
         test.include "**/*Test.*"
         test.exclude "**/*Abstract*.*"
-        if (BUILD_CLOSED) {
+        if (BUILD_CLOSED && DO_JCOV) {
             addJCov(project, test)
         }
     }
@@ -1239,6 +1245,7 @@
         compile BUILD_SRC, project(":base"), project(":graphics"), project(":designTime")
         // TODO not sure how to specify this? processResources project(":base"), project(":graphics")
         testCompile project(":graphics").sourceSets.stub.output
+        testCompile project(":base").sourceSets.test.output
     }
 
     test {
@@ -1991,7 +1998,7 @@
         doLast {
             def classpath = files("$buildDir/classes/main",
                                   project(":graphics").sourceSets.main.output.classesDir)
-            def dest = file("src/main/build/javah");
+            def dest = file("$buildDir/generated-src/headers");
             mkdir dest;
             exec {
                 commandLine("$JAVAH", "-J-Djava.ext.dirs=", "-d", "$dest",
@@ -2036,13 +2043,13 @@
 
     task compileNative(dependsOn: generateHeaders) {
         doLast {
-            ant.unzip(src:  configurations.webkit.files.iterator().next(),
-                      dest: "src/main/native/WebKitLibraries")
             exec {
                 println "Webkit configuration to use: $CONF"
                 workingDir("src/main/native")
                 commandLine("perl", "Tools/Scripts/set-webkit-configuration", "--$CONF")
             }
+            ant.unzip(src:  configurations.webkit.files.iterator().next(),
+                      dest: "src/main/native/WebKitBuild")
             exec {
                 workingDir("src/main/native")
                 if (IS_WINDOWS) {
@@ -2174,11 +2181,24 @@
 
     clean << {
         project.delete(
-            "src/main/build",
             "$webkitOutputDir",
             "src/main/native/WebKitBuild/Tools",
-            "src/main/native/WebKitBuild/classes",
-            "src/main/native/dist",
-            "src/main/native/WebKitLibraries/import")
+            "src/main/native/WebKitBuild/import")
     }
 }
+
+task showFlags {
+}
+
+compileTargets { t ->
+    // Every platform must define these variables
+    def props = project.ext[t.upper];
+    showFlags.dependsOn(
+        project.task("showFlags$t.upper") {
+            doLast() {
+                println "Properties set for $t.upper"
+                props.each { println it }
+            }
+        }
+    )
+}
--- a/buildSrc/armv6hf.gradle	Tue Jul 23 09:18:52 2013 -0700
+++ b/buildSrc/armv6hf.gradle	Tue Jul 23 17:23:49 2013 -0700
@@ -123,10 +123,10 @@
 def iioCFlags = [extraCFlags].flatten()
 def iioLFlags = [extraLFlags].flatten()
 
-def es2EglfbCFlags = [extraCFlags, "-DIS_EGLFB", "-DLINUX", "-DGRADLE_BUILD"].flatten()
+def es2EglfbCFlags = [extraCFlags, "-DIS_EGLFB", "-DLINUX"].flatten()
 def es2EglfbLFlags = [extraLFlags].flatten()
 
-def es2X11CFlags = [extraCFlags, "-DUSE_XSHM", "-DDEBUG", "-DIS_EGLX11", "-DLINUX", "-DGRADLE_BUILD"].flatten()
+def es2X11CFlags = [extraCFlags, "-DUSE_XSHM", "-DDEBUG", "-DIS_EGLX11", "-DLINUX"].flatten()
 def es2X11LFlags = [extraLFlags, "-lX11", "-lXext", "-lXdmcp", "-lXau"].flatten()
 
 def mediaCFlags = [extraCFlags,
@@ -149,9 +149,9 @@
 //  libgstplugins-lite.so \
 //  libgstreamer-lite.so \
 //  libprism-es2-eglx11.so \
-//  libglass-lens-fb.so \
+//  libglass_lens_fb.so \
 
-setupTools("armv6-hf_tools",
+setupTools("armv6hf_tools",
     { propFile ->
         ByteArrayOutputStream results = new ByteArrayOutputStream();
         exec {
@@ -216,18 +216,18 @@
 
 def pangoCCFlags = [extraCFlags, "-D_ENABLE_PANGO"];
 def pangoLinkFlags = [extraLFlags];
-setupTools("linux_pango_tools",
+setupTools("armv6hf_pango_tools",
     { propFile ->
         ByteArrayOutputStream results = new ByteArrayOutputStream();
         exec {
-            commandLine "pkg-config", "--cflags", "pangoft2"
+            commandLine "$sdk/bin/pkg-config", "--cflags", "pangoft2"
             standardOutput = results
         }
         propFile << "cflags=" << results.toString().trim() << "\n";
 
         results = new ByteArrayOutputStream();
         exec {
-            commandLine "pkg-config", "--libs", "pangoft2"
+            commandLine "$sdk/bin/pkg-config", "--libs", "pangoft2"
             standardOutput = results
         }
         propFile << "libs=" << results.toString().trim();
@@ -266,10 +266,10 @@
     file("modules/graphics/src/main/native-glass/lens/wm/screen/fbdevScreen.c")]
     //file("modules/graphics/src/main/native-glass/lens/wm/screen")]
 ARMV6HF.glass.eglfb.compiler = compiler
-ARMV6HF.glass.eglfb.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DGRADLE_BUILD"].flatten()
+ARMV6HF.glass.eglfb.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DISEGLFB"].flatten()
 ARMV6HF.glass.eglfb.linker = linker
 ARMV6HF.glass.eglfb.linkFlags = [lensLFlags].flatten()
-ARMV6HF.glass.eglfb.lib = "glass-lens-eglfb"
+ARMV6HF.glass.eglfb.lib = "glass_lens_eglfb"
 
 ARMV6HF.glass.directfb = [:]
 ARMV6HF.glass.directfb.nativeSource = [
@@ -280,10 +280,10 @@
     file("modules/graphics/src/main/native-glass/lens/wm/screen/dfbScreen.c")]
     //file("modules/graphics/src/main/native-glass/lens/wm/screen")]
 ARMV6HF.glass.directfb.compiler = compiler
-ARMV6HF.glass.directfb.ccFlags = ["-ffast-math", extraCFlags, "-I$sdk/usr/include/directfb", "-DLINUX", "-DGRADLE_BUILD"].flatten()
+ARMV6HF.glass.directfb.ccFlags = ["-ffast-math", extraCFlags, "-I$sdk/usr/include/directfb", "-DLINUX"].flatten()
 ARMV6HF.glass.directfb.linker = linker
 ARMV6HF.glass.directfb.linkFlags = [lensLFlags].flatten()
-ARMV6HF.glass.directfb.lib = "glass-lens-dfb"
+ARMV6HF.glass.directfb.lib = "glass_lens_dfb"
 
 ARMV6HF.glass.fb = [:]
 ARMV6HF.glass.fb.nativeSource = [
@@ -294,10 +294,10 @@
     file("modules/graphics/src/main/native-glass/lens/wm/screen/fbdevScreen.c")]
     //file("modules/graphics/src/main/native-glass/lens/wm/screen")]
 ARMV6HF.glass.fb.compiler = compiler
-ARMV6HF.glass.fb.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DGRADLE_BUILD"].flatten()
+ARMV6HF.glass.fb.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX"].flatten()
 ARMV6HF.glass.fb.linker = linker
 ARMV6HF.glass.fb.linkFlags = [lensLFlags].flatten()
-ARMV6HF.glass.fb.lib = "glass-lens-fb"
+ARMV6HF.glass.fb.lib = "glass_lens_fb"
 
 ARMV6HF.glass.eglx11 = [:]
 ARMV6HF.glass.eglx11.nativeSource = [
@@ -308,17 +308,17 @@
     file("modules/graphics/src/main/native-glass/lens/wm/screen/x11ContainerScreen.c")]
     //file("modules/graphics/src/main/native-glass/lens/wm/screen")]
 ARMV6HF.glass.eglx11.compiler = compiler
-ARMV6HF.glass.eglx11.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DGRADLE_BUILD"].flatten()
+ARMV6HF.glass.eglx11.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX"].flatten()
 ARMV6HF.glass.eglx11.linker = linker
 ARMV6HF.glass.eglx11.linkFlags = [lensLFlags].flatten()
-ARMV6HF.glass.eglx11.lib = "glass-lens-eglx11"
+ARMV6HF.glass.eglx11.lib = "glass_lens_eglx11"
 
 ARMV6HF.glass.gtk = [:]
 ARMV6HF.glass.gtk.nativeSource = [
     file("modules/graphics/src/main/native-glass/lens"),
     file("modules/graphics/src/main/native-glass/lens/wm")]
 ARMV6HF.glass.gtk.compiler = compiler
-ARMV6HF.glass.gtk.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DGRADLE_BUILD"].flatten()
+ARMV6HF.glass.gtk.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX"].flatten()
 ARMV6HF.glass.gtk.linker = linker
 ARMV6HF.glass.gtk.linkFlags = [lensLFlags, "-lstdc++"].flatten()
 ARMV6HF.glass.gtk.lib = "glass"
@@ -328,7 +328,7 @@
 ARMV6HF.decora.ccFlags = extraCFlags
 ARMV6HF.decora.linker = linker
 ARMV6HF.decora.linkFlags = extraLFlags
-ARMV6HF.decora.lib = "decora-sse"
+ARMV6HF.decora.lib = "decora_sse"
 
 ARMV6HF.prism = [:]
 ARMV6HF.prism.javahInclude = ["com/sun/prism/impl/**/*", "com/sun/prism/PresentableState*"]
@@ -337,7 +337,7 @@
 ARMV6HF.prism.ccFlags = [extraCFlags].flatten()
 ARMV6HF.prism.linker = linker
 ARMV6HF.prism.linkFlags = [extraLFlags, "-lX11", "-lXext", "-lXdmcp", "-lXau"].flatten()
-ARMV6HF.prism.lib = "prism-common"
+ARMV6HF.prism.lib = "prism_common"
 
 ARMV6HF.prismSW = [:]
 ARMV6HF.prismSW.javahInclude = ["com/sun/pisces/**/*"]
@@ -346,7 +346,7 @@
 ARMV6HF.prismSW.ccFlags = [extraCFlags].flatten()
 ARMV6HF.prismSW.linker = linker
 ARMV6HF.prismSW.linkFlags = [extraLFlags].flatten()
-ARMV6HF.prismSW.lib = "prism-sw"
+ARMV6HF.prismSW.lib = "prism_sw"
 
 ARMV6HF.iio = [:]
 ARMV6HF.iio.javahInclude = ["com/sun/javafx/iio/**/*"]
@@ -357,7 +357,7 @@
 ARMV6HF.iio.ccFlags = iioCFlags
 ARMV6HF.iio.linker = linker
 ARMV6HF.iio.linkFlags = iioLFlags
-ARMV6HF.iio.lib = "javafx-iio"
+ARMV6HF.iio.lib = "javafx_iio"
 
 ARMV6HF.prismES2 = [:]
 ARMV6HF.prismES2.variants = ["eglfb", "eglx11"]
@@ -373,7 +373,7 @@
 ARMV6HF.prismES2.eglfb.ccFlags = es2EglfbCFlags
 ARMV6HF.prismES2.eglfb.linker = linker
 ARMV6HF.prismES2.eglfb.linkFlags = es2EglfbLFlags
-ARMV6HF.prismES2.eglfb.lib = "prism-es2-eglfb"
+ARMV6HF.prismES2.eglfb.lib = "prism_es2_eglfb"
 
 ARMV6HF.prismES2.eglx11 = [:]
 ARMV6HF.prismES2.eglx11.nativeSource = [
@@ -385,7 +385,7 @@
 ARMV6HF.prismES2.eglx11.ccFlags = es2X11CFlags
 ARMV6HF.prismES2.eglx11.linker = linker
 ARMV6HF.prismES2.eglx11.linkFlags = es2X11LFlags
-ARMV6HF.prismES2.eglx11.lib = "prism-es2-eglx11"
+ARMV6HF.prismES2.eglx11.lib = "prism_es2_eglx11"
 
 def closedDir = file("$projectDir/../rt-closed")
 ARMV6HF.font = [:]
@@ -397,7 +397,7 @@
 ARMV6HF.font.ccFlags = fontCFlags
 ARMV6HF.font.linker = linker
 ARMV6HF.font.linkFlags = fontLFlags
-ARMV6HF.font.lib = "javafx-font"
+ARMV6HF.font.lib = "javafx_font"
 
 ARMV6HF.fontT2K = [:]
 ARMV6HF.fontT2K.javahInclude = ["com/sun/javafx/font/t2k/**/*"]
@@ -409,7 +409,7 @@
 ARMV6HF.fontT2K.ccFlags = fontCFlags
 ARMV6HF.fontT2K.linker = linker
 ARMV6HF.fontT2K.linkFlags = fontLFlags
-ARMV6HF.fontT2K.lib = "javafx-font-t2k"
+ARMV6HF.fontT2K.lib = "javafx_font_t2k"
 
 ARMV6HF.fontPango = [:]
 ARMV6HF.fontPango.javahInclude = ["com/sun/javafx/font/pango/*"]
--- a/buildSrc/armv6sf.gradle	Tue Jul 23 09:18:52 2013 -0700
+++ b/buildSrc/armv6sf.gradle	Tue Jul 23 17:23:49 2013 -0700
@@ -32,6 +32,10 @@
 def sdk=file("${rootProject.CROSS_TOOLS_DIR}/armv6-vfp-03")
 
 def compilerHome=file("/opt/arm-2009q1")
+if (rootProject.hasProperty("ARMV6SF_COMPILER")) {
+    logger.quiet "Using alternate ARMV6SF_COMPILER $rootProject.ARMV6SF_COMPILER"
+    compilerHome=file(rootProject.ARMV6SF_COMPILER);
+}
 
 // Declare whether this particular target file applies to the current system
 ARMV6SF.canBuild = IS_LINUX && compilerHome.exists() && sdk.exists()
@@ -130,10 +134,10 @@
 def es2CFlags = [extraCFlags].flatten()
 def es2LFlags = [extraLFlags, x11LFlags, eglLFlags].flatten()
 
-def es2EglfbCFlags = [extraCFlags, eglCFlags, "-DIS_EGLFB", "-DLINUX", "-DGRADLE_BUILD"].flatten()
+def es2EglfbCFlags = [extraCFlags, eglCFlags, "-DIS_EGLFB", "-DLINUX"].flatten()
 def es2EglfbLFlags = [extraLFlags, eglLFlags].flatten()
 
-def es2X11CFlags = [extraCFlags, eglCFlags, x11CFlags, "-DDEBUG", "-DIS_EGLX11", "-DLINUX", "-DGRADLE_BUILD"].flatten()
+def es2X11CFlags = [extraCFlags, eglCFlags, x11CFlags, "-DDEBUG", "-DIS_EGLX11", "-DLINUX"].flatten()
 def es2X11LFlags = [extraLFlags, x11LFlags, eglLFlags, "-lXdmcp", "-lXau"].flatten()
 
 def prismSWCFlags = [extraCFlags].flatten()
@@ -165,7 +169,7 @@
 //defineProperty("PRISM_CC", "cc");
 //defineProperty("PRISM_SW_CC", "cc");
 
-setupTools("armv6-sf_tools",
+setupTools("armv6sf_tools",
     { propFile ->
         ByteArrayOutputStream results = new ByteArrayOutputStream();
         exec {
@@ -231,18 +235,18 @@
 
 def pangoCCFlags = [extraCFlags, "-D_ENABLE_PANGO"];
 def pangoLinkFlags = [extraLFlags];
-setupTools("linux_pango_tools",
+setupTools("armv6sf_pango_tools",
     { propFile ->
         ByteArrayOutputStream results = new ByteArrayOutputStream();
         exec {
-            commandLine "pkg-config", "--cflags", "pangoft2"
+            commandLine "$sdk/bin/pkg-config", "--cflags", "pangoft2"
             standardOutput = results
         }
         propFile << "cflags=" << results.toString().trim() << "\n";
 
         results = new ByteArrayOutputStream();
         exec {
-            commandLine "pkg-config", "--libs", "pangoft2"
+            commandLine "$sdk/bin/pkg-config", "--libs", "pangoft2"
             standardOutput = results
         }
         propFile << "libs=" << results.toString().trim();
@@ -280,10 +284,10 @@
     file("modules/graphics/src/main/native-glass/lens/input/udev"),
     file("modules/graphics/src/main/native-glass/lens/wm/screen/fbdevScreen.c")]
 ARMV6SF.glass.eglfb.compiler = compiler
-ARMV6SF.glass.eglfb.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DGRADLE_BUILD"].flatten()
+ARMV6SF.glass.eglfb.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DISEGLFB"].flatten()
 ARMV6SF.glass.eglfb.linker = linker
 ARMV6SF.glass.eglfb.linkFlags = [lensLFlags].flatten()
-ARMV6SF.glass.eglfb.lib = "glass-lens-eglfb"
+ARMV6SF.glass.eglfb.lib = "glass_lens_eglfb"
 
 ARMV6SF.glass.directfb = [:]
 ARMV6SF.glass.directfb.nativeSource = [
@@ -293,10 +297,10 @@
     file("modules/graphics/src/main/native-glass/lens/input/udev"),
     file("modules/graphics/src/main/native-glass/lens/wm/screen/dfbScreen.c")]
 ARMV6SF.glass.directfb.compiler = compiler
-ARMV6SF.glass.directfb.ccFlags = ["-ffast-math", extraCFlags, "-I$sdk/usr/include/directfb", "-DLINUX", "-DGRADLE_BUILD"].flatten()
+ARMV6SF.glass.directfb.ccFlags = ["-ffast-math", extraCFlags, "-I$sdk/usr/include/directfb", "-DLINUX"].flatten()
 ARMV6SF.glass.directfb.linker = linker
 ARMV6SF.glass.directfb.linkFlags = [lensLFlags].flatten()
-ARMV6SF.glass.directfb.lib = "glass-lens-dfb"
+ARMV6SF.glass.directfb.lib = "glass_lens_dfb"
 
 ARMV6SF.glass.fb = [:]
 ARMV6SF.glass.fb.nativeSource = [
@@ -306,10 +310,10 @@
     file("modules/graphics/src/main/native-glass/lens/input/udev"),
     file("modules/graphics/src/main/native-glass/lens/wm/screen/fbdevScreen.c")]
 ARMV6SF.glass.fb.compiler = compiler
-ARMV6SF.glass.fb.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DGRADLE_BUILD"].flatten()
+ARMV6SF.glass.fb.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX"].flatten()
 ARMV6SF.glass.fb.linker = linker
 ARMV6SF.glass.fb.linkFlags = [lensLFlags].flatten()
-ARMV6SF.glass.fb.lib = "glass-lens-fb"
+ARMV6SF.glass.fb.lib = "glass_lens_fb"
  
 ARMV6SF.glass.eglx11 = [:]
 ARMV6SF.glass.eglx11.nativeSource = [
@@ -320,17 +324,17 @@
     file("modules/graphics/src/main/native-glass/lens/wm/screen/x11ContainerScreen.c")]
 ARMV6SF.glass.eglx11.compiler = compiler
 ARMV6SF.glass.eglx11.ccFlags = ["-ffast-math", extraCFlags].flatten()
-ARMV6SF.glass.eglx11.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DGRADLE_BUILD"].flatten()
+ARMV6SF.glass.eglx11.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX"].flatten()
 ARMV6SF.glass.eglx11.linker = linker
 ARMV6SF.glass.eglx11.linkFlags = [lensLFlags].flatten()
-ARMV6SF.glass.eglx11.lib = "glass-lens-eglx11"
+ARMV6SF.glass.eglx11.lib = "glass_lens_eglx11"
  
 ARMV6SF.glass.gtk = [:]
 ARMV6SF.glass.gtk.nativeSource = [
     file("modules/graphics/src/main/native-glass/lens"),
     file("modules/graphics/src/main/native-glass/lens/wm")]
 ARMV6SF.glass.gtk.compiler = compiler
-ARMV6SF.glass.gtk.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DGRADLE_BUILD"].flatten()
+ARMV6SF.glass.gtk.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX"].flatten()
 ARMV6SF.glass.gtk.linker = linker
 ARMV6SF.glass.gtk.linkFlags = [lensLFlags, "-lstdc++"].flatten()
 ARMV6SF.glass.gtk.lib = "glass"
@@ -340,7 +344,7 @@
 ARMV6SF.decora.ccFlags = extraCFlags
 ARMV6SF.decora.linker = linker
 ARMV6SF.decora.linkFlags = extraLFlags
-ARMV6SF.decora.lib = "decora-sse"
+ARMV6SF.decora.lib = "decora_sse"
 
 ARMV6SF.prism = [:]
 ARMV6SF.prism.javahInclude = ["com/sun/prism/impl/**/*", "com/sun/prism/PresentableState*"]
@@ -349,7 +353,7 @@
 ARMV6SF.prism.ccFlags = es2CFlags // or es2EglfbCFlags? or es2X11CFlags?
 ARMV6SF.prism.linker = linker
 ARMV6SF.prism.linkFlags = es2LFlags // or es2EglfbLFlags or es2X11LFlags?
-ARMV6SF.prism.lib = "prism-common"
+ARMV6SF.prism.lib = "prism_common"
 
 ARMV6SF.prismSW = [:]
 ARMV6SF.prismSW.javahInclude = ["com/sun/pisces/**/*"]
@@ -358,7 +362,7 @@
 ARMV6SF.prismSW.ccFlags = prismSWCFlags
 ARMV6SF.prismSW.linker = linker
 ARMV6SF.prismSW.linkFlags = prismSWLFlags
-ARMV6SF.prismSW.lib = "prism-sw"
+ARMV6SF.prismSW.lib = "prism_sw"
 
 ARMV6SF.iio = [:]
 ARMV6SF.iio.javahInclude = ["com/sun/javafx/iio/**/*"]
@@ -369,7 +373,7 @@
 ARMV6SF.iio.ccFlags = iioCFlags
 ARMV6SF.iio.linker = linker
 ARMV6SF.iio.linkFlags = iioLFlags
-ARMV6SF.iio.lib = "javafx-iio"
+ARMV6SF.iio.lib = "javafx_iio"
 
 ARMV6SF.prismES2 = [:]
 ARMV6SF.prismES2.variants = ["eglfb", "eglx11"]
@@ -385,7 +389,7 @@
 ARMV6SF.prismES2.eglfb.ccFlags = es2EglfbCFlags
 ARMV6SF.prismES2.eglfb.linker = linker
 ARMV6SF.prismES2.eglfb.linkFlags = es2EglfbLFlags
-ARMV6SF.prismES2.eglfb.lib = "prism-es2-eglfb"
+ARMV6SF.prismES2.eglfb.lib = "prism_es2_eglfb"
 
 ARMV6SF.prismES2.eglx11 = [:]
 ARMV6SF.prismES2.eglx11.nativeSource = [
@@ -397,7 +401,7 @@
 ARMV6SF.prismES2.eglx11.ccFlags = es2X11CFlags
 ARMV6SF.prismES2.eglx11.linker = linker
 ARMV6SF.prismES2.eglx11.linkFlags = es2X11LFlags
-ARMV6SF.prismES2.eglx11.lib = "prism-es2-eglx11"
+ARMV6SF.prismES2.eglx11.lib = "prism_es2_eglx11"
 
 def closedDir = file("$projectDir/../rt-closed")
 ARMV6SF.font = [:]
@@ -409,7 +413,7 @@
 ARMV6SF.font.ccFlags = fontCFlags
 ARMV6SF.font.linker = linker
 ARMV6SF.font.linkFlags = fontLFlags
-ARMV6SF.font.lib = "javafx-font"
+ARMV6SF.font.lib = "javafx_font"
 
 ARMV6SF.fontT2K = [:]
 ARMV6SF.fontT2K.javahInclude = ["com/sun/javafx/font/t2k/**/*"]
@@ -421,7 +425,7 @@
 ARMV6SF.fontT2K.ccFlags = fontCFlags
 ARMV6SF.fontT2K.linker = linker
 ARMV6SF.fontT2K.linkFlags = fontLFlags
-ARMV6SF.fontT2K.lib = "javafx-font-t2k"
+ARMV6SF.fontT2K.lib = "javafx_font_t2k"
 
 ARMV6SF.fontPango = [:]
 ARMV6SF.fontPango.javahInclude = ["com/sun/javafx/font/pango/*"]
--- a/buildSrc/ios.gradle	Tue Jul 23 09:18:52 2013 -0700
+++ b/buildSrc/ios.gradle	Tue Jul 23 17:23:49 2013 -0700
@@ -48,8 +48,8 @@
 if (GENERATE_SYMBOLS instanceof String) IOS.generateSymbols = Boolean.parseBoolean(GENERATE_SYMBOLS)
 
 IOS.generateSymbolsExcludes = [
-    "libprism-sw.a",
-    "libdecora-sse-armv7.a"
+    "libprism_sw.a",
+    "libdecora_sse_armv7.a"
 ]
 
 defineProperty("IOS_VERSION", "6.1")
@@ -138,7 +138,7 @@
 IOS.glass.arm.ccFlags = ["-x", "objective-c", ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS)].flatten()
 IOS.glass.arm.linker = linker
 IOS.glass.arm.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags, "-L${sdkPath(iPhoneOS)}/usr/lib"].flatten()
-IOS.glass.arm.lib = "glass-${archArm}"
+IOS.glass.arm.lib = "glass_${archArm}"
 
 IOS.glass.x86 = [:]
 IOS.glass.x86.nativeSource = file("modules/graphics/src/main/native-glass/ios")
@@ -146,17 +146,17 @@
 IOS.glass.x86.ccFlags = ["-x", "objective-c", ccFlags, "-arch", archX86, "-isysroot", sdkPath(iPhoneSim)].flatten()
 IOS.glass.x86.linker = linker
 IOS.glass.x86.linkFlags = ["-arch_only", archX86, "-syslibroot", sdkPath(iPhoneSim), linkFlags, "-L${sdkPath(iPhoneSim)}/usr/lib"].flatten()
-IOS.glass.x86.lib = "glass-${archX86}"
+IOS.glass.x86.lib = "glass_${archX86}"
 
 IOS.decora = [:]
 IOS.decora.compiler = compiler
 IOS.decora.ccFlags = [ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS), "-ffast-math"].flatten()
 IOS.decora.linker = linker
 IOS.decora.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags].flatten()
-IOS.decora.lib = "decora-sse-${archArm}"
+IOS.decora.lib = "decora_sse_${archArm}"
 
 IOS.prism = [:]
-IOS.prism.lib = "prism-common"
+IOS.prism.lib = "prism_common"
 IOS.prism.javahInclude = ["com/sun/prism/impl/**/*", "com/sun/prism/PresentableState*"]
 IOS.prism.variants = ["arm", "x86"];
 
@@ -166,7 +166,7 @@
 IOS.prism.arm.ccFlags = [ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS), "-DINLINE=inline"].flatten()
 IOS.prism.arm.linker = linker
 IOS.prism.arm.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags].flatten()
-IOS.prism.arm.lib = "prism-common-${archArm}"
+IOS.prism.arm.lib = "prism_common_${archArm}"
 
 IOS.prism.x86 = [:]
 IOS.prism.x86.nativeSource = file("modules/graphics/src/main/native-prism")
@@ -174,10 +174,10 @@
 IOS.prism.x86.ccFlags = [ccFlags, "-arch", archX86, "-isysroot", sdkPath(iPhoneSim), "-DINLINE=inline"].flatten()
 IOS.prism.x86.linker = linker
 IOS.prism.x86.linkFlags = ["-arch_only", archX86, "-syslibroot", sdkPath(iPhoneSim), linkFlags].flatten()
-IOS.prism.x86.lib = "prism-common-${archX86}"
+IOS.prism.x86.lib = "prism_common_${archX86}"
 
 IOS.prismSW = [:]
-IOS.prismSW.lib = "prism-sw"
+IOS.prismSW.lib = "prism_sw"
 IOS.prismSW.javahInclude = ["com/sun/pisces/**/*"]
 IOS.prismSW.variants = ["arm", "x86"];
 
@@ -187,7 +187,7 @@
 IOS.prismSW.arm.ccFlags = [IOS.prism.arm.ccFlags].flatten()
 IOS.prismSW.arm.linker = linker
 IOS.prismSW.arm.linkFlags = [IOS.prism.arm.linkFlags].flatten()
-IOS.prismSW.arm.lib = "prism-sw-${archArm}"
+IOS.prismSW.arm.lib = "prism_sw_${archArm}"
 
 IOS.prismSW.x86 = [:]
 IOS.prismSW.x86.nativeSource = file("modules/graphics/src/main/native-prism-sw")
@@ -195,10 +195,10 @@
 IOS.prismSW.x86.ccFlags = [IOS.prism.x86.ccFlags].flatten()
 IOS.prismSW.x86.linker = linker
 IOS.prismSW.x86.linkFlags = [IOS.prism.x86.linkFlags].flatten()
-IOS.prismSW.x86.lib = "prism-sw-${archX86}"
+IOS.prismSW.x86.lib = "prism_sw_${archX86}"
 
 IOS.iio = [:]
-IOS.iio.lib = "javafx-iio"
+IOS.iio.lib = "javafx_iio"
 IOS.iio.javahInclude = ["com/sun/javafx/iio/**/*"]
 IOS.iio.variants = ["arm", "x86"];
 
@@ -211,7 +211,7 @@
 IOS.iio.arm.ccFlags = ["-x", "objective-c", ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS), "-ffast-math"].flatten()
 IOS.iio.arm.linker = linker
 IOS.iio.arm.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags].flatten()
-IOS.iio.arm.lib = "javafx-iio-${archArm}"
+IOS.iio.arm.lib = "javafx_iio_${archArm}"
 
 IOS.iio.x86 = [:]
 IOS.iio.x86.nativeSource = [IOS.iio.arm.nativeSource].flatten()
@@ -219,10 +219,10 @@
 IOS.iio.x86.ccFlags = ["-x", "objective-c", ccFlags, "-arch", archX86, "-isysroot", sdkPath(iPhoneSim), "-ffast-math"].flatten()
 IOS.iio.x86.linker = linker
 IOS.iio.x86.linkFlags = ["-arch_only", archX86, "-syslibroot", sdkPath(iPhoneSim), linkFlags].flatten()
-IOS.iio.x86.lib = "javafx-iio-${archX86}"
+IOS.iio.x86.lib = "javafx_iio_${archX86}"
 
 IOS.prismES2 = [:]
-IOS.prismES2.lib = "prism-es2"
+IOS.prismES2.lib = "prism_es2"
 IOS.prismES2.javahInclude = ["com/sun/prism/es2/**/*"]
 IOS.prismES2.variants = ["arm", "x86"];
 
@@ -236,7 +236,7 @@
 IOS.prismES2.arm.ccFlags = ["-x", "objective-c", ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS)].flatten()
 IOS.prismES2.arm.linker = linker
 IOS.prismES2.arm.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags].flatten()
-IOS.prismES2.arm.lib = "prism-es2-${archArm}"
+IOS.prismES2.arm.lib = "prism_es2_${archArm}"
 
 IOS.prismES2.x86 = [:]
 IOS.prismES2.x86.nativeSource = [IOS.prismES2.arm.nativeSource].flatten()
@@ -244,11 +244,11 @@
 IOS.prismES2.x86.ccFlags = ["-x", "objective-c", ccFlags, "-arch", archX86, "-isysroot", sdkPath(iPhoneSim)].flatten()
 IOS.prismES2.x86.linker = linker
 IOS.prismES2.x86.linkFlags = ["-arch_only", archX86, "-syslibroot", sdkPath(iPhoneSim), linkFlags].flatten()
-IOS.prismES2.x86.lib = "prism-es2-${archX86}"
+IOS.prismES2.x86.lib = "prism_es2_${archX86}"
 
 def closedDir = file("$projectDir/../rt-closed")
 IOS.font = [:]
-IOS.font.lib = "javafx-font"
+IOS.font.lib = "javafx_font"
 IOS.font.javahInclude = [
         "com/sun/javafx/font/**/*",
         "com/sun/javafx/text/**/*"]
@@ -260,7 +260,7 @@
 IOS.font.arm.ccFlags = ["-DJFXFONT_PLUS", ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS)].flatten()
 IOS.font.arm.linker = linker
 IOS.font.arm.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags].flatten()
-IOS.font.arm.lib = "javafx-font-${archArm}"
+IOS.font.arm.lib = "javafx_font_${archArm}"
 
 IOS.font.x86 = [:]
 IOS.font.x86.nativeSource = [IOS.font.arm.nativeSource].flatten()
@@ -268,10 +268,10 @@
 IOS.font.x86.ccFlags = ["-DJFXFONT_PLUS", ccFlags, "-arch", archX86, "-isysroot", sdkPath(iPhoneSim)].flatten()
 IOS.font.x86.linker = linker
 IOS.font.x86.linkFlags = ["-arch_only", archX86, "-syslibroot", sdkPath(iPhoneSim), linkFlags].flatten()
-IOS.font.x86.lib = "javafx-font-${archX86}"
+IOS.font.x86.lib = "javafx_font_${archX86}"
 
 IOS.fontT2K = [:]
-IOS.fontT2K.lib = "javafx-font-t2k"
+IOS.fontT2K.lib = "javafx_font_t2k"
 IOS.fontT2K.javahInclude = ["com/sun/javafx/font/t2k/**/*"]
 IOS.fontT2K.variants = ["arm", "x86"];
 
@@ -284,7 +284,7 @@
 IOS.fontT2K.arm.ccFlags = ["-DJFXFONT_PLUS", ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS)].flatten()
 IOS.fontT2K.arm.linker = linker
 IOS.fontT2K.arm.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags].flatten()
-IOS.fontT2K.arm.lib = "javafx-font-t2k-${archArm}"
+IOS.fontT2K.arm.lib = "javafx_font_t2k_${archArm}"
 
 IOS.fontT2K.x86 = [:]
 IOS.fontT2K.x86.nativeSource = [IOS.fontT2K.arm.nativeSource].flatten()
@@ -292,10 +292,10 @@
 IOS.fontT2K.x86.ccFlags = ["-DJFXFONT_PLUS", ccFlags, "-arch", archX86, "-isysroot", sdkPath(iPhoneSim)].flatten()
 IOS.fontT2K.x86.linker = linker
 IOS.fontT2K.x86.linkFlags = ["-arch_only", archX86, "-syslibroot", sdkPath(iPhoneSim), linkFlags].flatten()
-IOS.fontT2K.x86.lib = "javafx-font-t2k-${archX86}"
+IOS.fontT2K.x86.lib = "javafx_font_t2k_${archX86}"
 
 IOS.webview = [:]
-IOS.webview.lib = "javafx-ios-webnode"
+IOS.webview.lib = "javafx_ios_webnode"
 IOS.webview.javahInclude = ["javafx/scene/web/*"]
 IOS.webview.variants = ["arm", "x86"];
 
@@ -305,7 +305,7 @@
 IOS.webview.arm.ccFlags = [ccFlags, "-arch", archArm, "-isysroot", sdkPath(iPhoneOS)].flatten()
 IOS.webview.arm.linker = linker
 IOS.webview.arm.linkFlags = ["-arch_only", archArm, "-syslibroot", sdkPath(iPhoneOS), linkFlags].flatten()
-IOS.webview.arm.lib = "javafx-ios-webnode-${archArm}"
+IOS.webview.arm.lib = "javafx_ios_webnode_${archArm}"
 
 IOS.webview.x86 = [:]
 IOS.webview.x86.nativeSource = [IOS.webview.arm.nativeSource].flatten()
@@ -313,7 +313,7 @@
 IOS.webview.x86.ccFlags = [ccFlags, "-arch", archX86, "-isysroot", sdkPath(iPhoneSim)].flatten()
 IOS.webview.x86.linker = linker
 IOS.webview.x86.linkFlags = ["-arch_only", archX86, "-syslibroot", sdkPath(iPhoneSim), linkFlags].flatten()
-IOS.webview.x86.lib = "javafx-ios-webnode-${archX86}"
+IOS.webview.x86.lib = "javafx_ios_webnode_${archX86}"
 
 project(":web") {
     if (BUILD_CLOSED) {
--- a/buildSrc/linux.gradle	Tue Jul 23 09:18:52 2013 -0700
+++ b/buildSrc/linux.gradle	Tue Jul 23 17:23:49 2013 -0700
@@ -150,7 +150,7 @@
 LINUX.decora.ccFlags = [ccFlags, "-ffast-math"].flatten()
 LINUX.decora.linker = linker
 LINUX.decora.linkFlags = [linkFlags].flatten()
-LINUX.decora.lib = "decora-sse"
+LINUX.decora.lib = "decora_sse"
 
 LINUX.prism = [:]
 LINUX.prism.javahInclude = ["com/sun/prism/impl/**/*", "com/sun/prism/PresentableState*"]
@@ -159,7 +159,7 @@
 LINUX.prism.ccFlags = [ccFlags, "-DINLINE=inline"].flatten()
 LINUX.prism.linker = linker
 LINUX.prism.linkFlags = [linkFlags].flatten()
-LINUX.prism.lib = "prism-common"
+LINUX.prism.lib = "prism_common"
 
 LINUX.prismSW = [:]
 LINUX.prismSW.javahInclude = ["com/sun/pisces/**/*"]
@@ -168,7 +168,7 @@
 LINUX.prismSW.ccFlags = [ccFlags, "-DINLINE=inline"].flatten()
 LINUX.prismSW.linker = linker
 LINUX.prismSW.linkFlags = [linkFlags].flatten()
-LINUX.prismSW.lib = "prism-sw"
+LINUX.prismSW.lib = "prism_sw"
 
 LINUX.launcher = [:]
 LINUX.launcher.compiler = compiler
@@ -185,7 +185,7 @@
 LINUX.iio.ccFlags = [ccFlags].flatten()
 LINUX.iio.linker = linker
 LINUX.iio.linkFlags = [linkFlags].flatten()
-LINUX.iio.lib = "javafx-iio"
+LINUX.iio.lib = "javafx_iio"
 
 LINUX.prismES2 = [:]
 LINUX.prismES2.javahInclude = ["com/sun/prism/es2/**/*"]
@@ -195,10 +195,10 @@
     file("modules/graphics/src/main/native-prism-es2/x11")
 ]
 LINUX.prismES2.compiler = compiler
-LINUX.prismES2.ccFlags = ["-DLINUX", "-DGRADLE_BUILD", ccFlags].flatten()
+LINUX.prismES2.ccFlags = ["-DLINUX", ccFlags].flatten()
 LINUX.prismES2.linker = linker
 LINUX.prismES2.linkFlags = [linkFlags, "-lX11", "-lXxf86vm", "-lGL"].flatten()
-LINUX.prismES2.lib = "prism-es2"
+LINUX.prismES2.lib = "prism_es2"
 
 def closedDir = file("$projectDir/../rt-closed")
 LINUX.font = [:]
@@ -210,7 +210,7 @@
 LINUX.font.ccFlags = ["-DJFXFONT_PLUS", ccFlags].flatten()
 LINUX.font.linker = linker
 LINUX.font.linkFlags = [linkFlags].flatten()
-LINUX.font.lib = "javafx-font"
+LINUX.font.lib = "javafx_font"
 
 LINUX.fontT2K = [:]
 LINUX.fontT2K.javahInclude = ["com/sun/javafx/font/t2k/**/*"]
@@ -222,7 +222,7 @@
 LINUX.fontT2K.ccFlags = ["-DJFXFONT_PLUS", ccFlags].flatten()
 LINUX.fontT2K.linker = linker
 LINUX.fontT2K.linkFlags = [linkFlags].flatten()
-LINUX.fontT2K.lib = "javafx-font-t2k"
+LINUX.fontT2K.lib = "javafx_font_t2k"
 
 LINUX.fontPango = [:]
 LINUX.fontPango.javahInclude = ["com/sun/javafx/font/pango/*"]
--- a/buildSrc/mac.gradle	Tue Jul 23 09:18:52 2013 -0700
+++ b/buildSrc/mac.gradle	Tue Jul 23 17:23:49 2013 -0700
@@ -118,7 +118,7 @@
 MAC.decora.linkFlags = ["-dynamiclib",
         "-mmacosx-version-min=$MACOSX_MIN_VERSION",
         "-arch", "x86_64"].flatten()
-MAC.decora.lib = "decora-sse"
+MAC.decora.lib = "decora_sse"
 
 MAC.prism = [:]
 MAC.prism.javahInclude = ["com/sun/prism/impl/**/*", "com/sun/prism/PresentableState*"]
@@ -133,7 +133,7 @@
 MAC.prism.linkFlags = ["-dynamiclib",
         "-mmacosx-version-min=$MACOSX_MIN_VERSION",
         "-arch", "x86_64"].flatten()
-MAC.prism.lib = "prism-common"
+MAC.prism.lib = "prism_common"
 
 MAC.prismSW = [:]
 MAC.prismSW.javahInclude = ["com/sun/pisces/**/*"]
@@ -142,7 +142,7 @@
 MAC.prismSW.ccFlags = [MAC.prism.ccFlags].flatten()
 MAC.prismSW.linker = linker
 MAC.prismSW.linkFlags = [MAC.prism.linkFlags].flatten()
-MAC.prismSW.lib = "prism-sw"
+MAC.prismSW.lib = "prism_sw"
 
 MAC.launcher = [:]
 MAC.launcher.compiler = compiler
@@ -159,7 +159,7 @@
 MAC.iio.ccFlags = [ccFlags].flatten()
 MAC.iio.linker = linker
 MAC.iio.linkFlags = [linkFlags].flatten()
-MAC.iio.lib = "javafx-iio"
+MAC.iio.lib = "javafx_iio"
 
 MAC.prismES2 = [:]
 MAC.prismES2.javahInclude = ["com/sun/prism/es2/**/*"]
@@ -169,10 +169,10 @@
     file("modules/graphics/src/main/native-prism-es2/macosx")
 ]
 MAC.prismES2.compiler = compiler
-MAC.prismES2.ccFlags = ["-DMACOSX", "-DGRADLE_BUILD", ccFlags].flatten()
+MAC.prismES2.ccFlags = ["-DMACOSX", ccFlags].flatten()
 MAC.prismES2.linker = linker
 MAC.prismES2.linkFlags = [linkFlags].flatten()
-MAC.prismES2.lib = "prism-es2"
+MAC.prismES2.lib = "prism_es2"
 
 def closedDir = file("$projectDir/../rt-closed")
 MAC.font = [:]
@@ -184,7 +184,7 @@
 MAC.font.ccFlags = ["-DJFXFONT_PLUS", ccFlags].flatten()
 MAC.font.linker = linker
 MAC.font.linkFlags = [linkFlags].flatten()
-MAC.font.lib = "javafx-font"
+MAC.font.lib = "javafx_font"
 
 MAC.fontT2K = [:]
 MAC.fontT2K.javahInclude = ["com/sun/javafx/font/t2k/**/*"]
@@ -196,4 +196,4 @@
 MAC.fontT2K.ccFlags = ["-DJFXFONT_PLUS", ccFlags].flatten()
 MAC.fontT2K.linker = linker
 MAC.fontT2K.linkFlags = [linkFlags].flatten()
-MAC.fontT2K.lib = "javafx-font-t2k"
+MAC.fontT2K.lib = "javafx_font_t2k"
--- a/buildSrc/win.gradle	Tue Jul 23 09:18:52 2013 -0700
+++ b/buildSrc/win.gradle	Tue Jul 23 17:23:49 2013 -0700
@@ -157,7 +157,7 @@
 WIN.decora.ccFlags = [ccFlags].flatten()
 WIN.decora.linker = linker
 WIN.decora.linkFlags = [linkFlags].flatten()
-WIN.decora.lib = "decora-sse"
+WIN.decora.lib = "decora_sse"
 
 WIN.prism = [:]
 WIN.prism.javahInclude = ["com/sun/prism/impl/**/*", "com/sun/prism/PresentableState*"]
@@ -166,7 +166,7 @@
 WIN.prism.ccFlags = [ccFlags].flatten()
 WIN.prism.linker = linker
 WIN.prism.linkFlags = [linkFlags].flatten()
-WIN.prism.lib = "prism-common"
+WIN.prism.lib = "prism_common"
 
 WIN.prismSW = [:]
 WIN.prismSW.javahInclude = ["com/sun/pisces/**/*"]
@@ -175,7 +175,7 @@
 WIN.prismSW.ccFlags = [ccFlags].flatten()
 WIN.prismSW.linker = linker
 WIN.prismSW.linkFlags = [linkFlags].flatten()
-WIN.prismSW.lib = "prism-sw"
+WIN.prismSW.lib = "prism_sw"
 
 WIN.prismD3D = [:]
 WIN.prismD3D.javahInclude = ["com/sun/prism/d3d/**/*"]
@@ -186,7 +186,7 @@
 WIN.prismD3D.ccFlags = [ccFlags, "/Ibuild/headers/PrismD3D"].flatten()
 WIN.prismD3D.linker = linker
 WIN.prismD3D.linkFlags = [linkFlags, "user32.lib"].flatten()
-WIN.prismD3D.lib = "prism-d3d"
+WIN.prismD3D.lib = "prism_d3d"
 
 WIN.launcher = [:]
 WIN.launcher.compiler = compiler
@@ -223,7 +223,7 @@
 WIN.iio.ccFlags = [ccFlags].flatten()
 WIN.iio.linker = linker
 WIN.iio.linkFlags = [linkFlags].flatten()
-WIN.iio.lib = "javafx-iio"
+WIN.iio.lib = "javafx_iio"
 
 WIN.prismES2 = [:]
 WIN.prismES2.javahInclude = ["com/sun/prism/es2/**/*"]
@@ -233,10 +233,10 @@
     file("modules/graphics/src/main/native-prism-es2/windows")
 ]
 WIN.prismES2.compiler = compiler
-WIN.prismES2.ccFlags = ["/Ob1", "/GF", "/Gy", "/GS", "/DWIN32", "/DGRADLE_BUILD", ccFlags].flatten()
+WIN.prismES2.ccFlags = ["/Ob1", "/GF", "/Gy", "/GS", "/DWIN32", ccFlags].flatten()
 WIN.prismES2.linker = linker
 WIN.prismES2.linkFlags = [linkFlags, "/SUBSYSTEM:WINDOWS", "opengl32.lib", "gdi32.lib", "user32.lib", "kernel32.lib"].flatten()
-WIN.prismES2.lib = "prism-es2"
+WIN.prismES2.lib = "prism_es2"
 
 def closedDir = file("$projectDir/../rt-closed")
 WIN.font = [:]
@@ -249,7 +249,7 @@
 WIN.font.ccFlags -= ["/DUNICODE", "/D_UNICODE"]
 WIN.font.linker = linker
 WIN.font.linkFlags = [linkFlags, "advapi32.lib", "gdi32.lib", "user32.lib", "dwrite.lib", "d2d1.lib", "windowscodecs.lib", "ole32.lib"].flatten()
-WIN.font.lib = "javafx-font"
+WIN.font.lib = "javafx_font"
 
 WIN.fontT2K = [:]
 WIN.fontT2K.javahInclude = ["com/sun/javafx/font/t2k/**/*"]
@@ -261,4 +261,4 @@
 WIN.fontT2K.ccFlags = ["/DJFXFONT_PLUS", ccFlags].flatten()
 WIN.fontT2K.linker = linker
 WIN.fontT2K.linkFlags = [linkFlags, "advapi32.lib", "gdi32.lib", "user32.lib"].flatten()
-WIN.fontT2K.lib = "javafx-font-t2k"
+WIN.fontT2K.lib = "javafx_font_t2k"
--- a/buildSrc/x86egl.gradle	Tue Jul 23 09:18:52 2013 -0700
+++ b/buildSrc/x86egl.gradle	Tue Jul 23 17:23:49 2013 -0700
@@ -103,10 +103,10 @@
 def iioCFlags = [extraCFlags].flatten()
 def iioLFlags = [extraLFlags].flatten()
 
-def es2EglfbCFlags = [extraCFlags, "-DIS_EGLFB", "-DLINUX", "-DGRADLE_BUILD"].flatten()
+def es2EglfbCFlags = [extraCFlags, "-DIS_EGLFB", "-DLINUX"].flatten()
 def es2EglfbLFlags = [extraLFlags].flatten()
 
-def es2X11CFlags = [extraCFlags, "-DUSE_XSHM", "-DDEBUG", "-DIS_EGLX11", "-DLINUX", "-DGRADLE_BUILD"].flatten()
+def es2X11CFlags = [extraCFlags, "-DUSE_XSHM", "-DDEBUG", "-DIS_EGLX11", "-DLINUX"].flatten()
 def es2X11LFlags = [extraLFlags, "-lX11", "-lXext", "-lXdmcp", "-lXau"].flatten()
 
 def mediaCFlags = [extraCFlags,
@@ -232,10 +232,10 @@
     file("modules/graphics/src/main/native-glass/lens/wm/screen/x11ContainerScreen.c")]
     //file("modules/graphics/src/main/native-glass/lens/wm/screen")]
 X86EGL.glass.eglfb.compiler = compiler
-X86EGL.glass.eglfb.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DGRADLE_BUILD"].flatten()
+X86EGL.glass.eglfb.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX"].flatten()
 X86EGL.glass.eglfb.linker = linker
 X86EGL.glass.eglfb.linkFlags = [lensLFlags].flatten()
-X86EGL.glass.eglfb.lib = "glass-lens-eglfb"
+X86EGL.glass.eglfb.lib = "glass_lens_eglfb"
 
 X86EGL.glass.directfb = [:]
 X86EGL.glass.directfb.nativeSource = [
@@ -246,10 +246,10 @@
     file("modules/graphics/src/main/native-glass/lens/wm/screen/dfbScreen.c")]
     //file("modules/graphics/src/main/native-glass/lens/wm/screen")]
 X86EGL.glass.directfb.compiler = compiler
-X86EGL.glass.directfb.ccFlags = ["-ffast-math", extraCFlags, "-I/usr/include/directfb", "-DLINUX", "-DGRADLE_BUILD"].flatten()
+X86EGL.glass.directfb.ccFlags = ["-ffast-math", extraCFlags, "-I/usr/include/directfb", "-DLINUX"].flatten()
 X86EGL.glass.directfb.linker = linker
 X86EGL.glass.directfb.linkFlags = [lensLFlags].flatten()
-X86EGL.glass.directfb.lib = "glass-lens-dfb"
+X86EGL.glass.directfb.lib = "glass_lens_dfb"
 
 X86EGL.glass.fb = [:]
 X86EGL.glass.fb.nativeSource = [
@@ -260,10 +260,10 @@
     file("modules/graphics/src/main/native-glass/lens/wm/screen/fbdevScreen.c")]
     //file("modules/graphics/src/main/native-glass/lens/wm/screen")]
 X86EGL.glass.fb.compiler = compiler
-X86EGL.glass.fb.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DGRADLE_BUILD"].flatten()
+X86EGL.glass.fb.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX"].flatten()
 X86EGL.glass.fb.linker = linker
 X86EGL.glass.fb.linkFlags = [lensLFlags].flatten()
-X86EGL.glass.fb.lib = "glass-lens-fb"
+X86EGL.glass.fb.lib = "glass_lens_fb"
 
 X86EGL.glass.eglx11 = [:]
 X86EGL.glass.eglx11.nativeSource = [
@@ -274,17 +274,17 @@
     file("modules/graphics/src/main/native-glass/lens/wm/screen/x11ContainerScreen.c")]
     //file("modules/graphics/src/main/native-glass/lens/wm/screen")]
 X86EGL.glass.eglx11.compiler = compiler
-X86EGL.glass.eglx11.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DGRADLE_BUILD"].flatten()
+X86EGL.glass.eglx11.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX"].flatten()
 X86EGL.glass.eglx11.linker = linker
 X86EGL.glass.eglx11.linkFlags = [lensLFlags].flatten()
-X86EGL.glass.eglx11.lib = "glass-lens-eglx11"
+X86EGL.glass.eglx11.lib = "glass_lens_eglx11"
 
 X86EGL.glass.gtk = [:]
 X86EGL.glass.gtk.nativeSource = [
     file("modules/graphics/src/main/native-glass/lens"),
     file("modules/graphics/src/main/native-glass/lens/wm")]
 X86EGL.glass.gtk.compiler = compiler
-X86EGL.glass.gtk.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX", "-DGRADLE_BUILD"].flatten()
+X86EGL.glass.gtk.ccFlags = ["-ffast-math", extraCFlags, "-DLINUX"].flatten()
 X86EGL.glass.gtk.linker = linker
 X86EGL.glass.gtk.linkFlags = [lensLFlags, "-lstdc++"].flatten()
 X86EGL.glass.gtk.lib = "glass"
@@ -294,7 +294,7 @@
 X86EGL.decora.ccFlags = extraCFlags
 X86EGL.decora.linker = linker
 X86EGL.decora.linkFlags = extraLFlags
-X86EGL.decora.lib = "decora-sse"
+X86EGL.decora.lib = "decora_sse"
 
 X86EGL.prism = [:]
 X86EGL.prism.javahInclude = ["com/sun/prism/impl/**/*", "com/sun/prism/PresentableState*"]
@@ -303,7 +303,7 @@
 X86EGL.prism.ccFlags = [extraCFlags].flatten()
 X86EGL.prism.linker = linker
 X86EGL.prism.linkFlags = [extraLFlags, "-lX11", "-lXext", "-lXdmcp", "-lXau"].flatten()
-X86EGL.prism.lib = "prism-common"
+X86EGL.prism.lib = "prism_common"
 
 X86EGL.prismSW = [:]
 X86EGL.prismSW.javahInclude = ["com/sun/pisces/**/*"]
@@ -312,7 +312,7 @@
 X86EGL.prismSW.ccFlags = [extraCFlags].flatten()
 X86EGL.prismSW.linker = linker
 X86EGL.prismSW.linkFlags = [extraLFlags].flatten()
-X86EGL.prismSW.lib = "prism-sw"
+X86EGL.prismSW.lib = "prism_sw"
 
 X86EGL.iio = [:]
 X86EGL.iio.javahInclude = ["com/sun/javafx/iio/**/*"]
@@ -323,7 +323,7 @@
 X86EGL.iio.ccFlags = iioCFlags
 X86EGL.iio.linker = linker
 X86EGL.iio.linkFlags = iioLFlags
-X86EGL.iio.lib = "javafx-iio"
+X86EGL.iio.lib = "javafx_iio"
 
 X86EGL.prismES2 = [:]
 X86EGL.prismES2.variants = ["eglfb", "eglx11"]
@@ -339,7 +339,7 @@
 X86EGL.prismES2.eglfb.ccFlags = es2EglfbCFlags
 X86EGL.prismES2.eglfb.linker = linker
 X86EGL.prismES2.eglfb.linkFlags = es2EglfbLFlags
-X86EGL.prismES2.eglfb.lib = "prism-es2-eglfb"
+X86EGL.prismES2.eglfb.lib = "prism_es2_eglfb"
 
 X86EGL.prismES2.eglx11 = [:]
 X86EGL.prismES2.eglx11.nativeSource = [
@@ -351,7 +351,7 @@
 X86EGL.prismES2.eglx11.ccFlags = es2X11CFlags
 X86EGL.prismES2.eglx11.linker = linker
 X86EGL.prismES2.eglx11.linkFlags = es2X11LFlags
-X86EGL.prismES2.eglx11.lib = "prism-es2-eglx11"
+X86EGL.prismES2.eglx11.lib = "prism_es2_eglx11"
 
 def closedDir = file("$projectDir/../rt-closed")
 X86EGL.font = [:]
@@ -363,7 +363,7 @@
 X86EGL.font.ccFlags = fontCFlags
 X86EGL.font.linker = linker
 X86EGL.font.linkFlags = fontLFlags
-X86EGL.font.lib = "javafx-font"
+X86EGL.font.lib = "javafx_font"
 
 X86EGL.fontT2K = [:]
 X86EGL.fontT2K.javahInclude = ["com/sun/javafx/font/t2k/**/*"]
@@ -375,7 +375,7 @@
 X86EGL.fontT2K.ccFlags = fontCFlags
 X86EGL.fontT2K.linker = linker
 X86EGL.fontT2K.linkFlags = fontLFlags
-X86EGL.fontT2K.lib = "javafx-font-t2k"
+X86EGL.fontT2K.lib = "javafx_font_t2k"
 
 X86EGL.fontPango = [:]
 X86EGL.fontPango.javahInclude = ["com/sun/javafx/font/pango/*"]
@@ -386,4 +386,4 @@
 X86EGL.fontPango.ccFlags = ["-DJFXFONT_PLUS", ccFlags, pangoCCFlags].flatten()
 X86EGL.fontPango.linker = linker
 X86EGL.fontPango.linkFlags = [linkFlags, pangoLinkFlags].flatten()
-X86EGL.fontPango.lib = "javafx-font-pango"
+X86EGL.fontPango.lib = "javafx_font_pango"
--- a/gradle.properties.template	Tue Jul 23 09:18:52 2013 -0700
+++ b/gradle.properties.template	Tue Jul 23 17:23:49 2013 -0700
@@ -137,6 +137,11 @@
 
 #LINT = all
 
+# The following flag specifies whether to generate code coverage
+# statistics when running tests
+
+#JCOV = true
+
 # Define the number of threads to use when compiling native code. This value must be
 # > 0, or the build system will default to 1. If not specified, the number of compile
 # threads is determined based on the number of CPU cores on the machine. If this value
--- a/modules/base/src/main/java/javafx/beans/InvalidationListener.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/base/src/main/java/javafx/beans/InvalidationListener.java	Tue Jul 23 17:23:49 2013 -0700
@@ -45,6 +45,7 @@
  *
  * @since JavaFX 2.0
  */
+@FunctionalInterface
 public interface InvalidationListener {
 
     /**
--- a/modules/base/src/main/java/javafx/beans/value/ChangeListener.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/base/src/main/java/javafx/beans/value/ChangeListener.java	Tue Jul 23 17:23:49 2013 -0700
@@ -36,12 +36,13 @@
  * <p>
  * The same instance of {@code ChangeListener} can be registered to listen to
  * multiple {@code ObservableValues}.
- * 
+ *
  * @see ObservableValue
- * 
- * 
+ *
+ *
  * @since JavaFX 2.0
  */
+@FunctionalInterface
 public interface ChangeListener<T> {
 
     /**
@@ -51,7 +52,7 @@
      * <p>
      * In general is is considered bad practice to modify the observed value in
      * this method.
-     * 
+     *
      * @param observable
      *            The {@code ObservableValue} which value changed
      * @param oldValue
--- a/modules/base/src/main/java/javafx/collections/ListChangeBuilder.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/base/src/main/java/javafx/collections/ListChangeBuilder.java	Tue Jul 23 17:23:49 2013 -0700
@@ -615,7 +615,7 @@
 
         private void checkState() {
             if (!onChange) {
-                throw new IllegalStateException();
+                throw new IllegalStateException("Invalid Change state: next() must be called before inspecting the Change.");
             }
         }
 
--- a/modules/base/src/main/java/javafx/collections/ListChangeListener.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/base/src/main/java/javafx/collections/ListChangeListener.java	Tue Jul 23 17:23:49 2013 -0700
@@ -35,6 +35,7 @@
  * @see Change
  * @since JavaFX 2.0
  */
+@FunctionalInterface
 public interface ListChangeListener<E> {
 
     /**
@@ -60,6 +61,10 @@
      * All elements between {@link #getFrom() from}(inclusive) and {@link #getTo() to}(exclusive) were updated.
      * </ul>
      *
+     * <b>Important:</b> It's necessary to call {@link #next()} method before calling
+     * any other method of {@code Change}. The same applies after calling {@link #reset()}.
+     * The only methods that works at any time is {@link #getList()}.
+     *
      *<p>
      * Typical usage is to observe changes on an ObservableList in order
      * to hook or unhook (or add or remove a listener) or in order to maintain
--- a/modules/base/src/main/java/javafx/collections/MapChangeListener.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/base/src/main/java/javafx/collections/MapChangeListener.java	Tue Jul 23 17:23:49 2013 -0700
@@ -31,6 +31,7 @@
  * @param <V> the value element type
  * @since JavaFX 2.0
  */
+@FunctionalInterface
 public interface MapChangeListener<K, V> {
 
     /**
--- a/modules/base/src/main/java/javafx/collections/SetChangeListener.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/base/src/main/java/javafx/collections/SetChangeListener.java	Tue Jul 23 17:23:49 2013 -0700
@@ -30,6 +30,7 @@
  * @param <E> the element type
  * @since JavaFX 2.1
  */
+@FunctionalInterface
 public interface SetChangeListener<E> {
 
     /**
--- a/modules/base/src/main/java/javafx/event/EventHandler.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/base/src/main/java/javafx/event/EventHandler.java	Tue Jul 23 17:23:49 2013 -0700
@@ -34,6 +34,7 @@
  * @param <T> the event class this handler can handle
  * @since JavaFX 2.0
  */
+@FunctionalInterface
 public interface EventHandler<T extends Event> extends EventListener {
     /**
      * Invoked when a specific event of the type for which this handler is
--- a/modules/base/src/main/java/javafx/util/Builder.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/base/src/main/java/javafx/util/Builder.java	Tue Jul 23 17:23:49 2013 -0700
@@ -31,6 +31,7 @@
  *
  * @since JavaFX 2.0
  */
+@FunctionalInterface
 public interface Builder<T> {
     /**
      * Builds and returns the object.
--- a/modules/base/src/main/java/javafx/util/BuilderFactory.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/base/src/main/java/javafx/util/BuilderFactory.java	Tue Jul 23 17:23:49 2013 -0700
@@ -31,6 +31,7 @@
  *
  * @since JavaFX 2.0
  */
+@FunctionalInterface
 public interface BuilderFactory {
     /**
      * Returns a builder suitable for constructing instances of the given type.
--- a/modules/base/src/main/java/javafx/util/Callback.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/base/src/main/java/javafx/util/Callback.java	Tue Jul 23 17:23:49 2013 -0700
@@ -29,20 +29,21 @@
  * The Callback interface is designed to allow for a common, reusable interface
  * to exist for defining APIs that requires a call back in certain situations.
  * <p>
- * Callback is defined with two generic parameters: the first parameter 
- * specifies the type of the object passed in to the <code>call</code> method, 
+ * Callback is defined with two generic parameters: the first parameter
+ * specifies the type of the object passed in to the <code>call</code> method,
  * with the second parameter specifying the return type of the method.
- * 
+ *
  * @param <P> The type of the argument provided to the <code>call</code> method.
  * @param <R> The type of the return type of the <code>call</code> method.
  * @since JavaFX 2.0
  */
+@FunctionalInterface
 public interface Callback<P,R> {
     /**
-     * The <code>call</code> method is called when required, and is given a 
+     * The <code>call</code> method is called when required, and is given a
      * single argument of type P, with a requirement that an object of type R
      * is returned.
-     * 
+     *
      * @param param The single argument upon which the returned value should be
      *      determined.
      * @return An object of type R that may be determined based on the provided
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/FXVKSkin.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/FXVKSkin.java	Tue Jul 23 17:23:49 2013 -0700
@@ -596,20 +596,31 @@
             text.setText(this.chars);
             altText.setText(this.altChars);
 
-            if (fxvk != secondaryVK) {
-                setOnMousePressed(new EventHandler<MouseEvent>() {
-                    @Override public void handle(MouseEvent event) {
-                        showSecondaryVK(null);
-                        secondaryVKKey = CharKey.this;
-                        secondaryVKDelay.playFromStart();
-                    }
-                });
+            handleSecondaryVK(letter, alt, moreChars);
+        }
 
-                setOnMouseReleased(new EventHandler<MouseEvent>() {
-                    @Override public void handle(MouseEvent event) {
-                        secondaryVKDelay.stop();
-                    }
-                });
+
+        private void handleSecondaryVK(String letter, String alt, String[] moreChars) {
+            // If key has only one char (alternative char is the same, and it has no more chars),
+            // secondaryVK will not pop-up
+            if (letter.equals(alt) && moreChars == null) {
+                return;
+            } else {
+                if (fxvk != secondaryVK) {
+                    setOnMousePressed(new EventHandler<MouseEvent>() {
+                        @Override public void handle(MouseEvent event) {
+                            showSecondaryVK(null);
+                            secondaryVKKey = CharKey.this;
+                            secondaryVKDelay.playFromStart();
+                        }
+                    });
+
+                    setOnMouseReleased(new EventHandler<MouseEvent>() {
+                        @Override public void handle(MouseEvent event) {
+                            secondaryVKDelay.stop();
+                        }
+                    });
+                }
             }
         }
 
--- a/modules/controls/src/main/java/javafx/scene/chart/PieChart.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/controls/src/main/java/javafx/scene/chart/PieChart.java	Tue Jul 23 17:23:49 2013 -0700
@@ -336,12 +336,6 @@
 
     // -------------- METHODS --------------------------------------------------
 
-    @Override public void requestLayout() {
-        super.requestLayout();
-        // RT-22986 PieChart legend resize issue
-        if (legend != null) legend.requestLayout();
-    }
-    
     private void dataNameChanged(Data item) {
         item.textNode.setText(item.getName());
         requestChartLayout();
@@ -358,7 +352,7 @@
             );
         } else {
             item.setCurrentPieValue(item.getPieValue());
-            requestChartLayout(); // RT-23091 
+            requestChartLayout(); // RT-23091
         }
     }
 
@@ -442,7 +436,7 @@
             if(ptr != null) ptr.next = item.next;
         }
     }
-    
+
     private Timeline createDataRemoveTimeline(final Data item) {
         final Node shape = item.getNode();
         Timeline t = new Timeline();
@@ -583,7 +577,7 @@
                 if (shouldShowLabels) {
                     double size = (isClockwise()) ? (-scale * Math.abs(item.getCurrentPieValue())) : (scale * Math.abs(item.getCurrentPieValue()));
                     final boolean isLeftSide = !(labelAngles[index] > -90 && labelAngles[index] < 90);
-                    
+
                     double sliceCenterEdgeX = calcX(labelAngles[index], pieRadius, centerX);
                     double sliceCenterEdgeY = calcY(labelAngles[index], pieRadius, centerY);
                     double xval = isLeftSide ?
@@ -859,7 +853,7 @@
         private double getRadiusMultiplier() { return radiusMultiplier.getValue(); }
         private void setRadiusMultiplier(double value) { radiusMultiplier.setValue(value); }
         private DoubleProperty radiusMultiplierProperty() { return radiusMultiplier; }
-        
+
         /**
          * Readonly access to the node that represents the pie slice. You can use this to add mouse event listeners etc.
          */
@@ -867,7 +861,7 @@
         public Node getNode() { return node.getValue(); }
         private void setNode(Node value) { node.setValue(value); }
         private ObjectProperty<Node> nodeProperty() { return node; }
-         
+
         // -------------- CONSTRUCTOR -------------------------------------------------
 
         /**
@@ -887,20 +881,20 @@
         /**
          * Returns a string representation of this {@code Data} object.
          * @return a string representation of this {@code Data} object.
-         */ 
+         */
         @Override public java.lang.String toString() {
             return "Data["+getName()+","+getPieValue()+"]";
         }
     }
 
     // -------------- STYLESHEET HANDLING --------------------------------------
-    
+
     /**
       * Super-lazy instantiation pattern from Bill Pugh.
       * @treatAsPrivate implementation detail
       */
      private static class StyleableProperties {
-         private static final CssMetaData<PieChart,Boolean> CLOCKWISE = 
+         private static final CssMetaData<PieChart,Boolean> CLOCKWISE =
              new CssMetaData<PieChart,Boolean>("-fx-clockwise",
                  BooleanConverter.getInstance(), Boolean.TRUE) {
 
@@ -914,8 +908,8 @@
                 return (StyleableProperty<Boolean>)node.clockwiseProperty();
             }
         };
-         
-         private static final CssMetaData<PieChart,Boolean> LABELS_VISIBLE = 
+
+         private static final CssMetaData<PieChart,Boolean> LABELS_VISIBLE =
              new CssMetaData<PieChart,Boolean>("-fx-pie-label-visible",
                  BooleanConverter.getInstance(), Boolean.TRUE) {
 
@@ -929,8 +923,8 @@
                 return (StyleableProperty<Boolean>)node.labelsVisibleProperty();
             }
         };
-         
-         private static final CssMetaData<PieChart,Number> LABEL_LINE_LENGTH = 
+
+         private static final CssMetaData<PieChart,Number> LABEL_LINE_LENGTH =
              new CssMetaData<PieChart,Number>("-fx-label-line-length",
                  SizeConverter.getInstance(), 20d) {
 
@@ -944,8 +938,8 @@
                 return (StyleableProperty<Number>)node.labelLineLengthProperty();
             }
         };
-         
-         private static final CssMetaData<PieChart,Number> START_ANGLE = 
+
+         private static final CssMetaData<PieChart,Number> START_ANGLE =
              new CssMetaData<PieChart,Number>("-fx-start-angle",
                  SizeConverter.getInstance(), 0d) {
 
--- a/modules/controls/src/main/java/javafx/scene/chart/XYChart.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/controls/src/main/java/javafx/scene/chart/XYChart.java	Tue Jul 23 17:23:49 2013 -0700
@@ -72,10 +72,10 @@
  * Chart base class for all 2 axis charts. It is responsible for drawing the two
  * axes and the plot content. It contains a list of all content in the plot and
  * implementations of XYChart can add nodes to this list that need to be rendered.
- * 
- * <p>It is possible to install Tooltips on data items / symbols. 
+ *
+ * <p>It is possible to install Tooltips on data items / symbols.
  * For example the following code snippet installs Tooltip on the 1st data item.
- * 
+ *
  * <pre><code>
  *  XYChart.Data item = ( XYChart.Data)series.getData().get(0);
  *  Tooltip.install(item.getNode(), new Tooltip("Symbol-0"));
@@ -88,7 +88,7 @@
     // -------------- PRIVATE FIELDS -----------------------------------------------------------------------------------
 
     // to indicate which colors are being used for the series
-    BitSet colorBits = new BitSet(8); 
+    BitSet colorBits = new BitSet(8);
     static String DEFAULT_COLOR = "default-color";
     Map<Series, Integer> seriesColorMap = new HashMap<Series, Integer>();
     private boolean rangeValid = false;
@@ -167,7 +167,7 @@
             requestChartLayout();
         }
     };
-    
+
     // -------------- PUBLIC PROPERTIES --------------------------------------------------------------------------------
 
     private final Axis<X> xAxis;
@@ -188,8 +188,8 @@
             if(old != null) {
                 old.removeListener(seriesChanged);
                 // Set animated to false so we don't animate both remove and add
-                // at the same time. RT-14163 
-                // RT-21295 - disable animated only when current is also not null. 
+                // at the same time. RT-14163
+                // RT-21295 - disable animated only when current is also not null.
                 if (current != null && old.size() > 0) {
                     saveAnimationState = (old.get(0).getChart().getAnimated()) ? 1 : 2;
                     old.get(0).getChart().setAnimated(false);
@@ -237,7 +237,7 @@
     public final void setData(ObservableList<Series<X,Y>> value) { data.setValue(value); }
     public final ObjectProperty<ObservableList<Series<X,Y>>> dataProperty() { return data; }
 
-    /** True if vertical grid lines should be drawn */ 
+    /** True if vertical grid lines should be drawn */
     private BooleanProperty verticalGridLinesVisible = new StyleableBooleanProperty(true) {
         @Override protected void invalidated() {
             requestChartLayout();
@@ -283,11 +283,11 @@
         public String getName() {
             return "horizontalGridLinesVisible";
         }
-        
+
         @Override
         public CssMetaData<XYChart<?,?>,Boolean> getCssMetaData() {
             return StyleableProperties.HORIZONTAL_GRID_LINE_VISIBLE;
-        }        
+        }
     };
     public final boolean isHorizontalGridLinesVisible() { return horizontalGridLinesVisible.get(); }
     public final void setHorizontalGridLinesVisible(boolean value) { horizontalGridLinesVisible.set(value); }
@@ -312,7 +312,7 @@
         @Override
         public CssMetaData<XYChart<?,?>,Boolean> getCssMetaData() {
             return StyleableProperties.ALTERNATIVE_COLUMN_FILL_VISIBLE;
-        }        
+        }
     };
     public final boolean isAlternativeColumnFillVisible() { return alternativeColumnFillVisible.getValue(); }
     public final void setAlternativeColumnFillVisible(boolean value) { alternativeColumnFillVisible.setValue(value); }
@@ -337,7 +337,7 @@
         @Override
         public CssMetaData<XYChart<?,?>,Boolean> getCssMetaData() {
             return StyleableProperties.ALTERNATIVE_ROW_FILL_VISIBLE;
-        }                
+        }
     };
     public final boolean isAlternativeRowFillVisible() { return alternativeRowFillVisible.getValue(); }
     public final void setAlternativeRowFillVisible(boolean value) { alternativeRowFillVisible.setValue(value); }
@@ -367,7 +367,7 @@
         @Override
         public CssMetaData<XYChart<?,?>,Boolean> getCssMetaData() {
             return StyleableProperties.VERTICAL_ZERO_LINE_VISIBLE;
-        }                
+        }
     };
     public final boolean isVerticalZeroLineVisible() { return verticalZeroLineVisible.get(); }
     public final void setVerticalZeroLineVisible(boolean value) { verticalZeroLineVisible.set(value); }
@@ -397,7 +397,7 @@
         @Override
         public CssMetaData<XYChart<?,?>,Boolean> getCssMetaData() {
             return StyleableProperties.HORIZONTAL_ZERO_LINE_VISIBLE;
-        }                
+        }
     };
     public final boolean isHorizontalZeroLineVisible() { return horizontalZeroLineVisible.get(); }
     public final void setHorizontalZeroLineVisible(boolean value) { horizontalZeroLineVisible.set(value); }
@@ -478,15 +478,6 @@
 
     // -------------- METHODS ------------------------------------------------------------------------------------------
 
-    @Override public void requestLayout() {
-        super.requestLayout();
-        // RT-22726 Charts legend does not resize correctly
-        Node legend = getLegend();
-        if (legend != null && legend instanceof Region) {
-            ((Region)legend).requestLayout();
-        }
-    }
-    
     /**
      * Gets the size of the data returning 0 if the data is null
      *
@@ -585,7 +576,7 @@
     protected abstract void dataItemRemoved(Data<X, Y> item, Series<X, Y> series);
 
     /**
-     * Called when a data item has changed, ie its xValue, yValue or extraValue has changed. 
+     * Called when a data item has changed, ie its xValue, yValue or extraValue has changed.
      *
      * @param item    The data item who was changed
      */
@@ -764,7 +755,7 @@
         if(getVerticalGridLinesVisible()) {
             for(int i=0; i < xaTickMarks.size(); i++) {
                 Axis.TickMark<X> tick = xaTickMarks.get(i);
-                double pixelOffset = (i==(xaTickMarks.size()-1)) ? -0.5 : 0.5; 
+                double pixelOffset = (i==(xaTickMarks.size()-1)) ? -0.5 : 0.5;
                 final double x = xa.getDisplayPosition(tick.getValue());
                 if ((x!=xAxisZero || !isVerticalZeroLineVisible()) && x > 0 && x <= xAxisWidth) {
                     verticalGridLines.getElements().add(new MoveTo(left+x+pixelOffset,top));
@@ -907,7 +898,7 @@
         }
         return count;
     }
-    
+
     /**
      * This should be called from seriesRemoved() when you are finished with any animation for deleting the series from
      * the chart. It will remove the series from showing up in the Iterator returned by getDisplayedSeriesIterator().
@@ -989,7 +980,7 @@
      * to animate when data is added or removed.
      */
     protected final Y getCurrentDisplayedYValue(Data<X,Y> item) { return item.getCurrentY(); }
-    
+
     /**
      * Set the current displayed data value plotted on Y axis.
      *
@@ -1092,7 +1083,7 @@
                 return (StyleableProperty<Boolean>)node.horizontalGridLinesVisibleProperty();
             }
         };
-        
+
         private static final CssMetaData<XYChart<?,?>,Boolean> HORIZONTAL_ZERO_LINE_VISIBLE =
             new CssMetaData<XYChart<?,?>,Boolean>("-fx-horizontal-zero-line-visible",
                 BooleanConverter.getInstance(), Boolean.TRUE) {
@@ -1108,7 +1099,7 @@
                 return (StyleableProperty<Boolean>)node.horizontalZeroLineVisibleProperty();
             }
         };
-        
+
         private static final CssMetaData<XYChart<?,?>,Boolean> ALTERNATIVE_ROW_FILL_VISIBLE =
             new CssMetaData<XYChart<?,?>,Boolean>("-fx-alternative-row-fill-visible",
                 BooleanConverter.getInstance(), Boolean.TRUE) {
@@ -1124,7 +1115,7 @@
                 return (StyleableProperty<Boolean>)node.alternativeRowFillVisibleProperty();
             }
         };
-        
+
         private static final CssMetaData<XYChart<?,?>,Boolean> VERTICAL_GRID_LINE_VISIBLE =
             new CssMetaData<XYChart<?,?>,Boolean>("-fx-vertical-grid-lines-visible",
                 BooleanConverter.getInstance(), Boolean.TRUE) {
@@ -1140,7 +1131,7 @@
                 return (StyleableProperty<Boolean>)node.verticalGridLinesVisibleProperty();
             }
         };
-        
+
         private static final CssMetaData<XYChart<?,?>,Boolean> VERTICAL_ZERO_LINE_VISIBLE =
             new CssMetaData<XYChart<?,?>,Boolean>("-fx-vertical-zero-line-visible",
                 BooleanConverter.getInstance(), Boolean.TRUE) {
@@ -1156,7 +1147,7 @@
                 return (StyleableProperty<Boolean>)node.verticalZeroLineVisibleProperty();
             }
         };
-        
+
         private static final CssMetaData<XYChart<?,?>,Boolean> ALTERNATIVE_COLUMN_FILL_VISIBLE =
             new CssMetaData<XYChart<?,?>,Boolean>("-fx-alternative-column-fill-visible",
                 BooleanConverter.getInstance(), Boolean.TRUE) {
@@ -1175,7 +1166,7 @@
 
         private static final List<CssMetaData<? extends Styleable, ?>> STYLEABLES;
         static {
-            final List<CssMetaData<? extends Styleable, ?>> styleables = 
+            final List<CssMetaData<? extends Styleable, ?>> styleables =
                 new ArrayList<CssMetaData<? extends Styleable, ?>>(Chart.getClassCssMetaData());
             styleables.add(HORIZONTAL_GRID_LINE_VISIBLE);
             styleables.add(HORIZONTAL_ZERO_LINE_VISIBLE);
@@ -1186,7 +1177,7 @@
             STYLEABLES = Collections.unmodifiableList(styleables);
         }
     }
- 
+
     /**
      * @return The CssMetaData associated with this class, which may include the
      * CssMetaData of its super classes.
@@ -1262,9 +1253,9 @@
             if (currentX.get() == null ||
                     (series != null && series.getChart() == null)) currentX.setValue(value);
         }
-        /** 
+        /**
          * The generic data value to be plotted on the X axis.
-         * @return The XValue property         
+         * @return The XValue property
          */
         public final ObjectProperty<X> XValueProperty() { return xValue; }
 
@@ -1306,11 +1297,11 @@
             yValue.set(value);
             // handle the case where this is a init because the default constructor was used
             // and the case when series is not associated to a chart due to a remove series
-            if (currentY.get() == null || 
+            if (currentY.get() == null ||
                     (series != null && series.getChart() == null)) currentY.setValue(value);
-            
+
         }
-        /** 
+        /**
          * The generic data value to be plotted on the Y axis.
          * @return the YValue property
          */
@@ -1406,7 +1397,7 @@
         /**
          * Creates an instance of XYChart.Data object and initializes the X,Y
          * data values.
-         * 
+         *
          * @param xValue The X axis data value
          * @param yValue The Y axis data value
          */
@@ -1439,7 +1430,7 @@
         /**
          * Returns a string representation of this {@code Data} object.
          * @return a string representation of this {@code Data} object.
-         */ 
+         */
         @Override public String toString() {
             return "Data["+getXValue()+","+getYValue()+","+getExtraValue()+"]";
         }
@@ -1519,7 +1510,7 @@
                         }
                     }
                     // check cycle in the data list
-                    // if cycle exists, and the data is not set to be removed, 
+                    // if cycle exists, and the data is not set to be removed,
                     // eliminate loop and throw exception stating operation not permitted.
                     // RT-28880 : infinite loop when same data is added to two charts.
                     Data<X,Y> cycle = checkCycleInList();
@@ -1537,7 +1528,7 @@
                 }
             }
         };
-        
+
         private Data<X,Y> checkCycleInList() {
             Data<X,Y> slow = null;
             Data<X,Y> fast = null;
@@ -1552,7 +1543,7 @@
             }
             return null;
         }
-        
+
         private void eliminateLoop(Data<X,Y> cycle) {
             Data<X,Y> slow = cycle;
             // Identify the data that is the start of the loop
@@ -1693,7 +1684,7 @@
         /**
          * Returns a string representation of this {@code Series} object.
          * @return a string representation of this {@code Series} object.
-         */ 
+         */
         @Override public String toString() {
             return "Series["+getName()+"]";
         }
@@ -1702,7 +1693,7 @@
 
         /*
          * The following methods are for manipulating the pointers in the linked list
-         * when data is deleted. 
+         * when data is deleted.
          */
         private void removeDataItemRef(Data<X,Y> item) {
             if (begin == item) {
@@ -1733,5 +1724,5 @@
             return count;
         }
     }
-    
+
 }
--- a/modules/controls/src/test/java/com/sun/javafx/scene/control/infrastructure/ControlTestUtils.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/controls/src/test/java/com/sun/javafx/scene/control/infrastructure/ControlTestUtils.java	Tue Jul 23 17:23:49 2013 -0700
@@ -25,18 +25,7 @@
 
 package com.sun.javafx.scene.control.infrastructure;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
 import javafx.beans.InvalidationListener;
-import javafx.beans.value.ChangeListener;
 import javafx.beans.value.ObservableValue;
 import javafx.collections.ListChangeListener;
 import javafx.collections.ObservableList;
@@ -47,8 +36,13 @@
 import javafx.scene.control.Pagination;
 import javafx.scene.control.PopupControl;
 import javafx.scene.control.Tab;
-
-import com.sun.javafx.binding.ExpressionHelper;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import com.sun.javafx.binding.ExpressionHelperUtility;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 public final class ControlTestUtils {
     private ControlTestUtils() { }
@@ -193,21 +187,6 @@
         return (ListChangeListener) getListener(bean, fieldName);
     }
 
-    public static int getListenerCount(ObservableList list) {
-//        ListenerList listeners = getListenerList(list);
-//        return listeners == null ? 0 : listeners.size();
-        return 0;
-    }
-
-    public static void assertValueListenersContains(ObservableValue value, ChangeListener listener) {
-        assertValueListenersContains("The listener " + listener + " was not contained in " + value, value, listener);
-    }
-
-    public static void assertValueListenersContains(String message, ObservableValue value, ChangeListener listener) {
-        List listeners = getObservableValueListeners(value);
-        assertTrue(message, listeners != null && listeners.contains(listener));
-    }
-
     public static void assertValueListenersContains(ObservableValue value, InvalidationListener listener) {
         assertValueListenersContains("The listener " + listener + " was not contained in " + value, value, listener);
     }
@@ -217,15 +196,6 @@
         assertTrue(message, listeners != null && listeners.contains(listener));
     }
 
-    public static void assertValueListenersDoesNotContain(ObservableValue value, ChangeListener listener) {
-        assertValueListenersDoesNotContain("The listener " + listener + " was contained in " + value, value, listener);
-    }
-
-    public static void assertValueListenersDoesNotContain(String message, ObservableValue value, ChangeListener listener) {
-        List listeners = getObservableValueListeners(value);
-        assertTrue(message, listeners == null || !listeners.contains(listener));
-    }
-
     public static void assertValueListenersDoesNotContain(ObservableValue value, InvalidationListener listener) {
         assertValueListenersDoesNotContain("The listener " + listener + " was contained in " + value, value, listener);
     }
@@ -239,10 +209,6 @@
         return getObservableValueListeners(value).size();
     }
 
-    public static ChangeListener getChangeListener(Object bean, String fieldName) {
-        return (ChangeListener) getListener(bean, fieldName);
-    }
-
     public static InvalidationListener getInvalidationListener(Object bean, String fieldName) {
         return (InvalidationListener) getListener(bean, fieldName);
     }
@@ -259,101 +225,10 @@
         return null;
     }
 
-//    private static ListenerList getListenerList(ObservableList list) {
-//        try {
-//            Class clazz = ObservableListWrapper.class;
-//            Field field = clazz.getDeclaredField("observers");
-//            field.setAccessible(true);
-//            return (ListenerList) field.get(list);
-//        } catch (Exception e) {
-//            try {
-//                Class clazz = ReadOnlyUnbackedObservableList.class;
-//                Field field = clazz.getDeclaredField("observers");
-//                field.setAccessible(true);
-//                return (ListenerList) field.get(list);
-//            } catch (Exception ee) {
-//                e.printStackTrace();
-//                assertTrue(false);
-//            }
-//        }
-//        return null;
-//    }
-
     private static List getObservableValueListeners(ObservableValue value) {
-        // Try to look for the ExpressionHelper "helper" field
-        // Depending on the type of the helper, I have to look for different fields. If
-        // the helper is a Single* type, then I look for the field and if it is not null,
-        // then the count is 1, otherwise the count is 0. If it is instead a Multiple*
-        // type then I check size, or changeSize/invalidationSize fields.
-        try {
-            // TODO need to support more than just ObjectPropertyBase
-            Field helperField = getExpressionHelperField(value);
-            helperField.setAccessible(true);
-            ExpressionHelper helper = (ExpressionHelper) helperField.get(value);
-            if (helper == null) return Collections.emptyList();
-
-            Class singleInvalidationClass = Class.forName("com.sun.javafx.binding.ExpressionHelper$SingleInvalidation");
-            if (singleInvalidationClass.isAssignableFrom(helper.getClass())) {
-                Field field = singleInvalidationClass.getDeclaredField("listener");
-                field.setAccessible(true);
-                Object listener = field.get(helper);
-                return listener == null ? Collections.emptyList() : Arrays.asList(listener);
-            }
-
-            Class singleChangeClass = Class.forName("com.sun.javafx.binding.ExpressionHelper$SingleChange");
-            if (singleChangeClass.isAssignableFrom(helper.getClass())) {
-                Field field = singleChangeClass.getDeclaredField("listener");
-                field.setAccessible(true);
-                Object listener = field.get(helper);
-                return listener == null ? Collections.emptyList() : Arrays.asList(listener);
-            }
-
-            Class genericClass = Class.forName("com.sun.javafx.binding.ExpressionHelper$Generic");
-            if (genericClass.isAssignableFrom(helper.getClass())) {
-                List results = new ArrayList();
-                Field field = genericClass.getDeclaredField("invalidationListeners");
-                field.setAccessible(true);
-                InvalidationListener[] invalidationListeners = (InvalidationListener[])field.get(helper);
-                if (invalidationListeners != null) {
-                    results.addAll(Arrays.asList(invalidationListeners));
-                }
-
-                field = genericClass.getDeclaredField("changeListeners");
-                field.setAccessible(true);
-                ChangeListener[] changeListeners = (ChangeListener[])field.get(helper);
-                if (changeListeners != null) {
-                    results.addAll(Arrays.asList(changeListeners));
-                }
-                return results;
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            assertTrue(false);
-        }
-
-        return Collections.emptyList();
-    }
-
-    private static List getListenersFromExpressionHelper(ExpressionHelper helper, Class clazz, String sizeName, String listenersName) throws Exception {
-        Field sizeField = clazz.getDeclaredField(sizeName);
-        sizeField.setAccessible(true);
-        Field listenersField = clazz.getDeclaredField(listenersName);
-        listenersField.setAccessible(true);
-        int size = (Integer)sizeField.get(helper);
-        Object[] listeners = (Object[])listenersField.get(helper);
-        Object[] results = new Object[size];
-        System.arraycopy(listeners, 0, results, 0, size);
-        return Arrays.asList(results);
-    }
-
-    private static Field getExpressionHelperField(ObservableValue value) throws Exception {
-        Class clazz = value.getClass();
-        while (clazz != Object.class) {
-            try {
-                return clazz.getDeclaredField("helper");
-            } catch (NoSuchFieldException ex) { }
-            clazz = clazz.getSuperclass();
-        }
-        return null;
+        ArrayList results = new ArrayList();
+        results.addAll(ExpressionHelperUtility.getChangeListeners(value));
+        results.addAll(ExpressionHelperUtility.getInvalidationListeners(value));
+        return results;
     }
 }
--- a/modules/graphics/src/android/java/com/oracle/dalvik/FXActivity.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/android/java/com/oracle/dalvik/FXActivity.java	Tue Jul 23 17:23:49 2013 -0700
@@ -61,7 +61,7 @@
     private static final String META_DATA_APP_ARGS   = "app.args";
     private static final String META_DATA_DEBUG_PORT = "debug.port";
     private static final String ANDROID_WEBVIEW = "android_webview";
-    private static final String GLASS_LENS_ANDROID = "glass-lens-android";
+    private static final String GLASS_LENS_ANDROID = "glass_lens_android";
 
     static {        
         System.loadLibrary("vmlauncher");
--- a/modules/graphics/src/main/java/com/sun/glass/ui/lens/LensApplication.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/lens/LensApplication.java	Tue Jul 23 17:23:49 2013 -0700
@@ -127,7 +127,7 @@
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
             @Override
             public Void run() {
-                Application.loadNativeLibrary("glass-lens-" + platform);
+                Application.loadNativeLibrary("glass_lens_" + platform);
                 return null;
             }
         });
--- a/modules/graphics/src/main/java/com/sun/javafx/application/PlatformImpl.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/application/PlatformImpl.java	Tue Jul 23 17:23:49 2013 -0700
@@ -343,7 +343,7 @@
             // runnables (including this one) are done and there is no running
             // nested loops, then we will shutdown.
             if (lastWindowClosed && pendingRunnables.get() == 0
-                    && !Toolkit.getToolkit().isNestedLoopRunning()) {
+                    && (toolkitExit.get() || !Toolkit.getToolkit().isNestedLoopRunning())) {
 //                System.err.println("Last window closed and no pending runnables");
                 if (reallyIdle.getAndSet(true)) {
 //                    System.err.println("Really idle now");
--- a/modules/graphics/src/main/java/com/sun/javafx/font/AndroidFontFinder.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/AndroidFontFinder.java	Tue Jul 23 17:23:49 2013 -0700
@@ -65,7 +65,7 @@
     static {
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
             public Void run() {
-                NativeLibLoader.loadLibrary("javafx-font");
+                NativeLibLoader.loadLibrary("javafx_font");
                 return null;
             }
         });
--- a/modules/graphics/src/main/java/com/sun/javafx/font/CompositeGlyphMapper.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/CompositeGlyphMapper.java	Tue Jul 23 17:23:49 2013 -0700
@@ -64,6 +64,11 @@
     }
 
     private final CharToGlyphMapper getSlotMapper(int slot) {
+        if (slot >= slotMappers.length) {
+            CharToGlyphMapper[] tmp = new CharToGlyphMapper[font.getNumSlots()];
+            System.arraycopy(slotMappers, 0, tmp, 0, slotMappers.length);
+            slotMappers = tmp;
+        }
         CharToGlyphMapper mapper = slotMappers[slot];
         if (mapper == null) {
             mapper = font.getSlotResource(slot).getGlyphMapper();
--- a/modules/graphics/src/main/java/com/sun/javafx/font/CompositeStrike.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/CompositeStrike.java	Tue Jul 23 17:23:49 2013 -0700
@@ -166,6 +166,12 @@
         return getStrikeSlot(slot).getGlyph(slotglyphCode);
     }
 
+    public Glyph getGlyph(GlyphList gl, int gi) {
+        int glyphCode = gl.getGlyphCode(gi);
+        int slot = (glyphCode >>> 24);
+        return getStrikeSlot(slot).getGlyph(gl, gi);
+    }
+
      /**
      * Access to individual character advances are frequently needed for layout
      * understand that advance may vary for single glyph if ligatures or kerning
--- a/modules/graphics/src/main/java/com/sun/javafx/font/DFontDecoder.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/DFontDecoder.java	Tue Jul 23 17:23:49 2013 -0700
@@ -35,7 +35,7 @@
     static {
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
             public Void run() {
-                NativeLibLoader.loadLibrary("javafx-font");
+                NativeLibLoader.loadLibrary("javafx_font");
                 return null;
             }
         });
--- a/modules/graphics/src/main/java/com/sun/javafx/font/FontStrike.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/FontStrike.java	Tue Jul 23 17:23:49 2013 -0700
@@ -38,6 +38,7 @@
     public Metrics getMetrics();
     public Glyph getGlyph(char symbol);
     public Glyph getGlyph(int glyphCode);
+    public Glyph getGlyph(GlyphList gl, int glyphIndex);
     public void clearDesc(); // for cache management.
     public int getAAMode();
 
--- a/modules/graphics/src/main/java/com/sun/javafx/font/MacFontFinder.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/MacFontFinder.java	Tue Jul 23 17:23:49 2013 -0700
@@ -39,7 +39,7 @@
         AccessController.doPrivileged(
             new PrivilegedAction<Void>() {
                 public Void run() {
-                    NativeLibLoader.loadLibrary("javafx-font");
+                    NativeLibLoader.loadLibrary("javafx_font");
                     return null;
                 }
             }
--- a/modules/graphics/src/main/java/com/sun/javafx/font/PrismFontFactory.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/PrismFontFactory.java	Tue Jul 23 17:23:49 2013 -0700
@@ -45,14 +45,14 @@
 
 public abstract class PrismFontFactory implements FontFactory {
 
-    public static boolean debugFonts = false;
+    public static final boolean debugFonts;
     public static final boolean isWindows;
     public static final boolean isLinux;
     public static final boolean isMacOSX;
     public static final boolean isIOS;
     public static final boolean isAndroid;
     public static final boolean isEmbedded;
-    public static boolean useNativeRasterizer;
+    static boolean useNativeRasterizer;
     private static boolean subPixelEnabled;
     private static boolean lcdEnabled;
     private static float lcdContrast = -1;
@@ -74,7 +74,6 @@
     HashMap<String, FontResource> fontResourceMap =
         new HashMap<String, FontResource>();
 
-
     HashMap<String, CompositeFontResource> compResourceMap =
         new HashMap<String, CompositeFontResource>();
 
@@ -86,12 +85,12 @@
         isAndroid = PlatformUtil.isAndroid();
         isEmbedded = PlatformUtil.isEmbedded();
 
-        AccessController.doPrivileged(
-            new PrivilegedAction<String>() {
-                public String run() {
-                    NativeLibLoader.loadLibrary("javafx-font");
+        debugFonts = AccessController.doPrivileged(
+            new PrivilegedAction<Boolean>() {
+                public Boolean run() {
+                    NativeLibLoader.loadLibrary("javafx_font");
                     String dbg = System.getProperty("prism.debugfonts", "");
-                    debugFonts = "true".equals(dbg);
+                    boolean debug = "true".equals(dbg);
                     jreFontDir =
                     System.getProperty("java.home","") + File.separator +
                     "lib" + File.separator + "fonts" + File.separator;
@@ -123,7 +122,7 @@
                     String defLCDProp = lcdTextOff ? "false" : "true";
                     String lcdProp = System.getProperty("prism.lcdtext", defLCDProp);
                     lcdEnabled = lcdProp.equals("true");
-                    return null;
+                    return debug;
                 }
             });
     }
@@ -949,7 +948,7 @@
             for (int i=0; i < linkListLen; i++) {
                 String[] splitFontData = fontRegList[i].split(",");
                 int len = splitFontData.length;
-                String file = splitFontData[0];
+                String file = getPathNameWindows(splitFontData[0]);
                 String name = (len > 1) ? splitFontData[1] : null;
                 if (name != null && fontRegInfo[1].contains(name)) {
                     continue;
@@ -973,16 +972,16 @@
 
         if (PlatformUtil.isWinVistaOrLater()) {
             // CJK Ext B Supplementary character fallbacks.
-            fontRegInfo[0].add("mingliub.ttc");
+            fontRegInfo[0].add(getPathNameWindows("mingliub.ttc"));
             fontRegInfo[1].add("MingLiU-ExtB");
 
             if (PlatformUtil.isWin7OrLater()) {
                 // Add Segoe UI Symbol to Windows 7 or later fallback list
-                fontRegInfo[0].add("seguisym.ttf");
+                fontRegInfo[0].add(getPathNameWindows("seguisym.ttf"));
                 fontRegInfo[1].add("Segoe UI Symbol");
             } else {
                 // Add Cambria Math to Windows Vista fallback list
-                fontRegInfo[0].add("cambria.ttc");
+                fontRegInfo[0].add(getPathNameWindows("cambria.ttc"));
                 fontRegInfo[1].add("Cambria Math");
             }
         }
--- a/modules/graphics/src/main/java/com/sun/javafx/font/PrismFontStrike.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/PrismFontStrike.java	Tue Jul 23 17:23:49 2013 -0700
@@ -153,6 +153,10 @@
 
     protected abstract Glyph createGlyph(int glyphCode);
 
+    protected Glyph createGlyph(GlyphList gl, int gi) {
+        return createGlyph(gl.getGlyphCode(gi));
+    }
+
     public Glyph getGlyph(int glyphCode) {
         Glyph glyph = glyphMap.get(glyphCode);
         if (glyph == null) {
@@ -162,6 +166,16 @@
         return glyph;
     }
 
+    public Glyph getGlyph(GlyphList gl, int gi) {
+        int glyphCode = gl.getGlyphCode(gi);
+        Glyph glyph = glyphMap.get(glyphCode);
+        if (glyph == null) {
+            glyph = createGlyph(gl, gi);
+            glyphMap.put(glyphCode, glyph);
+        }
+        return glyph;
+    }
+
     protected abstract Path2D createGlyphOutline(int glyphCode);
 
     public Shape getOutline(GlyphList gl, BaseTransform transform) {
--- a/modules/graphics/src/main/java/com/sun/javafx/font/coretext/CTGlyphLayout.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/coretext/CTGlyphLayout.java	Tue Jul 23 17:23:49 2013 -0700
@@ -30,34 +30,19 @@
 import com.sun.javafx.font.FontStrike;
 import com.sun.javafx.font.PGFont;
 import com.sun.javafx.font.PrismFontFactory;
-import com.sun.javafx.geom.transform.BaseTransform;
-import com.sun.javafx.scene.text.TextSpan;
 import com.sun.javafx.text.GlyphLayout;
-import com.sun.javafx.text.PrismTextLayout;
 import com.sun.javafx.text.TextRun;
 
-import java.util.Arrays;
-
 class CTGlyphLayout extends GlyphLayout {
 
-    protected TextRun addTextRun(PrismTextLayout layout, char[] chars, int start,
-                                 int length, PGFont font, TextSpan span, byte level) {
-
-        TextRun textRun = null;
-
+    private long createCTLine(long fontRef, char[] chars,
+                              int start, int length) {
         /* Use CoreText to analize the run */
         long alloc = OS.kCFAllocatorDefault();
         long textRef = OS.CFStringCreateWithCharacters(alloc, chars, start, length);
-
-        FontStrike fontStrike = font.getStrike(BaseTransform.IDENTITY_TRANSFORM);
-        boolean composite = fontStrike instanceof CompositeStrike;
-        if (composite) {
-            fontStrike = ((CompositeStrike)fontStrike).getStrikeSlot(0);
-        }
-        CTFontStrike strike = (CTFontStrike)fontStrike;
-        long fontRef = strike.getFontRef();
-
-        long attributes = OS.CFDictionaryCreateMutable(alloc, 4, OS.kCFTypeDictionaryKeyCallBacks(), OS.kCFTypeDictionaryValueCallBacks());
+        long attributes = OS.CFDictionaryCreateMutable(alloc, 4,
+                              OS.kCFTypeDictionaryKeyCallBacks(),
+                              OS.kCFTypeDictionaryValueCallBacks());
         OS.CFDictionaryAddValue(attributes, OS.kCTFontAttributeName(), fontRef);
         /* Note that by default CoreText will apply kerning depending on the font*/
         long attString = OS.CFAttributedStringCreate(alloc, textRef, attributes);
@@ -65,71 +50,55 @@
         OS.CFRelease(attributes);
         OS.CFRelease(attString);
         OS.CFRelease(textRef);
+        return lineRef;
+    }
 
-        long runs = OS.CTLineGetGlyphRuns(lineRef);
-        long runCount = OS.CFArrayGetCount(runs);
-
-        /*
-         * Need to undo the bidi reordering done by CoreText as it will be
-         * done again in text layout after wrapping.
-         */
-        boolean bidi = (level & 1) != 0;
-        int i = bidi ? (int)runCount - 1 : 0;
-        int step = bidi ? -1 : 1;
-        for (; 0 <= i && i < runCount; i += step) {
-            long run = OS.CFArrayGetValueAtIndex(runs, i);
-            int status = OS.CTRunGetStatus(run);
-            boolean runBidi = (status & OS.kCTRunStatusRightToLeft) != 0;
-            if (bidi != runBidi) {
-                if (PrismFontFactory.debugFonts) {
-                    System.err.println("[CoreText] not expecing bidi level to differ.");
-                }
+    private int getFontSlot(long runRef, CompositeFontResource fr, String name) {
+        long runAttrs = OS.CTRunGetAttributes(runRef);
+        long actualFont = OS.CFDictionaryGetValue(runAttrs, OS.kCTFontAttributeName());
+        String fontName = OS.CTFontCopyDisplayName(actualFont);
+        int slot = 0;
+        if (!fontName.equalsIgnoreCase(name)) {
+            if (fr == null) return -1;
+            slot = fr.getSlotForFont(fontName);
+            if (PrismFontFactory.debugFonts) {
+                System.err.println("\tFallback front= "+ fontName + " slot=" + slot);
             }
-            CFRange range = OS.CTRunGetStringRange(run);
-            int glyphCount = (int)OS.CTRunGetGlyphCount(run);
-            int[] glyphs = OS.CTRunGetGlyphsPtr(run);
-
-            /*
-             * The positions and indices returned by core text are
-             * relative to the line, the following native methods
-             * are custom to return values relative to the run.
-             */
-            float[] positions = OS.CTRunGetPositionsPtr(run);
-            int[] indices = OS.CTRunGetStringIndicesPtr(run);
-
-            if (PrismFontFactory.debugFonts) {
-                System.err.println("Run " + i + " range " + (start+range.location) + ", " + range.length);
-                System.err.println("\tText=[" + new String(chars, start + (int)range.location, (int)range.length) + "]");
-                System.err.println("\tFont=" +strike.getFontResource());
-                System.err.println("\tStatus="+status);
-                System.err.println("\tGlyphs="+Arrays.toString(glyphs));
-                System.err.println("\tPositions="+Arrays.toString(positions));
-                System.err.println("\tIndices="+Arrays.toString(indices));
-            }
-            if (composite) {
-                long runAttrs = OS.CTRunGetAttributes(run);
-                long actualFont = OS.CFDictionaryGetValue(runAttrs, OS.kCTFontAttributeName());
-                String fontName = OS.CTFontCopyDisplayName(actualFont);
-                if (!fontName.equalsIgnoreCase(strike.getFontResource().getFullName())) {
-                    CompositeFontResource fr = (CompositeFontResource)font.getFontResource();
-                    int slot = fr.getSlotForFont(fontName) << 24;
-                    if (PrismFontFactory.debugFonts) {
-                        System.err.println("\tFallback front= "+ fontName + " slot=" + (slot>>24));
-                    }
-                    for (int j = 0; j < glyphs.length; j++) {
-                        glyphs[j] |= slot;
-                    }
-                }
-            }
-            textRun = new TextRun(start + (int)range.location, (int)range.length, level, true, 0, span, 0, false);
-            textRun.shape(glyphCount, glyphs, positions, indices);
-            layout.addTextRun(textRun);
         }
-        OS.CFRelease(lineRef);
-        return textRun;
+        return slot << 24;
     }
 
     public void layout(TextRun run, PGFont font, FontStrike strike, char[] text) {
-        // Nothing - complex run are analyzed by CoreText during break run
+
+        CompositeFontResource composite = null;
+        if (strike instanceof CompositeStrike) {
+            composite = (CompositeFontResource)strike.getFontResource();
+            strike = ((CompositeStrike)strike).getStrikeSlot(0);
+        }
+        String fontName = strike.getFontResource().getFullName();
+        long fontRef = ((CTFontStrike)strike).getFontRef();
+        long lineRef = createCTLine(fontRef, text, run.getStart(), run.getLength());
+        long runs = OS.CTLineGetGlyphRuns(lineRef);
+        int glyphCount = (int)OS.CTLineGetGlyphCount(lineRef);
+        int[] glyphs = new int[glyphCount];
+        float[] positions = new float[glyphCount * 2 + 2];
+        int[] indices = new int[glyphCount];
+        long runCount = OS.CFArrayGetCount(runs);
+        int glyphStart = 0, posStart = 0, indicesStart = 0;
+        for (int i = 0; i < runCount; i++) {
+            long runRef = OS.CFArrayGetValueAtIndex(runs, i);
+            int slot = getFontSlot(runRef, composite, fontName) ;
+            if (slot != -1) {
+                glyphStart += OS.CTRunGetGlyphs(runRef, slot, glyphStart, glyphs);
+            } else {
+                glyphStart += OS.CTRunGetGlyphCount(runRef);
+            }
+            posStart += OS.CTRunGetPositions(runRef, posStart, positions);
+            indicesStart += OS.CTRunGetStringIndices(runRef, indicesStart, indices);
+
+        }
+        positions[posStart] = (float)OS.CTLineGetTypographicBounds(lineRef);
+        run.shape(glyphCount, glyphs, positions, indices);
+        OS.CFRelease(lineRef);
     }
 }
--- a/modules/graphics/src/main/java/com/sun/javafx/font/coretext/OS.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/coretext/OS.java	Tue Jul 23 17:23:49 2013 -0700
@@ -36,7 +36,7 @@
     static {
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
            public Void run() {
-               NativeLibLoader.loadLibrary("javafx-font");
+               NativeLibLoader.loadLibrary("javafx_font");
                return null;
            }
         });
@@ -83,11 +83,10 @@
     static final native double CTFontGetAdvancesForGlyphs(long font, int orientation, short glyphs, CGSize advances, long count);
     static final native CGRect CTFontGetBoundingRectsForGlyphs(long font, int orientation, short glyphs, CGRect boundingRects, long count);
     static final native boolean CTFontGetBoundingRectForGlyphUsingTables(long font, short glyphs, short format, int[] retArr);
-    static final native float[] CTRunGetAdvancesPtr(long run);
-    static final native int[] CTRunGetGlyphsPtr(long run);
-    static final native int[] CTRunGetStringIndicesPtr(long run);
+    static final native int CTRunGetGlyphs(long run, int slotMask, int start, int[] buffer);
+    static final native int CTRunGetStringIndices(long run, int start, int[] buffer);
     static final native CFRange CTRunGetStringRange(long run);
-    static final native float[] CTRunGetPositionsPtr(long run);
+    static final native int CTRunGetPositions(long run, int start, float[] buffer);
 
     /* one to one */
     static final native long kCFAllocatorDefault();
@@ -121,6 +120,8 @@
     static final native boolean CTFontManagerRegisterFontsForURL(long fontURL, int scope, long error);
     static final native long CTLineCreateWithAttributedString(long string);
     static final native long CTLineGetGlyphRuns(long line);
+    static final native long CTLineGetGlyphCount(long line);
+    static final native double CTLineGetTypographicBounds(long line);
     static final native long CTRunGetGlyphCount(long run);
     static final native long CTRunGetAttributes(long run);
     static final native int CTRunGetStatus(long run);
--- a/modules/graphics/src/main/java/com/sun/javafx/font/directwrite/DWFontStrike.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/directwrite/DWFontStrike.java	Tue Jul 23 17:23:49 2013 -0700
@@ -31,8 +31,11 @@
 import com.sun.javafx.font.PrismFontFactory;
 import com.sun.javafx.font.PrismFontStrike;
 import com.sun.javafx.geom.Path2D;
+import com.sun.javafx.geom.Point2D;
 import com.sun.javafx.geom.RectBounds;
 import com.sun.javafx.geom.transform.BaseTransform;
+import com.sun.javafx.scene.text.GlyphList;
+import com.sun.javafx.text.TextRun;
 
 class DWFontStrike extends PrismFontStrike<DWFontFile> {
     DWRITE_MATRIX matrix;
@@ -98,7 +101,21 @@
         return fontResource.getGlyphOutline(glyphCode, getSize());
     }
 
+    @Override public Glyph createGlyph(GlyphList gl, int gi) {
+        Point2D offset = (Point2D)((TextRun)gl).getGlyphData(gi);
+        float advanceOffset = offset != null ? offset.x : 0;
+        float ascenderOffset = offset != null ? offset.y : 0;
+        int gc = gl.getGlyphCode(gi);
+        if (PrismFontFactory.debugFonts) {
+            if (advanceOffset != 0 || ascenderOffset != 0) {
+                System.err.println("Setting glyph[" + Integer.toHexString(gc) +
+                                   "] offsets to " + offset);
+            }
+        }
+        return new DWGlyph(this, gc, advanceOffset, ascenderOffset, drawShapes);
+    }
+
     @Override protected Glyph createGlyph(int glyphCode) {
-        return new DWGlyph(this, glyphCode, drawShapes);
+        return new DWGlyph(this, glyphCode, 0, 0, drawShapes);
     }
 }
--- a/modules/graphics/src/main/java/com/sun/javafx/font/directwrite/DWGlyph.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/directwrite/DWGlyph.java	Tue Jul 23 17:23:49 2013 -0700
@@ -51,7 +51,9 @@
     private static D2D1_COLOR_F WHITE = new D2D1_COLOR_F(1f, 1f, 1f, 1f);
     private static D2D1_MATRIX_3X2_F D2D2_MATRIX_IDENTITY = new D2D1_MATRIX_3X2_F(1,0, 0,1, 0,0);
 
-    DWGlyph(DWFontStrike strike, int glyphCode, boolean drawShapes) {
+
+    DWGlyph(DWFontStrike strike, int glyphCode, float advanceOffset,
+            float ascenderOffset, boolean drawShapes) {
         this.strike = strike;
         this.drawShapes = drawShapes;
 
@@ -59,9 +61,10 @@
         run = new DWRITE_GLYPH_RUN();
         run.fontFace = face.ptr;
         run.fontEmSize = strike.getSize();
-        run.glyphCount = 1;
         run.glyphIndices = (short)glyphCode;
         run.glyphAdvances = 0;
+        run.advanceOffset = advanceOffset;
+        run.ascenderOffset = ascenderOffset;
         run.bidiLevel = 0; //should not matter as it draws just one glyph
         run.isSideways = false;
 
@@ -95,6 +98,13 @@
         int textureType = OS.DWRITE_TEXTURE_CLEARTYPE_3x1;
         IDWriteGlyphRunAnalysis runAnalysis = createAnalysis(0, 0);
         rect = runAnalysis.GetAlphaTextureBounds(textureType);
+        if ((rect.right - rect.left == 0) ||
+             (rect.bottom - rect.top == 0)) {
+            /* Check for both texture types due to some limitations with
+             * IDWriteGlyphRunAnalysis. See RT-31587.
+             */
+            rect = runAnalysis.GetAlphaTextureBounds(OS.DWRITE_TEXTURE_ALIASED_1x1);
+        }
         runAnalysis.Release();
     }
 
@@ -104,20 +114,27 @@
         rect = runAnalysis.GetAlphaTextureBounds(textureType);
         if ((rect.right - rect.left == 0) ||
             (rect.bottom - rect.top == 0)) {
-            return new byte[0];
+            rect = runAnalysis.GetAlphaTextureBounds(OS.DWRITE_TEXTURE_ALIASED_1x1);
+            if ((rect.right - rect.left == 0) ||
+                (rect.bottom - rect.top == 0)) {
+                return new byte[0];
+            } else {
+                /* In some cases IDWriteGlyphRunAnalysis is unable to produce
+                 * LCD masks. But as long as the size can determined D2D can be
+                 * used to do the rendering. */
+                return getD2DMask(subPixelX, subPixelY, true);
+            }
         }
         byte[] buffer = runAnalysis.CreateAlphaTexture(textureType, rect);
         runAnalysis.Release();
         return buffer;
     }
 
-    byte[] getGrayMask(float subPixelX, float subPixelY) {
-
-        //TODO is using 3x1 for GrayScale (to measure) always correct ?
-        int textureType = OS.DWRITE_TEXTURE_CLEARTYPE_3x1;
-        IDWriteGlyphRunAnalysis runAnalysis = createAnalysis(subPixelX, subPixelY);
-        rect = runAnalysis.GetAlphaTextureBounds(textureType);
-        runAnalysis.Release();
+    byte[] getD2DMask(float subPixelX, float subPixelY, boolean lcd) {
+        checkBounds();
+        if (getWidth() == 0 || getHeight() == 0) {
+            return new byte[0];
+        }
 
         /* Increase the RECT */
         rect.left--;
@@ -157,7 +174,9 @@
         target.Clear(WHITE);
         D2D1_POINT_2F pt = new D2D1_POINT_2F(-glyphX, -glyphY);
         ID2D1Brush brush = target.CreateSolidColorBrush(BLACK);
-        target.SetTextAntialiasMode(OS.D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE);
+        if (!lcd) {
+            target.SetTextAntialiasMode(OS.D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE);
+        }
         target.DrawGlyphRun(pt, run, brush, OS.DWRITE_MEASURING_MODE_NATURAL);
         int hr = target.EndDraw();
         brush.Release();
@@ -180,14 +199,31 @@
         //blit in native code.
         byte[] buffer = lock.GetDataPointer();
         int stride = lock.GetStride();
-        byte[] result = new byte[w*h];
+        byte[] result;
         int i = 0, j = 0;
         byte one = (byte)0xFF;
-        for (int y = 0; y < h; y++) {
-            for (int x = 0; x < w; x++) {
-                result[i++] = (byte)(one - buffer[j + (x*4)]);
+        if (lcd) {
+            result = new byte[w*h*3];
+            for (int y = 0; y < h; y++) {
+                int row = j;
+                for (int x = 0; x < w; x++) {
+                    result[i++] = (byte)(one - buffer[row++]);
+                    result[i++] = (byte)(one - buffer[row++]);
+                    result[i++] = (byte)(one - buffer[row++]);
+                    row++;
+                }
+                j += stride;
             }
-            j += stride;
+        } else {
+            result = new byte[w*h];
+            for (int y = 0; y < h; y++) {
+                int row = j;
+                for (int x = 0; x < w; x++) {
+                    result[i++] = (byte)(one - buffer[row]);
+                    row += 4;
+                }
+                j += stride;
+            }
         }
         lock.Release();
 
@@ -270,7 +306,7 @@
     @Override
     public byte[] getPixelData(float x, float y) {
         if (pixelData == null) {
-            pixelData = isLCDGlyph() ? getLCDMask(x, y) : getGrayMask(x, y);
+            pixelData = isLCDGlyph() ? getLCDMask(x, y) : getD2DMask(x, y, false);
         }
         return pixelData;
     }
--- a/modules/graphics/src/main/java/com/sun/javafx/font/directwrite/DWGlyphLayout.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/directwrite/DWGlyphLayout.java	Tue Jul 23 17:23:49 2013 -0700
@@ -30,6 +30,7 @@
 import com.sun.javafx.font.FontStrike;
 import com.sun.javafx.font.PGFont;
 import com.sun.javafx.font.PrismFontFactory;
+import com.sun.javafx.geom.Point2D;
 import com.sun.javafx.scene.text.TextSpan;
 import com.sun.javafx.text.GlyphLayout;
 import com.sun.javafx.text.PrismTextLayout;
@@ -39,6 +40,7 @@
 
     private static final String LOCALE = "en-us";
 
+    @Override
     protected TextRun addTextRun(PrismTextLayout layout, char[] chars, int start,
                                  int length, PGFont font, TextSpan span, byte level) {
         TextRun textRun = null;
@@ -137,11 +139,11 @@
 
         float size = font.getSize();
         float[] advances = new float[glyphCount];
-        float[] glyphOffsets = new float[glyphCount * 2];
+        float[] offsets = new float[glyphCount * 2];
         analyzer.GetGlyphPlacements(text, clusterMap, textProps, start, length, glyphs,
                                     glyphProps, glyphCount, face, size, false, rtl,
                                     analysis, null, features, featuresRangeLengths,
-                                    featuresCount, advances, glyphOffsets);
+                                    featuresCount, advances, offsets);
 
         /* Adjust glyph indices */
         int[] indices = new int[length];
@@ -167,11 +169,24 @@
 
         analyzer.Release();
         run.shape(glyphCount, iglyphs, pos, indices);
+
+        /* Checking glyphs offsets */
+        i = 0;
+        j = 0;
+        while (i < glyphCount) {
+            float glyphOffsetX = offsets[j++];
+            float glyphOffsetY = offsets[j++];
+            if (glyphOffsetX != 0 || glyphOffsetY != 0) {
+                run.setGlyphData(i, new Point2D(glyphOffsetX, glyphOffsetY));
+            }
+            i++;
+        }
     }
 
     private void renderShape(char[] text, TextRun run, PGFont font) {
-        String family = font.getFamilyName();
-        CompositeFontResource fr = (CompositeFontResource)font.getFontResource();
+        CompositeFontResource composite = (CompositeFontResource)font.getFontResource();
+        FontResource fr = composite.getSlotResource(0);
+        String family = fr.getFamilyName();
         int weight = fr.isBold() ? OS.DWRITE_FONT_WEIGHT_BOLD :
                                    OS.DWRITE_FONT_WEIGHT_NORMAL;
         int stretch = OS.DWRITE_FONT_STRETCH_NORMAL;
@@ -204,6 +219,7 @@
         int totalGlyphCount = renderer.GetTotalGlyphCount();
         int[] glyphs = new int[totalGlyphCount];
         float[] advances = new float[totalGlyphCount];
+        float[] offsets = new float[totalGlyphCount * 2];
         int[] clusterMap = new int[length];
         int glyphStart = 0;
         int textStart = 0;
@@ -226,13 +242,14 @@
 
             int slot = 0;
             if (!fallbackFullname.equalsIgnoreCase(fr.getFullName())) {
-                slot = fr.getSlotForFont(fallbackFullname) << 24;
+                slot = composite.getSlotForFont(fallbackFullname) << 24;
                 if (PrismFontFactory.debugFonts) {
                     System.err.println("\tFallback front= "+ fallbackFullname + " slot=" + (slot>>24));
                 }
             }
             renderer.GetGlyphIndices(glyphs, glyphStart, slot);
             renderer.GetGlyphAdvances(advances, glyphStart);
+            renderer.GetGlyphOffsets(offsets, glyphStart * 2);
             renderer.GetClusterMap(clusterMap, textStart);
             glyphStart += renderer.GetGlyphCount();
             textStart += renderer.GetLength();
@@ -270,5 +287,17 @@
             }
         }
         run.shape(totalGlyphCount, glyphs, pos, clusterMap);
+
+        /* Checking glyphs offsets */
+        i = 0;
+        j = 0;
+        while (i < totalGlyphCount) {
+            float glyphOffsetX = offsets[j++];
+            float glyphOffsetY = offsets[j++];
+            if (glyphOffsetX != 0 || glyphOffsetY != 0) {
+                run.setGlyphData(i, new Point2D(glyphOffsetX, glyphOffsetY));
+            }
+            i++;
+        }
     }
 }
--- a/modules/graphics/src/main/java/com/sun/javafx/font/directwrite/DWRITE_GLYPH_RUN.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/directwrite/DWRITE_GLYPH_RUN.java	Tue Jul 23 17:23:49 2013 -0700
@@ -28,10 +28,10 @@
 class DWRITE_GLYPH_RUN {
     long fontFace;
     float fontEmSize;
-    int glyphCount;
     short glyphIndices;
     float glyphAdvances;
-//    DWRITE_GLYPH_OFFSET[] glyphOffsets; //not used
+    float advanceOffset;
+    float ascenderOffset;
     boolean isSideways;
     int bidiLevel;
 }
--- a/modules/graphics/src/main/java/com/sun/javafx/font/directwrite/JFXTextRenderer.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/directwrite/JFXTextRenderer.java	Tue Jul 23 17:23:49 2013 -0700
@@ -56,24 +56,16 @@
         return result != 0 ? new IDWriteFontFace(result) : null;
     }
 
-    int[] GetGlyphIndices() {
-        return OS.JFXTextRendererGetGlyphIndices(ptr);
-    }
-
     int GetGlyphIndices(int[] glyphs, int start, int slot) {
         return OS.JFXTextRendererGetGlyphIndices(ptr, glyphs, start, slot);
     }
 
-    float[] GetGlyphAdvances() {
-        return OS.JFXTextRendererGetGlyphAdvances(ptr);
-    }
-
     int GetGlyphAdvances(float[] advances, int start) {
         return OS.JFXTextRendererGetGlyphAdvances(ptr, advances, start);
     }
 
-    int[] GetClusterMap() {
-        return OS.JFXTextRendererGetClusterMap(ptr);
+    int GetGlyphOffsets(float[] offsets, int start) {
+        return OS.JFXTextRendererGetGlyphOffsets(ptr, offsets, start);
     }
 
     int GetClusterMap(int[] clusterMap, int start) {
--- a/modules/graphics/src/main/java/com/sun/javafx/font/directwrite/OS.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/directwrite/OS.java	Tue Jul 23 17:23:49 2013 -0700
@@ -35,7 +35,7 @@
     static {
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
            public Void run() {
-               NativeLibLoader.loadLibrary("javafx-font");
+               NativeLibLoader.loadLibrary("javafx_font");
                return null;
            }
         });
@@ -203,11 +203,9 @@
     static final native int JFXTextRendererGetGlyphCount(long ptr);
     static final native int JFXTextRendererGetTotalGlyphCount(long ptr);
     static final native long JFXTextRendererGetFontFace(long ptr);
-    static final native int[] JFXTextRendererGetGlyphIndices(long ptr);
     static final native int JFXTextRendererGetGlyphIndices(long ptr, int[] glyphs, int start, int slot);
-    static final native float[] JFXTextRendererGetGlyphAdvances(long ptr);
     static final native int JFXTextRendererGetGlyphAdvances(long ptr, float[] advances, int start);
-    static final native int[] JFXTextRendererGetClusterMap(long ptr);
+    static final native int JFXTextRendererGetGlyphOffsets(long ptr, float[] offsets, int start);
     static final native int JFXTextRendererGetClusterMap(long ptr, int[] clusterMap, int start);
 
     //IDWriteFontFace
--- a/modules/graphics/src/main/java/com/sun/javafx/iio/jpeg/JPEGImageLoader.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/iio/jpeg/JPEGImageLoader.java	Tue Jul 23 17:23:49 2013 -0700
@@ -109,7 +109,7 @@
         AccessController.doPrivileged(new PrivilegedAction<Object>() {
 
             public Object run() {
-                NativeLibLoader.loadLibrary("javafx-iio");
+                NativeLibLoader.loadLibrary("javafx_iio");
                 return null;
             }
         });
--- a/modules/graphics/src/main/java/com/sun/javafx/scene/transform/TransformUtils.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/scene/transform/TransformUtils.java	Tue Jul 23 17:23:49 2013 -0700
@@ -233,6 +233,11 @@
                 yx = left.yx * right.xx + left.yy * right.yx;
                 yy = left.yx * right.xy + left.yy * right.yy;
                 yt = left.yx * right.xt + left.yy * right.yt + left.yt;
+                if (state3d != APPLY_NON_3D) {
+                    xz = yz = zx = zy = zt = 0.0;
+                    zz = 1.0;
+                    state3d = APPLY_NON_3D;
+                }
                 updateState2D();
             } else {
                 xx = left.xx * right.xx + left.xy * right.yx + left.xz * right.zx;
--- a/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGArc.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGArc.java	Tue Jul 23 17:23:49 2013 -0700
@@ -59,7 +59,7 @@
     }
 
     @Override public Shape getShape() { return arc; }
-    @Override protected ShapeRep createShapeRep(Graphics g, boolean needs3D) {
-        return g.getResourceFactory().createArcRep(needs3D);
+    @Override protected ShapeRep createShapeRep(Graphics g) {
+        return g.getResourceFactory().createArcRep();
     }
 }
--- a/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGCircle.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGCircle.java	Tue Jul 23 17:23:49 2013 -0700
@@ -51,7 +51,7 @@
     }
 
     @Override
-    protected ShapeRep createShapeRep(Graphics g, boolean needs3D) {
-        return g.getResourceFactory().createEllipseRep(needs3D);
+    protected ShapeRep createShapeRep(Graphics g) {
+        return g.getResourceFactory().createEllipseRep();
     }
 }
--- a/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGEllipse.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGEllipse.java	Tue Jul 23 17:23:49 2013 -0700
@@ -50,7 +50,7 @@
     }
 
     @Override
-    protected ShapeRep createShapeRep(Graphics g, boolean needs3D) {
-        return g.getResourceFactory().createEllipseRep(needs3D);
+    protected ShapeRep createShapeRep(Graphics g) {
+        return g.getResourceFactory().createEllipseRep();
     }
 }
--- a/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGLine.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGLine.java	Tue Jul 23 17:23:49 2013 -0700
@@ -45,12 +45,7 @@
         geometryChanged();
     }
 
-    @Override
-    protected void renderContent(Graphics g) {
-        if (!g.getTransformNoClone().is2D()) {
-            super.renderContent(g);
-            return;
-        }
+    @Override protected void renderContent2D(Graphics g, boolean printing) {
         if ((mode == Mode.STROKE || mode == Mode.STROKE_FILL) &&
             drawStroke.getLineWidth() > 0 &&
             drawStroke.getType() != BasicStroke.TYPE_INNER)
--- a/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGNode.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGNode.java	Tue Jul 23 17:23:49 2013 -0700
@@ -1873,7 +1873,7 @@
     }
 
     private void renderCached(Graphics g) {
-        // We will punt on 3D completely for cahcing.
+        // We will punt on 3D completely for caching.
         // The first check is for any of its children contains a 3D Transform.
         // The second check is for any of its parents and itself has a 3D Transform
         if (isContentBounds2D() && g.getTransformNoClone().is2D()) {
--- a/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGRectangle.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGRectangle.java	Tue Jul 23 17:23:49 2013 -0700
@@ -169,8 +169,8 @@
     }
 
     @Override
-    protected ShapeRep createShapeRep(Graphics g, boolean needs3D) {
-        return g.getResourceFactory().createRoundRectRep(needs3D);
+    protected ShapeRep createShapeRep(Graphics g) {
+        return g.getResourceFactory().createRoundRectRep();
     }
 
     private static final double SQRT_2 = Math.sqrt(2.0);
--- a/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGShape.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGShape.java	Tue Jul 23 17:23:49 2013 -0700
@@ -37,6 +37,8 @@
 import com.sun.prism.BasicStroke;
 import com.sun.prism.Graphics;
 import com.sun.prism.PrinterGraphics;
+import com.sun.prism.RTTexture;
+import com.sun.prism.Texture;
 import com.sun.prism.paint.Paint;
 import com.sun.prism.shape.ShapeRep;
 import static com.sun.prism.shape.ShapeRep.InvalidationType.LOCATION;
@@ -47,11 +49,19 @@
 public abstract class NGShape extends NGNode {
     public enum Mode { EMPTY, FILL, STROKE, STROKE_FILL }
 
+    /**
+     * We cache a representation of this shape into an image if we are
+     * rendering the shape with a 3D transform. We attempt to keep this
+     * cached image from render to render, and invalidate it if
+     * this NGShape changes either in geometry or visuals.
+     */
+    private RTTexture cached3D;
     protected Paint fillPaint;
     protected Paint drawPaint;
     protected BasicStroke drawStroke;
     protected Mode mode = Mode.FILL;
     protected ShapeRep shapeRep;
+
     //protected boolean antialiased;
 
     public void setMode(Mode mode) {
@@ -196,8 +206,19 @@
 
     public abstract Shape getShape();
 
-    protected ShapeRep createShapeRep(Graphics g, boolean needs3D) {
-        return g.getResourceFactory().createPathRep(needs3D);
+    protected ShapeRep createShapeRep(Graphics g) {
+        return g.getResourceFactory().createPathRep();
+    }
+
+    @Override
+    protected void visualsChanged() {
+        super.visualsChanged();
+        // If there is a cached image, we have to forget about it
+        // and regenerate it when we paint if needs3D
+        if (cached3D != null) {
+            cached3D.dispose();
+            cached3D = null;
+        }
     }
 
     @Override
@@ -205,16 +226,72 @@
         if (mode == Mode.EMPTY) {
             return;
         }
-        boolean needs3D = !g.getTransformNoClone().is2D();
-        ShapeRep localShapeRep =
-            (g instanceof PrinterGraphics ? null : this.shapeRep);
+
+        // Need to know whether we are being asked to print or not
+        final boolean printing = g instanceof PrinterGraphics;
+
+        // If a 3D transform is being used, then we're going to render to
+        // an intermediate texture before we then do the final render operation.
+        final boolean needs3D = !g.getTransformNoClone().is2D();
+
+        // If there is already a cached image, then we need to check that
+        // the surface is not lost, and that we haven't switched from a 3D
+        // rendering situation to a 2D one. In either case we need to throw
+        // away this cached image and build up a new one.
+        if (cached3D != null) {
+            cached3D.lock();
+            if (cached3D.isSurfaceLost() || !needs3D) {
+                cached3D.unlock();
+                cached3D.dispose();
+                cached3D = null;
+            }
+        }
+
+        if (needs3D) {
+            // For rendering the shape in 3D, we need to first render to the cached
+            // image, and then render that image in 3D
+            if (cached3D == null) {
+                final BaseTransform tx = g.getTransformNoClone();
+                final double scaleX = Math.hypot(tx.getMxx(), tx.getMyx());
+                final double scaleY = Math.hypot(tx.getMxy(), tx.getMyy());
+                cached3D = g.getResourceFactory().createRTTexture(
+                        (int) Math.ceil(contentBounds.getWidth() * scaleX),
+                        (int) Math.ceil(contentBounds.getHeight() * scaleY),
+                        Texture.WrapMode.CLAMP_TO_ZERO,
+                        false);
+                cached3D.contentsUseful();
+                final Graphics textureGraphics = cached3D.createGraphics();
+                // Have to move the origin such that when rendering to x=0, we actually end up rendering
+                // at x=bounds.getMinX(). Otherwise anything rendered to the left of the origin would be lost
+                textureGraphics.scale((float) scaleX, (float) scaleY);
+                textureGraphics.translate(-contentBounds.getMinX(), -contentBounds.getMinY());
+                renderContent2D(textureGraphics, printing);
+            }
+            // Now render the cached image in 3D
+            g.drawTexture(cached3D,
+                    contentBounds.getMinX(), contentBounds.getMinY(),
+                    contentBounds.getMaxX(), contentBounds.getMaxY(),
+                    cached3D.getContentX(), cached3D.getContentY(),
+                    cached3D.getContentX() + cached3D.getContentWidth(),
+                    cached3D.getContentY() + cached3D.getContentHeight());
+            cached3D.unlock();
+        } else {
+            // Just render in 2D like normal
+            renderContent2D(g, printing);
+        }
+    }
+
+    /**
+     * Renders the content as though it is 2D in all cases. In the case that a 3D
+     * transform is in use at the time an NGShape is rendered, it will render as 2D
+     * into a texture and then transform in 3D that texture.
+     *
+     * @param g The graphics object to render with
+     */
+    protected void renderContent2D(Graphics g, boolean printing) {
+        ShapeRep localShapeRep = printing ? null : this.shapeRep;
         if (localShapeRep == null) {
-            localShapeRep = createShapeRep(g, needs3D);
-        } else if (needs3D && !localShapeRep.is3DCapable()) {
-            // TODO: for now we only upgrade from 2D to 3D, i.e., we don't
-            // currently go back from a 3D rep to a 2D one... (RT-26983)
-            localShapeRep.dispose();
-            localShapeRep = createShapeRep(g, true);
+            localShapeRep = createShapeRep(g);
         }
         Shape shape = getShape();
         if (mode != Mode.STROKE) {
@@ -226,7 +303,8 @@
             g.setStroke(drawStroke);
             localShapeRep.draw(g, shape, contentBounds);
         }
-        if (!(g instanceof PrinterGraphics)) {
+
+        if (!printing) {
             this.shapeRep = localShapeRep;
         }
     }
@@ -247,6 +325,12 @@
         if (shapeRep != null) {
             shapeRep.invalidate(LOCATION_AND_GEOMETRY);
         }
+        // If there is a cached image, we have to forget about it
+        // and regenerate it when we paint if needs3D
+        if (cached3D != null) {
+            cached3D.dispose();
+            cached3D = null;
+        }
     }
 
     void locationChanged() {
@@ -255,7 +339,7 @@
             shapeRep.invalidate(LOCATION);
         }
     }
-    
+
     static BaseBounds getRectShapeBounds(BaseBounds bounds,
                                        BaseTransform at, int atclass,
                                        float upad, float dpad,
--- a/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGText.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/sg/prism/NGText.java	Tue Jul 23 17:23:49 2013 -0700
@@ -228,17 +228,11 @@
     private static int SHAPE_FILL  = 1 << 2;
     private static int TEXT        = 1 << 3;
     private static int DECORATION  = 1 << 4;
-    @Override protected void renderContent(Graphics g) {
+    @Override protected void renderContent2D(Graphics g, boolean printing) {
         if (mode == Mode.EMPTY) return;
         if (runs == null || runs.length == 0) return;
 
         BaseTransform tx = g.getTransformNoClone();
-        // Render this text node as geometry if it is 3D transformed
-        if (!tx.is2D()) {
-            super.renderContent(g);
-            return;
-        }
-
         FontStrike strike = getStrike(tx);
 
         if (strike.getAAMode() == FontResource.AA_LCD ||
--- a/modules/graphics/src/main/java/com/sun/javafx/text/GlyphLayout.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/text/GlyphLayout.java	Tue Jul 23 17:23:49 2013 -0700
@@ -99,7 +99,7 @@
                                  int start, int length,
                                  PGFont font, TextSpan span, byte level) {
         /* subclass can overwrite this method in order to handle complex text */
-        TextRun run = new TextRun(start, length, level, false, 0, span, 0, false);
+        TextRun run = new TextRun(start, length, level, true, 0, span, 0, false);
         layout.addTextRun(run);
         return run;
     }
@@ -117,9 +117,10 @@
 
     public int breakRuns(PrismTextLayout layout, char[] chars, int flags) {
         int length = chars.length;
-        boolean complexRun = false;
         boolean complex = false;
         boolean feature = false;
+        int scriptRun = ScriptMapper.COMMON;
+        int script = ScriptMapper.COMMON;
 
         boolean checkComplex = true;
         boolean checkBidi = true;
@@ -176,60 +177,68 @@
             char ch = chars[i];
             int codePoint = ch;
 
-            boolean delimiterChanged = ch == '\t' || ch == '\n' || ch == '\r';
-            boolean spanChanged = i >= spanEnd;
-            boolean levelChanged = i >= bidiEnd;
-            boolean complexChanged = false;
-
-            if (checkComplex) {
-                if (Character.isHighSurrogate(ch)) {
-                    /* Only merge surrogate when the pair is in the same span. */
-                    if (i + 1 < spanEnd && Character.isLowSurrogate(chars[i + 1])) {
-                        codePoint = Character.toCodePoint(ch, chars[++i]);
-                    }
-                }
-                if (Character.isWhitespace(codePoint)) {
-                    complex = feature || complexRun;
-                } else {
-                    complex = feature || ScriptMapper.isComplexCharCode(codePoint);
-                }
-                complexChanged = complex != complexRun;
-            }
-
-            if (delimiterChanged || spanChanged || levelChanged || complexChanged) {
-
-                /* Create text run */
+            /* special handling for delimiters */
+            if (ch == '\t' || ch == '\n' || ch == '\r') {
                 if (i != start) {
                     run = addTextRun(layout, chars, start, i - start,
-                                     font, span, bidiLevel, complexRun);
-                    if (complexRun) {
+                                     font, span, bidiLevel, complex);
+                    if (complex) {
                         flags |= FLAGS_HAS_COMPLEX;
+                        complex = false;
                     }
                     start = i;
                 }
+                i++;
+                /* Only merge \r\n when the are in the same text span */
+                if (ch == '\r' && i < spanEnd && chars[i] == '\n') {
+                    i++;
+                }
 
-                if (delimiterChanged) {
-                    i++;
-                    /* Only merge \r\n when the are in the same text span */
-                    if (ch == '\r' && i < spanEnd && chars[i] == '\n') {
-                        i++;
+                /* Create delimiter run */
+                run = new TextRun(start, i - start, bidiLevel, false,
+                                  ScriptMapper.COMMON, span, 0, false);
+                if (ch == '\t') {
+                    run.setTab();
+                    flags |= FLAGS_HAS_TABS;
+                } else {
+                    run.setLinebreak();
+                }
+                layout.addTextRun(run);
+                start = i;
+            } else {
+                boolean spanChanged = i >= spanEnd;
+                boolean levelChanged = i >= bidiEnd;
+                boolean scriptChanged = false;
+                if (checkComplex) {
+                    if (Character.isHighSurrogate(ch)) {
+                        /* Only merge surrogate when the pair is in the same span. */
+                        if (i + 1 < spanEnd && Character.isLowSurrogate(chars[i + 1])) {
+                            codePoint = Character.toCodePoint(ch, chars[++i]);
+                        }
                     }
+                    /* Check for script changes */
+                    script = ScriptMapper.getScript(codePoint);
+                    if (scriptRun > ScriptMapper.INHERITED  &&
+                        script > ScriptMapper.INHERITED &&
+                        script != scriptRun) {
+                        scriptChanged = true;
+                    }
+                    if (!complex) {
+                        complex = feature || ScriptMapper.isComplexCharCode(codePoint);
+                    }
+                }
 
-                    /* Create delimiter run */
-                    run = new TextRun(start, i - start, bidiLevel, false,
-                                      ScriptMapper.COMMON, span, 0, false);
-                    if (ch == '\t') {
-                        run.setTab();
-                        flags |= FLAGS_HAS_TABS;
-                    } else {
-                        run.setLinebreak();
+                if (spanChanged || levelChanged || scriptChanged) {
+                    if (start != i) {
+                        /* Create text run */
+                        run = addTextRun(layout, chars, start, i - start,
+                                         font, span, bidiLevel, complex);
+                       if (complex) {
+                           flags |= FLAGS_HAS_COMPLEX;
+                           complex = false;
+                       }
+                       start = i;
                     }
-                    layout.addTextRun(run);
-
-                    start = i;
-                    if (i == length) break;
-                    spanChanged = i >= spanEnd;
-                    levelChanged = i >= bidiEnd;
                 }
                 if (spanChanged) {
                     /* Only true for rich text (spans != null) */
@@ -255,33 +264,19 @@
                         flags |= FLAGS_HAS_BIDI;
                     }
                 }
+                if (scriptChanged) {
+                    scriptRun = script;
+                }
 
-                if (complexChanged) {
-                    if (delimiterChanged) {
-                        ch = chars[i]; /* update ch because of delimiterChanged */
-                        if (Character.isHighSurrogate(ch)) {
-                            /* Only merge surrogate when the pair is in the same span */
-                            if (i + 1 < spanEnd && Character.isLowSurrogate(chars[i + 1])) {
-                                codePoint = Character.toCodePoint(ch, chars[++i]);
-                            }
-                        }
-                        if (Character.isWhitespace(codePoint)) {
-                            complex = feature || complexRun;
-                        } else {
-                            complex = feature || ScriptMapper.isComplexCharCode(codePoint);
-                        }
-                    }
-                    complexRun = complex;
-                }
+                i++;
             }
-            if (!delimiterChanged) i++;
         }
 
         /* Create final text run */
         if (start < length) {
             addTextRun(layout, chars, start, length - start,
-                       font, span, bidiLevel, complexRun);
-            if (complexRun) {
+                       font, span, bidiLevel, complex);
+            if (complex) {
                 flags |= FLAGS_HAS_COMPLEX;
             }
         } else {
--- a/modules/graphics/src/main/java/com/sun/javafx/text/TextRun.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/text/TextRun.java	Tue Jul 23 17:23:49 2013 -0700
@@ -36,6 +36,7 @@
     int[] gids;
     float[] positions;
     int[] charIndices;
+    Object[] glyphData;
     int start, length;
     float width = -1;
     byte level;
@@ -62,7 +63,7 @@
     final static int FLAGS_COMPACT          = 1 << 12;
     /* Compact is performance optimization used for simple text, it implies:
      * The glyphs and positions arrays are shared by all the runs and owned
-     * by the TextHelper. The positions arrays only has x advance.  
+     * by the TextHelper. The positions arrays only has x advance.
      */
 
     public TextRun(int start, int length, byte level, boolean complex,
@@ -177,7 +178,7 @@
             flags &= ~FLAGS_COMPLEX;
         }
     }
-    
+
     @Override public float getWidth() {
         if (width != -1) return width;
         if (positions != null) {
@@ -196,7 +197,7 @@
     @Override public float getHeight() {
         return -ascent + descent + leading;
     }
-    
+
     public void setWidth(float width) {
         this.width = width;
     }
@@ -255,6 +256,23 @@
         flags |= FLAGS_RIGHT_BEARING;
     }
 
+    /* This method can be used as a medium to allow the glyph layout to provided
+     * the rendered with additional data.
+     * For example, used by DirectWrite use this to transfer the glyph offsets.
+     *
+     * Should only be called after shape, and only for complex text.
+     */
+    public void setGlyphData(int index, Object data) {
+        if (glyphData == null) {
+            glyphData = new Object[glyphCount];
+        }
+        glyphData[index] = data;
+    }
+
+    public Object getGlyphData(int index) {
+        return glyphData != null ? glyphData[index] : null;
+    }
+
     public int getWrapIndex(float width) {
         if (glyphCount == 0) return 0;
         if (isLeftToRight()) {
@@ -277,10 +295,10 @@
                 }
             }
         } else {
-            /* This code is not correct. The width of the run excluding a glyph 
-             * cannot be computed by subtracting the glyph's width. Removing a 
-             * glyph from the run can change the contextual shapes for the 
-             * remaining glyphs (i.e. Arabic). The correct code is to reshape 
+            /* This code is not correct. The width of the run excluding a glyph
+             * cannot be computed by subtracting the glyph's width. Removing a
+             * glyph from the run can change the contextual shapes for the
+             * remaining glyphs (i.e. Arabic). The correct code is to reshape
              * the run excluding the given glyph. Due to performance reshaping
              * should only be used when the run has contextual shaping.
              */
@@ -298,9 +316,9 @@
         }
         return 0;
     }
-    
+
     @Override public int getGlyphCount() {
-        return glyphCount; 
+        return glyphCount;
     }
 
     @Override public int getGlyphCode(int glyphIndex) {
@@ -345,7 +363,7 @@
         }
         return 0;
     }
-    
+
     public float getAdvance(int glyphIndex) {
         if ((flags & FLAGS_COMPACT) != 0) {
             return positions[start + glyphIndex];
@@ -353,14 +371,14 @@
             return positions[(glyphIndex + 1) << 1] - positions[glyphIndex << 1];
         }
     }
-    
+
     public void shape(int count, int[] glyphs, float[] pos, int[] indices) {
         this.glyphCount = count;
         this.gids = glyphs;
         this.positions = pos;
         this.charIndices = indices;
     }
-    
+
     public void shape(int count, int[] glyphs, float[] pos) {
         this.glyphCount = count;
         this.gids = glyphs;
@@ -413,7 +431,7 @@
         if (trailing != null) trailing[0] = ltr ? 1 : 0;
         return Math.max(0, glyphCount - 1);
     }
-    
+
     public int getOffsetAtX(float x, int[] trailing) {
         if (glyphCount > 0) {
             int glyphIndex = getGlyphAtX(x, trailing);
@@ -425,25 +443,26 @@
                 if (x > width / 2) {
                     trailing[0] = 1;
                 }
-            } 
+            }
         }
         return 0;
     }
-    
+
     private void reset() {
         positions = null;
         charIndices = null;
         gids = null;
+        glyphData = null;
         width = -1;
         ascent = descent = leading = 0;
         glyphCount = 0;
     }
-    
+
     public TextRun split(int offset) {
         int newLength = length - offset;
         length = offset;
         boolean complex = isComplex();
-        TextRun newRun = new TextRun(start + length, newLength, level, complex, 
+        TextRun newRun = new TextRun(start + length, newLength, level, complex,
                                      script, span, slot, isCanonical());
         flags |= FLAGS_NO_LINK_AFTER;
         newRun.flags |= FLAGS_NO_LINK_BEFORE;
@@ -477,12 +496,13 @@
                 }
                 newRun.shape(newLength, newGlyphs, newPos, null);
             }
+            /* ignore glyphData array as it is only used for complex text */
         } else {
             reset();
         }
         return newRun;
     }
-    
+
     public void merge(TextRun run) {
         /* This method can only be used for already shaped runs in simple layout */
         if (run != null) {
@@ -495,7 +515,7 @@
     }
 
     public TextRun unwrap() {
-        TextRun newRun = new TextRun(start, length, level, isComplex(), 
+        TextRun newRun = new TextRun(start, length, level, isComplex(),
                                      script, span, slot, isCanonical());
         newRun.shape(glyphCount, gids, positions);
         newRun.setWidth(width);
@@ -503,6 +523,7 @@
         /* do not clear SPLIT here as it is still needed for merging */
         int mask = FLAGS_SOFTBREAK | FLAGS_NO_LINK_AFTER | FLAGS_NO_LINK_BEFORE;
         newRun.flags = flags & ~mask;
+        newRun.glyphData = glyphData;
         return newRun;
     }
 
@@ -516,7 +537,7 @@
                 }
                 this.width = -1;
             }
-            
+
             /* Temp code: Setting complex to true to force rendering to use
              * advances from the GlyphList instead of GlyphData
              */
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/GlassAppletWindow.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/GlassAppletWindow.java	Tue Jul 23 17:23:49 2013 -0700
@@ -34,6 +34,7 @@
 
 import java.lang.ref.WeakReference;
 import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import javafx.stage.Stage;
 
@@ -62,11 +63,16 @@
     }
     
     @Override
-    public void setBackgroundColor(int color) {
-        float RR = (float)((color >> 16) & 0xff) / 255f;
-        float GG = (float)((color >> 8)  & 0xff) / 255f;
-        float BB = (float)(color & 0xff) / 255f;
-        glassWindow.setBackground(RR, GG, BB);
+    public void setBackgroundColor(final int color) {
+        Application.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                float RR = (float) ((color >> 16) & 0xff) / 255f;
+                float GG = (float) ((color >> 8) & 0xff) / 255f;
+                float BB = (float) (color & 0xff) / 255f;
+                glassWindow.setBackground(RR, GG, BB);
+            }
+        });
     }
 
     @Override
@@ -75,38 +81,81 @@
     }
 
     @Override
-    public void setVisible(boolean state) {
-        glassWindow.setVisible(state);
+    public void setVisible(final boolean state) {
+        Application.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                glassWindow.setVisible(state);
+            }
+        });
     }
 
     @Override
-    public void setSize(int width, int height) {
-        glassWindow.setSize(width, height);
+    public void setSize(final int width, final int height) {
+        Application.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                glassWindow.setSize(width, height);
+            }
+        });
     }
 
     @Override
     public int getWidth() {
-        return glassWindow.getWidth();
+        final AtomicInteger width = new AtomicInteger(0);
+        Application.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                width.set(glassWindow.getWidth());
+            }
+        });
+        return width.get();
     }
 
     @Override
     public int getHeight() {
-        return glassWindow.getHeight();
+        final AtomicInteger height = new AtomicInteger(0);
+        Application.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                height.set(glassWindow.getHeight());
+            }
+        });
+        return height.get();
     }
 
     @Override
-    public void setPosition(int x, int y) {
-        glassWindow.setPosition(x, y);
+    public void setPosition(final int x, final int y) {
+        Application.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                glassWindow.setPosition(x, y);
+            }
+        });
     }
 
     @Override
     public int getPositionX() {
-        return glassWindow.getX();
+        AtomicInteger x = new AtomicInteger(0);
+        Application.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                x.set(glassWindow.getX());
+            }
+        });
+        return x.get();
     }
 
     @Override
     public int getPositionY() {
-        return glassWindow.getY();
+        AtomicInteger y = new AtomicInteger(0);
+        Application.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                y.set(glassWindow.getY());
+            }
+        });
+        return y.get();
     }
 
     void dispose() {
@@ -131,17 +180,27 @@
     
     @Override
     public int getRemoteLayerId() {
-        View view = this.glassWindow.getView();
-        if (view != null) {
-            return view.getNativeRemoteLayerId(this.serverName);
-        } else {
-            return -1;
-        }
+        AtomicInteger id = new AtomicInteger(-1);
+        Application.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                View view = glassWindow.getView();
+                if (view != null) {
+                    id.set(view.getNativeRemoteLayerId(serverName));
+                }
+            }
+        });
+        return id.get();
     }
     
     @Override
-    public void dispatchEvent(Map eventInfo) {
-        this.glassWindow.dispatchNpapiEvent(eventInfo);
+    public void dispatchEvent(final Map eventInfo) {
+        Application.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                glassWindow.dispatchNpapiEvent(eventInfo);
+            }
+        });
     }
     
     /**
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/GlassStage.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/GlassStage.java	Tue Jul 23 17:23:49 2013 -0700
@@ -166,7 +166,9 @@
     // Cmd+Q action
     static void requestClosingAllWindows() {
         for (final GlassStage window : windows.toArray(new GlassStage[windows.size()])) {
-            if (window.isVisible() && window.stageListener != null) {
+            // In case of child windows some of them could already be closed
+            // so check if list still contains an object
+            if (windows.contains(window) && window.isVisible() && window.stageListener != null) {
                 AccessController.doPrivileged(new PrivilegedAction<Void>() {
                     @Override
                     public Void run() {
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/MasterTimer.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/MasterTimer.java	Tue Jul 23 17:23:49 2013 -0700
@@ -43,10 +43,9 @@
  * For now it is hidden until we have some use to expose it.
  */
 public final class MasterTimer extends AbstractMasterTimer {
-    
+
     /** Prevent external instantiation of MasterTimer */
     private MasterTimer() {
-        super(true);
     }
 
     private static final Object MASTER_TIMER_KEY = new StringBuilder(
--- a/modules/graphics/src/main/java/com/sun/prism/ResourceFactory.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/prism/ResourceFactory.java	Tue Jul 23 17:23:49 2013 -0700
@@ -95,7 +95,7 @@
      * due to renderer limitations, some format conversion may be necessary so
      * the texture format may end up being different from the video image format.
      *
-     * @param vdb the video image that we need to create a new texture for
+     * @param frame the video image that we need to create a new texture for
      * @return texture most appropriate for the given video image.
      */
     public Texture createTexture(MediaFrame frame);
@@ -159,10 +159,10 @@
     public Presentable createPresentable(PresentableState pState);
     public VertexBuffer createVertexBuffer(int maxQuads);
 
-    public ShapeRep createPathRep(boolean needs3D);
-    public ShapeRep createRoundRectRep(boolean needs3D);
-    public ShapeRep createEllipseRep(boolean needs3D);
-    public ShapeRep createArcRep(boolean needs3D);
+    public ShapeRep createPathRep();
+    public ShapeRep createRoundRectRep();
+    public ShapeRep createEllipseRep();
+    public ShapeRep createArcRep();
 
     public void addFactoryListener(ResourceFactoryListener l);
     public void removeFactoryListener(ResourceFactoryListener l);
--- a/modules/graphics/src/main/java/com/sun/prism/d3d/D3DPipeline.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/prism/d3d/D3DPipeline.java	Tue Jul 23 17:23:49 2013 -0700
@@ -46,7 +46,7 @@
                 if (PrismSettings.verbose) {
                     System.out.println("Loading D3D native library ...");
                 }
-                NativeLibLoader.loadLibrary("prism-d3d");
+                NativeLibLoader.loadLibrary("prism_d3d");
                 if (PrismSettings.verbose) {
                     System.out.println("\tsucceeded.");
                 }
--- a/modules/graphics/src/main/java/com/sun/prism/es2/ES2Pipeline.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/prism/es2/ES2Pipeline.java	Tue Jul 23 17:23:49 2013 -0700
@@ -56,13 +56,13 @@
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
 
             public Void run() {
-                String libName = "prism-es2";
+                String libName = "prism_es2";
 
                 String eglType = PlatformUtil.getEmbeddedType();
                 if ("eglfb".equals(eglType))
-                    libName = "prism-es2-eglfb";
+                    libName = "prism_es2_eglfb";
                 else if ("eglx11".equals(eglType))
-                    libName = "prism-es2-eglx11";
+                    libName = "prism_es2_eglx11";
 
                 if (PrismSettings.verbose) {
                     System.out.println("Loading ES2 native library ... " + libName);
--- a/modules/graphics/src/main/java/com/sun/prism/impl/GlyphCache.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/prism/impl/GlyphCache.java	Tue Jul 23 17:23:49 2013 -0700
@@ -147,7 +147,7 @@
                 pt.x = (int)pt.x;
                 subPixelX -= pt.x;
             }
-            GlyphData data = getCachedGlyph(gc, subPixelX, 0);
+            GlyphData data = getCachedGlyph(gl, gi, subPixelX, 0);
             if (data != null) {
                 if (clip != null) {
                     // Always check clipping using user space.
@@ -240,7 +240,8 @@
         packer.clear();
     }
 
-    private GlyphData getCachedGlyph(int glyphCode, float x, float y) {
+    private GlyphData getCachedGlyph(GlyphList gl, int gi, float x, float y) {
+        int glyphCode = gl.getGlyphCode(gi);
         int segIndex = glyphCode >> SEGSHIFT;
         int subIndex = glyphCode % SEGSIZE;
         if (x != 0) {
@@ -269,7 +270,7 @@
 
         // Render the glyph and insert it in the cache
         GlyphData data = null;
-        Glyph glyph = strike.getGlyph(glyphCode);
+        Glyph glyph = strike.getGlyph(gl, gi);
         if (glyph != null) {
             if (glyph.getWidth() == 0 || glyph.getHeight() == 0) {
                 data = new GlyphData(0, 0, 0,
--- a/modules/graphics/src/main/java/com/sun/prism/impl/PrismSettings.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/prism/impl/PrismSettings.java	Tue Jul 23 17:23:49 2013 -0700
@@ -25,7 +25,6 @@
 
 package com.sun.prism.impl;
 
-import com.sun.javafx.PlatformUtil;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.Arrays;
@@ -33,6 +32,7 @@
 import java.util.List;
 import java.util.Properties;
 import java.util.StringTokenizer;
+import com.sun.javafx.PlatformUtil;
 
 /**
  * Contains the runtime arguments used by Prism.
@@ -49,8 +49,6 @@
     public static final boolean threadCheck;
     public static final boolean cacheSimpleShapes;
     public static final boolean cacheComplexShapes;
-    public static final boolean tessShapes;
-    public static final boolean tessShapesAA;
     public static final boolean useNewImageLoader;
     public static final List<String> tryOrder;
     public static final int numSamples;
@@ -154,11 +152,6 @@
             cacheComplexShapes = false;
         }
 
-        /* Shape tesselation options */
-        tessShapesAA = getBoolean(systemProperties, "prism.tessaa", false);
-        tessShapes = tessShapesAA || getBoolean(systemProperties, "prism.tess",
-                                                false);
-
         /* New javafx-iio image loader */
         useNewImageLoader = getBoolean(systemProperties, "prism.newiio", true);
 
--- a/modules/graphics/src/main/java/com/sun/prism/impl/ps/AATessArcRep.java	Tue Jul 23 09:18:52 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.prism.impl.ps;
-
-import com.sun.javafx.geom.Arc2D;
-import com.sun.javafx.geom.Shape;
-
-public class AATessArcRep extends AATessShapeRep {
-    @Override
-    protected void adjustLocation(Shape shape) {
-        Arc2D a = (Arc2D)shape;
-        savedX = a.x;
-        savedY = a.y;
-        a.x = 0f;
-        a.y = 0f;
-    }
-    @Override
-    protected void restoreLocation(Shape shape) {
-        Arc2D a = (Arc2D)shape;
-        a.x = savedX;
-        a.y = savedY;
-    }
-}
--- a/modules/graphics/src/main/java/com/sun/prism/impl/ps/AATessEllipseRep.java	Tue Jul 23 09:18:52 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.prism.impl.ps;
-
-import com.sun.javafx.geom.Ellipse2D;
-import com.sun.javafx.geom.Shape;
-
-public class AATessEllipseRep extends AATessShapeRep {
-    @Override
-    protected void adjustLocation(Shape shape) {
-        Ellipse2D e = (Ellipse2D)shape;
-        savedX = e.x;
-        savedY = e.y;
-        e.x = 0f;
-        e.y = 0f;
-    }
-    @Override
-    protected void restoreLocation(Shape shape) {
-        Ellipse2D e = (Ellipse2D)shape;
-        e.x = savedX;
-        e.y = savedY;
-    }
-}
--- a/modules/graphics/src/main/java/com/sun/prism/impl/ps/AATessRoundRectRep.java	Tue Jul 23 09:18:52 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.prism.impl.ps;
-
-import com.sun.javafx.geom.RoundRectangle2D;
-import com.sun.javafx.geom.Shape;
-
-public class AATessRoundRectRep extends AATessShapeRep {
-    @Override
-    protected void adjustLocation(Shape shape) {
-        RoundRectangle2D r = (RoundRectangle2D)shape;
-        savedX = r.x;
-        savedY = r.y;
-        r.x = 0f;
-        r.y = 0f;
-    }
-    @Override
-    protected void restoreLocation(Shape shape) {
-        RoundRectangle2D r = (RoundRectangle2D)shape;
-        r.x = savedX;
-        r.y = savedY;
-    }
-}
--- a/modules/graphics/src/main/java/com/sun/prism/impl/ps/AATessShapeRep.java	Tue Jul 23 09:18:52 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,366 +0,0 @@
-/*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.prism.impl.ps;
-
-import com.sun.javafx.geom.BaseBounds;
-import com.sun.javafx.geom.RectBounds;
-import com.sun.javafx.geom.Shape;
-import com.sun.prism.Graphics;
-import com.sun.prism.BasicStroke;
-import com.sun.prism.impl.Disposer;
-import com.sun.prism.impl.VertexBuffer;
-import com.sun.prism.paint.Color;
-import com.sun.prism.paint.Gradient;
-import com.sun.prism.paint.Paint;
-import com.sun.prism.shape.ShapeRep;
-import java.util.ArrayList;
-import java.util.List;
-import static com.sun.prism.shape.ShapeRep.InvalidationType.*;
-
-public class AATessShapeRep implements ShapeRep {
-
-    // static fields used by adjust/restoreLocation()
-    static float savedX;
-    static float savedY;
-
-    private AATessShapeRepState fillState;
-    private AATessShapeRepState drawState;
-
-    public AATessShapeRep() {
-    }
-
-    public boolean is3DCapable() {
-        return true;
-    }
-
-    public void invalidate(InvalidationType type) {
-        if (type == LOCATION_AND_GEOMETRY) {
-            if (fillState != null) {
-                fillState.invalidate();
-            }
-            if (drawState != null) {
-                drawState.invalidate();
-            }
-        }
-    }
-
-    public void fill(Graphics g, Shape shape, BaseBounds bounds) {
-        adjustLocation(shape);
-        if (fillState == null) {
-            fillState = new AATessShapeRepState();
-        }
-        fillState.render(g, shape, null, savedX, savedY);
-        restoreLocation(shape);
-    }
-
-    public void draw(Graphics g, Shape shape, BaseBounds bounds) {
-        adjustLocation(shape);
-        if (drawState == null) {
-            drawState = new AATessShapeRepState();
-        }
-        drawState.render(g, shape, g.getStroke(), savedX, savedY);
-        restoreLocation(shape);
-    }
-
-    public void dispose() {
-    }
-
-    /**
-     * Saves the current (x,y) location of the given shape and adjusts
-     * the shape location to be relative to a known point such as (0,0)
-     * so that the geometry can be cached based on that position.
-     */
-    protected void adjustLocation(Shape shape) {
-        savedX = savedY = 0f;
-    }
-
-    /**
-     * Restores the original (x,y) location of the given shape.
-     */
-    protected void restoreLocation(Shape shape) {
-    }
-}
-
-class AATessShapeRepState {
-
-    private static class GeomData {
-        CacheEntry cacheEntry;
-        VertexBuffer vbSolid;
-        VertexBuffer vbCurve;
-        int numSolidVerts;
-        int numCurveVerts;
-
-        GeomData copy() {
-            GeomData data = new GeomData();
-            data.cacheEntry     = this.cacheEntry;
-            data.vbSolid        = this.vbSolid;
-            data.vbCurve        = this.vbCurve;
-            data.numSolidVerts  = this.numSolidVerts;
-            data.numCurveVerts  = this.numCurveVerts;
-            return data;
-        }
-
-        void copyInto(GeomData other) {
-            if (other == null) {
-                throw new InternalError("MaskTexData must be non-null");
-            }
-            other.cacheEntry     = this.cacheEntry;
-            other.vbSolid        = this.vbSolid;
-            other.vbCurve        = this.vbCurve;
-            other.numSolidVerts  = this.numSolidVerts;
-            other.numCurveVerts  = this.numCurveVerts;
-        }
-    }
-
-    private static class CacheEntry {
-        Shape shape;
-        RectBounds shapeBounds;
-        GeomData geomData;
-        int refCount;
-
-        Paint lastPaint;
-        float lastExtraAlpha = -1f;
-    }
-
-    private static class GeomCache {
-        private final List<CacheEntry> entries = new ArrayList<CacheEntry>();
-
-        void get(BaseShaderContext context,
-                 GeomData geomData,
-                 Shape shape, RectBounds shapeBounds)
-        {
-            if (geomData == null) {
-                throw new InternalError("GeomData must be non-null");
-            }
-            if (geomData.cacheEntry != null) {
-                throw new InternalError("CacheEntry should already be null");
-            }
-
-            // NOTE: keep the list sorted and use binary search...
-            for (int i = 0; i < entries.size(); i++) {
-                CacheEntry entry = entries.get(i);
-
-                // first do a quick check of the bounds
-                if (dimensionsAreSimilar(shapeBounds, entry.shapeBounds)) {
-                    // the bounds match an existing entry, so now try to
-                    // match the actual shape
-                    if (entry.shape.equals(shape)) {
-                        // increment ref count for the chosen entry and
-                        // link the given geomData to it
-                        entry.refCount++;
-                        entry.geomData.copyInto(geomData);
-                        geomData.cacheEntry = entry;
-                        return;
-                    }
-                }
-            }
-
-            // did not find an existing entry; create a new one here
-            VertexBuffer vbSolid = context.getResourceFactory().createVertexBuffer(16);
-            VertexBuffer vbCurve = context.getResourceFactory().createVertexBuffer(16);
-            int[] numVerts = tess.generate(shape, vbSolid, vbCurve);
-            if (numVerts != null) {
-                // tesselation was successful
-                geomData.vbSolid = vbSolid;
-                geomData.vbCurve = vbCurve;
-                geomData.numSolidVerts = numVerts[0];
-                geomData.numCurveVerts = numVerts[1];
-            } else {
-                // tesselation failed; null out the vb references to indicate
-                // that the tesselated geometry should not be used (but we
-                // will still create a cache entry so that other identical
-                // shapes don't need to bother with the tesselation step)
-                geomData.vbSolid = null;
-                geomData.vbCurve = null;
-                geomData.numSolidVerts = 0;
-                geomData.numCurveVerts = 0;
-            }
-
-            // add the new geom data to the cache; note that we copy the
-            // shape so that dependents are not affected if the original
-            // geometry is mutated (since NGPath will reuse and mutate a
-            // single Path2D instance, for example)
-            CacheEntry entry = new CacheEntry();
-            // NOTE: if the shape was created by createStrokedShape() below,
-            // then we don't need to use the copy constructor here...
-            entry.shape = shape.copy();
-            entry.shapeBounds = new RectBounds(shapeBounds);
-            entry.geomData = geomData.copy();
-            entry.refCount = 1;
-            geomData.cacheEntry = entry;
-            entries.add(entry);
-        }
-
-        void unref(GeomData geomData) {
-            if (geomData == null) {
-                throw new InternalError("GeomData must be non-null");
-            }
-            CacheEntry entry = geomData.cacheEntry;
-            if (entry == null) {
-                return;
-            }
-            geomData.cacheEntry = null;
-            geomData.vbSolid = null;
-            geomData.vbCurve = null;
-            entry.refCount--;
-            if (entry.refCount <= 0) {
-                entry.shape = null;
-                entry.shapeBounds = null;
-                entry.geomData.vbSolid = null;
-                entry.geomData.vbCurve = null;
-                entry.geomData = null;
-                entries.remove(entry);
-            }
-        }
-
-        /**
-         * Returns true if the dimensions of the two bounding boxes are
-         * reasonably similar; otherwise returns false.  This is intended
-         * to be a quick and dirty check.
-         */
-        private static boolean dimensionsAreSimilar(RectBounds a, RectBounds b) {
-            return
-                Math.abs(a.getWidth() - b.getWidth()) < 0.001 &&
-                Math.abs(a.getHeight() - b.getHeight()) < 0.001;
-        }
-    }
-
-    private static final AATesselatorImpl tess = new AATesselatorImpl();
-    private static final GeomCache geomCache = new GeomCache();
-
-    private final GeomData geomData;
-    private Boolean useGeom = null;
-
-    private final Object disposerReferent = new Object();
-    private final Disposer.Record disposerRecord;
-
-    AATessShapeRepState() {
-        this.geomData = new GeomData();
-        this.disposerRecord = new AATessDisposerRecord(geomData);
-        Disposer.addRecord(disposerReferent, disposerRecord);
-    }
-
-    void invalidate() {
-        // Note: this method will be called from the FX thread
-        geomCache.unref(geomData);
-        useGeom = null;
-    }
-
-    void render(Graphics g, Shape shape, BasicStroke stroke, float x, float y) {
-        BaseShaderGraphics bsg = (BaseShaderGraphics)g;
-        Paint paint = bsg.getPaint();
-        float ea = bsg.getExtraAlpha();
-
-        boolean updatePaint = false;
-        if (useGeom == null) {
-            if (stroke != null) {
-                shape = stroke.createStrokedShape(shape);
-            }
-            BaseShaderContext context = bsg.getContext();
-            RectBounds shapeBounds = shape.getBounds();
-            geomCache.get(context, geomData, shape, shapeBounds);
-            if (geomData.vbSolid != null) {
-                useGeom = Boolean.TRUE;
-                updatePaint = true;
-            } else {
-                useGeom = Boolean.FALSE;
-            }
-        }
-        if (useGeom == Boolean.FALSE) {
-            // the shape could not be tesselated, so just use the normal
-            // software rasterization codepath
-
-            // RT-27376
-            // TODO: should not be using translate() here, as that will
-            // affect the way non-proportional gradients are rendered...
-            g.translate(x, y);
-            g.fill(shape);
-            g.translate(-x, -y);
-            return;
-        }
-
-        VertexBuffer vbSolid = geomData.vbSolid;
-        VertexBuffer vbCurve = geomData.vbCurve;
-        int numSolidVerts = geomData.numSolidVerts;
-        int numCurveVerts = geomData.numCurveVerts;
-
-        if (updatePaint ||
-            paint != geomData.cacheEntry.lastPaint ||
-            ea != geomData.cacheEntry.lastExtraAlpha)
-        {
-            if (paint.getType() == Paint.Type.COLOR) {
-                vbSolid.setPerVertexColor((Color)paint, ea);
-                vbSolid.updateVertexColors(numSolidVerts);
-                vbCurve.setPerVertexColor((Color)paint, ea);
-                vbCurve.updateVertexColors(numCurveVerts);
-            } else {
-                vbSolid.setPerVertexColor(ea);
-                vbSolid.updateVertexColors(numSolidVerts);
-                vbCurve.setPerVertexColor(ea);
-                vbCurve.updateVertexColors(numCurveVerts);
-            }
-            geomData.cacheEntry.lastPaint = paint;
-            geomData.cacheEntry.lastExtraAlpha = ea;
-        }
-
-        float bx = 0f, by = 0f, bw = 0f, bh = 0f;
-        if (paint.getType().isGradient() && ((Gradient)paint).isProportional()) {
-            RectBounds b = shape.getBounds();
-            bx = b.getMinX();
-            by = b.getMinY();
-            bw = b.getWidth();
-            bh = b.getHeight();
-        }
-
-        // RT-27376
-        // TODO: should not be using translate() here, as that will
-        // affect the way non-proportional gradients are rendered...
-        bsg.translate(x, y);
-        if (numSolidVerts > 0) {
-            bsg.fillTriangles(vbSolid, numSolidVerts, bx, by, bw, bh);
-        }
-        if (numCurveVerts > 0) {
-            bsg.fillCubicCurves(vbCurve, numCurveVerts, bx, by, bw, bh);
-        }
-        bsg.translate(-x, -y);
-    }
-
-    private static class AATessDisposerRecord implements Disposer.Record {
-        private GeomData geomData;
-
-        private AATessDisposerRecord(GeomData geomData) {
-            this.geomData = geomData;
-        }
-
-        public void dispose() {
-            // Note: this method will only be called from the rendering thread
-            if (geomData != null) {
-                geomCache.unref(geomData);
-                geomData = null;
-            }
-        }
-    }
-}
--- a/modules/graphics/src/main/java/com/sun/prism/impl/ps/AATesselatorImpl.java	Tue Jul 23 09:18:52 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1028 +0,0 @@
-/*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.prism.impl.ps;
-
-import com.sun.javafx.geom.Line2D;
-import com.sun.javafx.geom.PathIterator;
-import com.sun.javafx.geom.Shape;
-import com.sun.javafx.geom.Vec3f;
-import com.sun.javafx.geom.transform.BaseTransform;
-import com.sun.prism.impl.VertexBuffer;
-import java.util.ArrayList;
-import java.util.List;
-import com.sun.prism.util.tess.Tess;
-import com.sun.prism.util.tess.Tessellator;
-import com.sun.prism.util.tess.TessellatorCallbackAdapter;
-import static com.sun.prism.util.tess.Tess.*;
-
-final class AATesselatorImpl {
-
-    private static final float EPSILON = 0.0001f;
-
-    private final AATessCallbacks listener;
-    private final Tessellator tess;
-    private final float[] coords = new float[6];
-
-    AATesselatorImpl() {
-        listener = new AATessCallbacks();
-        tess = Tess.newTess();
-        Tess.tessCallback(tess, TESS_BEGIN, listener);
-        Tess.tessCallback(tess, TESS_VERTEX, listener);
-        Tess.tessCallback(tess, TESS_END, listener);
-        Tess.tessCallback(tess, TESS_COMBINE, listener);
-        Tess.tessCallback(tess, TESS_ERROR, listener);
-        // we don't care about the edge flag callback, but registering
-        // it here ensures that we only get triangles (no fans or strips)
-        Tess.tessCallback(tess, TESS_EDGE_FLAG, listener);
-    }
-
-    /**
-     * If the shape could be successfully tesselated, returns an int array
-     * with two elements (arr[0]==numSolidVerts, arr[1]==numCurveVerts);
-     * otherwise returns null (and in which case the given VertexBuffers
-     * are not modified).
-     */
-    int[] generate(Shape shape, VertexBuffer vbSolid, VertexBuffer vbCurve) {
-        listener.setVertexBuffer(vbSolid);
-
-        BaseTransform xform = BaseTransform.IDENTITY_TRANSFORM;
-        PathIterator pi = shape.getPathIterator(xform);
-
-        List<Segment> segments = new ArrayList<Segment>();
-        int numCurveVerts = 0;
-        float area = 0f;
-        float movX = 0f;
-        float movY = 0f;
-        float curX = 0f;
-        float curY = 0f;
-        float prevX = 0f;
-        float prevY = 0f;
-        float tmpX = 0f;
-        float tmpY = 0f;
-        boolean started = false;
-        while (!pi.isDone()) {
-            int type = pi.currentSegment(coords);
-            switch (type) {
-            case PathIterator.SEG_MOVETO:
-                if (started) {
-                    // NOTE: multiple subpaths not yet supported; if we do
-                    // support later we need to reset area calculations here...
-                    return null;
-                }
-                started = true;
-                movX = prevX = curX = coords[0];
-                movY = prevY = curY = coords[1];
-                segments.add(new MoveTo(curX, curY));
-                break;
-            case PathIterator.SEG_LINETO:
-                if (!hasInfOrNaN(coords, 2)) {
-                    started = true;
-                    curX = coords[0];
-                    curY = coords[1];
-                    if (curX != prevX || curY != prevY) {
-                        area += curX * prevY - prevX * curY;
-                        segments.add(new LineTo(prevX, prevY, curX, curY));
-                    }
-                    prevX = curX;
-                    prevY = curY;
-                }
-                break;
-            case PathIterator.SEG_QUADTO:
-                float ctrlx = coords[0];
-                float ctrly = coords[1];
-                coords[4] = coords[2];
-                coords[5] = coords[3];
-                coords[0] = (prevX     + 2 * ctrlx) / 3;
-                coords[1] = (prevY     + 2 * ctrly) / 3;
-                coords[2] = (coords[4] + 2 * ctrlx) / 3;
-                coords[3] = (coords[5] + 2 * ctrly) / 3;
-                if (!hasInfOrNaN(coords, 6)) {
-                    started = true;
-                    tmpX = prevX;
-                    tmpY = prevY;
-                    for (int i = 0; i < 6; i+=2) {
-                        curX = coords[i];
-                        curY = coords[i+1];
-                        area += curX * prevY - prevX * curY;
-                        prevX = curX;
-                        prevY = curY;
-                    }
-                    segments.add(new CubicTo(tmpX, tmpY,
-                                             coords[0], coords[1],
-                                             coords[2], coords[3],
-                                             curX, curY));
-                }
-                break;
-            case PathIterator.SEG_CUBICTO:
-                /*
-                 * The area calculations here are borrowed from the
-                 * ShapeEvaluator class.  In a nutshell:
-                 * - We measure the area of the polygon formed by the
-                 *   endpoints and control points of the curve.
-                 * - This technique is based on the formula for calculating
-                 *   the area of a polygon.  The standard formula is:
-                 *     Area(Poly) = 1/2 * sum(x[i]*y[i+1] - x[i+1]y[i])
-                 * - The returned area is negative if the polygon is
-                 *   "mostly clockwise" and positive if the polygon is
-                 *   "mostly counter-clockwise".
-                 * - As we walk through the PathIterator for the overall
-                 *   shape, we determine the clockwise-ness of each "local"
-                 *   segment, and then we use the accumulated area of the
-                 *   entire shape to determine the clockwise-ness of the
-                 *   overall shape.  If the two disagree for a particular
-                 *   segment, we flip the "convex" flag of that segment.
-                 */
-                if (!hasInfOrNaN(coords, 6)) {
-                    started = true;
-                    tmpX = prevX;
-                    tmpY = prevY;
-                    for (int i = 0; i < 6; i+=2) {
-                        curX = coords[i];
-                        curY = coords[i+1];
-                        area += curX * prevY - prevX * curY;
-                        prevX = curX;
-                        prevY = curY;
-                    }
-                    segments.add(new CubicTo(tmpX, tmpY,
-                                             coords[0], coords[1],
-                                             coords[2], coords[3],
-                                             curX, curY));
-                }
-                break;
-            case PathIterator.SEG_CLOSE:
-                if (started) {
-                    started = false;
-                    curX = movX;
-                    curY = movY;
-                    segments.add(new Close(prevX, prevY, movX, movY));
-                }
-                break;
-            default:
-                throw new InternalError("Unknown segment type");
-            }
-            pi.next();
-        }
-        if (started) {
-            segments.add(new Close(prevX, prevY, movX, movY));
-        }
-
-        // NOTE: for now, punt if we detect any overlapping hulls
-        for (int i = 0; i < segments.size(); i++) {
-            Segment seg = segments.get(i);
-            for (int j = i+1; j < segments.size(); j++) {
-                Segment other = segments.get(j);
-                if (seg.overlaps(other)) {
-                    //System.err.println("overlap!");
-                    return null;
-                }
-            }
-        }
-
-        //System.err.println("area: " + area);
-
-        Tess.tessProperty(tess, TESS_WINDING_RULE,
-                            (pi.getWindingRule() == PathIterator.WIND_NON_ZERO) ?
-                            TESS_WINDING_NONZERO : TESS_WINDING_ODD);
-        Tess.tessBeginPolygon(tess, null);
-        for (int i = 0; i < segments.size(); i++) {
-            Segment seg = segments.get(i);
-            if (area < 0) {
-                // reverse our earlier decision
-                seg.convex = !seg.convex;
-            }
-            numCurveVerts += seg.emitVertices(tess, vbCurve);
-        }
-        Tess.tessEndPolygon(tess);
-
-        int[] numVerts = new int[2];
-        numVerts[0] = listener.getNumVerts();
-        numVerts[1] = numCurveVerts;
-        return numVerts;
-    }
-
-    private static abstract class Segment {
-        enum Type { MOVETO, LINETO, QUADTO, CUBICTO, CLOSE }
-        final Type type;
-        boolean convex;
-        protected Segment(Type type) {
-            this.type = type;
-        }
-
-        abstract int getEdges(float[] edges);
-        abstract int emitVertices(Tessellator tess, VertexBuffer vbCurve);
-
-        private static final int[] triOffsets = {
-            0, 2, 2, 4, 4, 0,
-            6, 8, 8, 10, 10, 6,
-        };
-        private static final float[] tmpThis = new float[12];
-        private static final float[] tmpThat = new float[12];
-        boolean overlaps(Segment that) {
-            int numThis = this.getEdges(tmpThis);
-            int numThat = that.getEdges(tmpThat);
-
-            if (numThis < 1 || numThat < 1) {
-                return false;
-            }
-
-            if (numThis == 1 && numThat == 1) {
-                // simple line-line intersection
-                return linesCross(tmpThis[0], tmpThis[1], tmpThis[2], tmpThis[3],
-                                  tmpThat[0], tmpThat[1], tmpThat[2], tmpThat[3]);
-            }
-
-            // foreach tri in this
-            //   foreach line in tri
-            //     this line intersects that line?
-            //   this tri inside that tri?
-            //   that tri inside this tri?
-            int maxThis = numThis*2;
-            int maxThat = numThat*2;
-
-            // check to see if this hull intersects the other hull
-            for (int i = 0; i < maxThis; i+=2) {
-                int i0 = triOffsets[i];
-                int i1 = triOffsets[i+1];
-                for (int j = 0; j < maxThat; j+=2) {
-                    int j0 = triOffsets[j];
-                    int j1 = triOffsets[j+1];
-                    if (linesCross(tmpThis[i0+0], tmpThis[i0+1], tmpThis[i1+0], tmpThis[i1+1],
-                                   tmpThat[j0+0], tmpThat[j0+1], tmpThat[j1+0], tmpThat[j1+1]))
-                    {
-                        //System.err.println("  cross:");
-                        //System.err.printf("    %f %f %f %f\n", tmpThis[i0+0], tmpThis[i0+1], tmpThis[i1+0], tmpThis[i1+1]);
-                        //System.err.printf("    %f %f %f %f\n", tmpThat[j0+0], tmpThat[j0+1], tmpThat[j1+0], tmpThat[j1+1]);
-                        return true;
-                    }
-                }
-            }
-
-            // check to see if this hull is fully contained within
-            // the other hull, or vice versa (we only need to test whether
-            // a single point from the first hull/line is inside one of the
-            // triangles from the second hull)
-            // NOTE: maybe we need to test all points, since the first point
-            // might be coincident with a triangle edge?
-            for (int i = 0; i < numThis*2; i+=6) {
-                for (int j = 0; j < numThat*2; j+=6) {
-                    if (numThat > 1) {
-                        if (triangleContainsPoint(tmpThis[i+0], tmpThis[i+1],
-                                                  tmpThat[j+0], tmpThat[j+1],
-                                                  tmpThat[j+2], tmpThat[j+3],
-                                                  tmpThat[j+4], tmpThat[j+5]))
-                        {
-                           return true;
-                        }
-                    }
-                    if (numThis > 1) {
-                        if (triangleContainsPoint(tmpThat[j+0], tmpThat[j+1],
-                                                  tmpThis[i+0], tmpThis[i+1],
-                                                  tmpThis[i+2], tmpThis[i+3],
-                                                  tmpThis[i+4], tmpThis[i+5]))
-                        {
-                           return true;
-                        }
-                    }
-                }
-            }
-
-            return false;
-        }
-    }
-
-    private static class MoveTo extends Segment {
-        private final float x;
-        private final float y;
-        MoveTo(float x, float y) {
-            super(Type.MOVETO);
-            this.x = x;
-            this.y = y;
-        }
-        int getEdges(float[] edges) {
-            return 0;
-        }
-        int emitVertices(Tessellator tess, VertexBuffer vbCurve) {
-            Tess.tessBeginContour(tess);
-            emitVert(tess, x, y);
-            return 0;
-        }
-    }
-
-    private static class LineTo extends Segment {
-        private final float x1;
-        private final float y1;
-        private final float x2;
-        private final float y2;
-        LineTo(float x1, float y1, float x2, float y2) {
-            super(Type.LINETO);
-            this.x1 = x1;
-            this.y1 = y1;
-            this.x2 = x2;
-            this.y2 = y2;
-        }
-        int getEdges(float[] edges) {
-            edges[0] = x1;
-            edges[1] = y1;
-            edges[2] = x2;
-            edges[3] = y2;
-            return 1;
-        }
-        int emitVertices(Tessellator tess, VertexBuffer vbCurve) {
-            // NOTE: need to antialias the edges
-            emitVert(tess, x2, y2);
-            return 0;
-        }
-    }
-
-//    private static class QuadTo extends Segment {
-//        private final float x1;
-//        private final float y1;
-//        private final float ctrlx;
-//        private final float ctrly;
-//        private final float x2;
-//        private final float y2;
-//        QuadTo(float x1, float y1, float ctrlx, float ctrly, float x2, float y2) {
-//            super(Type.QUADTO);
-//            this.x1 = x1;
-//            this.y1 = y1;
-//            this.ctrlx = ctrlx;
-//            this.ctrly = ctrly;
-//            this.x2 = x2;
-//            this.y2 = y2;
-//            this.convex = Line2D.relativeCCW(x1, y1, ctrlx, ctrly, x2, y2) > 0;
-//        }
-//        int getEdges(float[] edges) {
-//            edges[0] = x1;
-//            edges[1] = y1;
-//            edges[2] = ctrlx;
-//            edges[3] = ctrly;
-//            edges[4] = x2;
-//            edges[5] = y2;
-//            return 3;
-//        }
-//        int emitVertices(Tessellator tess, VertexBuffer vbCurve) {
-//            float inv;
-//            if (convex) {
-//                // add a single line segment to the solid path
-//                emitVert(tess, x2, y2);
-//                inv = 1f; // use the regular equation for convex
-//            } else {
-//                // add two line segments to the solid path
-//                emitVert(tess, ctrlx, ctrly);
-//                emitVert(tess, x2, y2);
-//                inv = -1f; // flip the sign for concave
-//            }
-//            // add the triangle representing the quad curve
-//            vbCurve.addVert(x1,    y1,    0.0f, 0.0f, inv, 0.0f);
-//            vbCurve.addVert(ctrlx, ctrly, 0.5f, 0.0f, inv, 0.0f);
-//            vbCurve.addVert(x2,    y2,    1.0f, 1.0f, inv, 0.0f);
-//            return 3;
-//        }
-//    }
-
-    /**
-     * The calculations for classifying cubic curve segments and deriving
-     * texcoords in the emit*() methods below are based on the techniques
-     * described in "Rendering Vector Art on the GPU" (GPU Gems 3, Chapter 25).
-     */
-    private static class CubicTo extends Segment {
-        private final float x1;
-        private final float y1;
-        private final float ctrlx1;
-        private final float ctrly1;
-        private final float ctrlx2;
-        private final float ctrly2;
-        private final float x2;
-        private final float y2;
-        private final int ccw1;
-        private final int ccw2;
-        private int hullType = -1;
-
-        CubicTo(float x1, float y1,
-                float ctrlx1, float ctrly1,
-                float ctrlx2, float ctrly2,
-                float x2, float y2)
-        {
-            super(Type.CUBICTO);
-            this.x1 = x1;
-            this.y1 = y1;
-            this.ctrlx1 = ctrlx1;
-            this.ctrly1 = ctrly1;
-            this.ctrlx2 = ctrlx2;
-            this.ctrly2 = ctrly2;
-            this.x2 = x2;
-            this.y2 = y2;
-            this.ccw1 = Line2D.relativeCCW(x1, y1, ctrlx1, ctrly1, x2, y2);
-            this.ccw2 = Line2D.relativeCCW(x1, y1, ctrlx2, ctrly2, x2, y2);
-            this.convex = ccw1 > 0 && ccw2 > 0;
-        }
-
-        private int calculateHullType() {
-            if (triangleContainsPoint(x1, y1, ctrlx1, ctrly1, ctrlx2, ctrly2, x2, y2)) {
-                // endpoint 1 is inside
-                return 2;
-            } else if (triangleContainsPoint(x2, y2, x1, y1, ctrlx1, ctrly1, ctrlx2, ctrly2)) {
-                // endpoint 2 is inside
-                return 3;
-            } else if (triangleContainsPoint(ctrlx1, ctrly1, x1, y1, ctrlx2, ctrly2, x2, y2)) {
-                // control point 1 is inside
-                return 4;
-            } else if (triangleContainsPoint(ctrlx2, ctrly2, x1, y1, ctrlx1, ctrly1, x2, y2)) {
-                // control point 2 is inside
-                return 5;
-            } else {
-                if (ccw1 == ccw2) {
-                    // convex hull with control points on same side
-                    return 0;
-                } else {
-                    // convex hull with control points on opposite sides
-                    return 1;
-                }
-            }
-        }
-
-        int getEdges(float[] edges) {
-            // NOTE: this is a silly, braindead approach...
-            if (hullType < 0) {
-                hullType = calculateHullType();
-                //System.err.printf("hullType: %d %f %f %f %f %f %f %f %f\n",
-                //                  hullType, x1, y1, ctrlx1, ctrly1, ctrlx2, ctrly2, x2, y2);
-            }
-
-            switch (hullType) {
-            case 0:
-                // convex hull with control points on same side
-                edges[0] = x1;
-                edges[1] = y1;
-                edges[2] = ctrlx1;
-                edges[3] = ctrly1;
-                edges[4] = ctrlx2;
-                edges[5] = ctrly2;
-                edges[6] = x1;
-                edges[7] = y1;
-                edges[8] = ctrlx2;
-                edges[9] = ctrly2;
-                edges[10] = x2;
-                edges[11] = y2;
-                return 6;
-            case 1:
-                // convex hull with control points on opposite sides
-                edges[0] = x1;
-                edges[1] = y1;
-                edges[2] = ctrlx1;
-                edges[3] = ctrly1;
-                edges[4] = ctrlx2;
-                edges[5] = ctrly2;
-                edges[6] = ctrlx1;
-                edges[7] = ctrly1;
-                edges[8] = ctrlx2;
-                edges[9] = ctrly2;
-                edges[10] = x2;
-                edges[11] = y2;
-                return 6;
-            case 2:
-                // endpoint 1 is inside
-                edges[0] = ctrlx1;
-                edges[1] = ctrly1;
-                edges[2] = ctrlx2;
-                edges[3] = ctrly2;
-                edges[4] = x2;
-                edges[5] = y2;
-                return 3;
-            case 3:
-                // endpoint 2 is inside
-                edges[0] = x1;
-                edges[1] = y1;
-                edges[2] = ctrlx1;
-                edges[3] = ctrly1;
-                edges[4] = ctrlx2;
-                edges[5] = ctrly2;
-                return 3;
-            case 4:
-                // control point 1 is inside
-                edges[0] = x1;
-                edges[1] = y1;
-                edges[2] = ctrlx2;
-                edges[3] = ctrly2;
-                edges[4] = x2;
-                edges[5] = y2;
-                return 3;
-            case 5:
-                // control point 2 is inside
-                edges[0] = x1;
-                edges[1] = y1;
-                edges[2] = ctrlx1;
-                edges[3] = ctrly1;
-                edges[4] = x2;
-                edges[5] = y2;
-                return 3;
-            default:
-                throw new InternalError("Unknown hull type");
-            }
-        }
-
-        private static final Vec3f b0 = new Vec3f();
-        private static final Vec3f b1 = new Vec3f();
-        private static final Vec3f b2 = new Vec3f();
-        private static final Vec3f b3 = new Vec3f();
-        private static final Vec3f m0 = new Vec3f();
-        private static final Vec3f m1 = new Vec3f();
-        private static final Vec3f m2 = new Vec3f();
-        private static final Vec3f m3 = new Vec3f();
-        private static final Vec3f tmp = new Vec3f();
-        private static final float ONE_THIRD = 1f / 3f;
-        private static final float TWO_THIRDS = 2f / 3f;
-        int emitVertices(Tessellator tess, VertexBuffer vbCurve) {
-            b0.set(x1,     y1,     1);
-            b1.set(ctrlx1, ctrly1, 1);
-            b2.set(ctrlx2, ctrly2, 1);
-            b3.set(x2,     y2,     1);
-
-            tmp.cross(b3, b2);
-            float a1 = b0.dot(tmp);
-            tmp.cross(b0, b3);
-            float a2 = b1.dot(tmp);
-            tmp.cross(b1, b0);
-            float a3 = b2.dot(tmp);
-
-            float d3 = (3*a3);
-            float d2 = -a2 + d3;
-            float d1 = a1 - (2*a2) + d3;
-            // normalize to reduce range of the values
-            tmp.set(d1, d2, d3);
-            tmp.normalize();
-            d1 = tmp.x;
-            d2 = tmp.y;
-            d3 = tmp.z;
-
-            float dd = (3*d2*d2) - (4*d1*d3);
-            float discrI = d1*d1*dd;
-
-            //System.err.println(d1 + " " + d2 + " " + d3 + " " + discrI);
-
-            if (isCloseToZero(d1)) d1 = 0f;
-            if (isCloseToZero(d2)) d2 = 0f;
-            if (isCloseToZero(d3)) d3 = 0f;
-            if (isCloseToZero(discrI)) discrI = 0f;
-
-            //System.err.println("convex=" + convex + " " + ccw1 + " " + ccw2);
-            if (discrI > 0f) {
-                // serpent
-                //System.err.println("cubic: SERPENT");
-                return emitSerpent(tess, vbCurve, d1, d2, dd);
-            } else if (discrI < 0f) {
-                // loop
-                //System.err.println("cubic: LOOP");
-                return emitLoop(tess, vbCurve, d1, d2, dd);
-            } else { //if (discrI == 0f) {
-                if (d1 == 0f && d2 == 0f) {
-                    if (d3 != 0f) {
-                        // quadratic
-                        //System.err.println("cubic: QUADRATIC");
-                        return emitQuadratic(tess, vbCurve);
-                    } else {
-                        // line or point
-                        throw new InternalError("Line/point segment not yet supported");
-                    }
-                } else {
-                    // cusp
-                    throw new InternalError("Cusp segment not yet supported");
-                }
-            }
-        }
-
-        private int emitQuadratic(Tessellator tess, VertexBuffer vbCurve) {
-            float inv;
-            if (convex) {
-                // add a single line segment to the solid path
-                emitVert(tess, x2, y2);
-                inv = 1f; // use the regular equation for convex
-            } else {
-                // add line segments to the solid path
-                emitVert(tess, ctrlx1, ctrly1);
-                emitVert(tess, ctrlx2, ctrly2);
-                emitVert(tess, x2, y2);
-                inv = -1f; // flip the sign for concave
-            }
-
-            float ot = ONE_THIRD;
-            float tt = TWO_THIRDS;
-            // add the triangles representing the cubic curve
-            vbCurve.addVert(x1,     y1,     0f, 0f, 0f, inv);
-            vbCurve.addVert(ctrlx1, ctrly1, ot, 0f, ot, inv);
-            vbCurve.addVert(x2,     y2,     1f, 1f, 1f, inv);
-            vbCurve.addVert(ctrlx1, ctrly1, ot, 0f, ot, inv);
-            vbCurve.addVert(ctrlx2, ctrly2, tt, ot, tt, inv);
-            vbCurve.addVert(x2,     y2,     1f, 1f, 1f, inv);
-            return 6;
-        }
-
-        private int emitSerpent(Tessellator tess, VertexBuffer vbCurve,
-                                float d1, float d2, float dd)
-        {
-            float ltmp, mtmp;
-            float stmp = (float)Math.sqrt(3*dd);
-            float ls = (3*d2) - stmp;
-            float lt = 6*d1;
-            float ms = (3*d2) + stmp;
-            float mt = lt;
-
-            m0.x = ls*ms;
-            m0.y = ls*ls*ls;
-            m0.z = ms*ms*ms;
-
-            m1.x = ONE_THIRD * ((3*ls*ms) - (ls*mt) - (lt*ms));
-            m1.y = (ls*ls) * (ls-lt);
-            m1.z = (ms*ms) * (ms-mt);
-
-            ltmp = lt-ls;
-            mtmp = mt-ms;
-            m2.x = ONE_THIRD * ((lt * (mt - (2*ms))) + (ls * (3*ms - 2*mt)));
-            m2.y = ls * ltmp * ltmp;
-            m2.z = ms * mtmp * mtmp;
-
-            m3.x = ltmp * mtmp;
-            m3.y = -(ltmp*ltmp*ltmp);
-            m3.z = -(mtmp*mtmp*mtmp);
-
-            float inv;
-            if (ccw1 != ccw2) {
-                // control points straddle the line connecting the endpoints
-                if (ccw1 > 0) {
-                    emitVert(tess, ctrlx1, ctrly1);
-                } else {
-                    emitVert(tess, ctrlx2, ctrly2);
-                }
-                emitVert(tess, x2, y2);
-
-                inv = -1; // TODO
-
-                vbCurve.addVert(x1,     y1,     m0.x, m0.y, m0.z, inv);
-                vbCurve.addVert(ctrlx1, ctrly1, m1.x, m1.y, m1.z, inv);
-                vbCurve.addVert(ctrlx2, ctrly2, m2.x, m2.y, m2.z, inv);
-                vbCurve.addVert(ctrlx1, ctrly1, m1.x, m1.y, m1.z, inv);
-                vbCurve.addVert(ctrlx2, ctrly2, m2.x, m2.y, m2.z, inv);
-                vbCurve.addVert(x2,     y2,     m3.x, m3.y, m3.z, inv);
-                return 6;
-            } else {
-                // control points on same side of line connecting the endpoints
-                if (hullType == 4) {
-                    // control point 1 is on inside; subdivide into 3 triangles
-                    if (convex) {
-                        emitVert(tess, x2, y2);
-                        inv = -1f;
-                    } else {
-                        emitVert(tess, ctrlx2, ctrly2);
-                        emitVert(tess, x2, y2);
-                        inv = 1f;
-                    }
-                    vbCurve.addVert(x1,     y1,     m0.x, m0.y, m0.z, inv);
-                    vbCurve.addVert(ctrlx1, ctrly1, m1.x, m1.y, m1.z, inv);
-                    vbCurve.addVert(ctrlx2, ctrly2, m2.x, m2.y, m2.z, inv);
-                    vbCurve.addVert(x1,     y1,     m0.x, m0.y, m0.z, inv);
-                    vbCurve.addVert(ctrlx1, ctrly1, m1.x, m1.y, m1.z, inv);
-                    vbCurve.addVert(x2,     y2,     m3.x, m3.y, m3.z, inv);
-                    vbCurve.addVert(ctrlx1, ctrly1, m1.x, m1.y, m1.z, inv);
-                    vbCurve.addVert(ctrlx2, ctrly2, m2.x, m2.y, m2.z, inv);
-                    vbCurve.addVert(x2,     y2,     m3.x, m3.y, m3.z, inv);
-                    return 9;
-                } else if (hullType == 5) {
-                    // control point 2 is on inside; subdivide into 3 triangles
-                    if (convex) {
-                        emitVert(tess, x2, y2);
-                        inv = -1f;
-                    } else {
-                        emitVert(tess, ctrlx1, ctrly1);
-                        emitVert(tess, x2, y2);
-                        inv = 1f;
-                    }
-                    vbCurve.addVert(x1,     y1,     m0.x, m0.y, m0.z, inv);
-                    vbCurve.addVert(ctrlx1, ctrly1, m1.x, m1.y, m1.z, inv);
-                    vbCurve.addVert(ctrlx2, ctrly2, m2.x, m2.y, m2.z, inv);
-                    vbCurve.addVert(x1,     y1,     m0.x, m0.y, m0.z, inv);
-                    vbCurve.addVert(ctrlx2, ctrly2, m2.x, m2.y, m2.z, inv);
-                    vbCurve.addVert(x2,     y2,     m3.x, m3.y, m3.z, inv);
-                    vbCurve.addVert(ctrlx1, ctrly1, m1.x, m1.y, m1.z, inv);
-                    vbCurve.addVert(ctrlx2, ctrly2, m2.x, m2.y, m2.z, inv);
-                    vbCurve.addVert(x2,     y2,     m3.x, m3.y, m3.z, inv);
-                    return 9;
-                } else {
-                    // convex hull; subdivide into 2 triangles
-                    if (convex) {
-                        emitVert(tess, x2, y2);
-                        inv = -1f;
-                    } else {
-                        emitVert(tess, ctrlx1, ctrly1);
-                        emitVert(tess, ctrlx2, ctrly2);
-                        emitVert(tess, x2, y2);
-                        inv = 1f;
-                    }
-                    vbCurve.addVert(x1,     y1,     m0.x, m0.y, m0.z, inv);
-                    vbCurve.addVert(ctrlx1, ctrly1, m1.x, m1.y, m1.z, inv);
-                    vbCurve.addVert(ctrlx2, ctrly2, m2.x, m2.y, m2.z, inv);
-                    vbCurve.addVert(x1,     y1,     m0.x, m0.y, m0.z, inv);
-                    vbCurve.addVert(ctrlx2, ctrly2, m2.x, m2.y, m2.z, inv);
-                    vbCurve.addVert(x2,     y2,     m3.x, m3.y, m3.z, inv);
-                    return 6;
-                }
-            }
-        }
-
-        private int emitLoop(Tessellator tess, VertexBuffer vbCurve,
-                             float d1, float d2, float dd)
-        {
-            float ltmp, mtmp;
-
-            float stmp = (float)Math.sqrt(-dd);
-            float ls = d2 - stmp;
-            float lt = 2*d1;
-            float ms = d2 + stmp;
-            float mt = lt;
-
-            m0.x = ls*ms;
-            m0.y = ls*ls*ms;
-            m0.z = ls*ms*ms;
-
-            // Note: there was a typo in m1.x in GPU Gems 3
-            m1.x =  ONE_THIRD * (-(ls*mt) - (lt*ms) + (3*ls*ms));
-            m1.y = -ONE_THIRD * ls * ((ls*(mt-(3*ms))) + (2*lt*ms));
-            m1.z = -ONE_THIRD * ms * ((ls*((2*mt)-(3*ms))) + (lt*ms));
-
-            ltmp = lt-ls;
-            mtmp = mt-ms;
-            m2.x = ONE_THIRD * (lt*(mt-(2*ms)) + (ls*((3*ms)-(2*mt))));
-            m2.y = ONE_THIRD * ltmp * ((ls*((2*mt)-(3*ms))) + (lt*ms));
-            m2.z = ONE_THIRD * mtmp * ((ls*(mt-(3*ms))) + (2*lt*ms));
-
-            m3.x = ltmp * mtmp;
-            m3.y = -(ltmp*ltmp*mtmp);
-            m3.z = -(ltmp*mtmp*mtmp);
-
-            float inv;
-            if (convex) {
-                emitVert(tess, x2, y2);
-                inv = -1f;
-            } else {
-                emitVert(tess, ctrlx1, ctrly1);
-                emitVert(tess, ctrlx2, ctrly2);
-                emitVert(tess, x2, y2);
-                inv = 1f;
-            }
-
-            vbCurve.addVert(x1,     y1,     m0.x, m0.y, m0.z, inv);
-            vbCurve.addVert(ctrlx1, ctrly1, m1.x, m1.y, m1.z, inv);
-            vbCurve.addVert(ctrlx2, ctrly2, m2.x, m2.y, m2.z, inv);
-            vbCurve.addVert(x1,     y1,     m0.x, m0.y, m0.z, inv);
-            vbCurve.addVert(ctrlx2, ctrly2, m2.x, m2.y, m2.z, inv);
-            vbCurve.addVert(x2,     y2,     m3.x, m3.y, m3.z, inv);
-            return 6;
-        }
-    }
-
-    private static class Close extends Segment {
-        private final float x1;
-        private final float y1;
-        private final float x2;
-        private final float y2;
-        Close(float x1, float y1, float x2, float y2) {
-            super(Type.CLOSE);
-            this.x1 = x1;
-            this.y1 = y1;
-            this.x2 = x2;
-            this.y2 = y2;
-        }
-        int getEdges(float[] edges) {
-            edges[0] = x1;
-            edges[1] = y1;
-            edges[2] = x2;
-            edges[3] = y2;
-            return 1;
-        }
-        int emitVertices(Tessellator tess, VertexBuffer vbCurve) {
-            // it appears that the following will close the path automatically,
-            // so no need to issue another vertex here
-            Tess.tessEndContour(tess);
-            return 0;
-        }
-    }
-
-    /**
-     * Returns true if the given point is on (or very close to) the specified
-     * line segment.
-     * <p>
-     * Based on the implementation from Line2D.ptLineDistSq(), except using
-     * floats instead of doubles.
-     */
-    static boolean pointOnLine(float px, float py,
-                               float x1, float y1, float x2, float y2)
-    {
-        // Adjust vectors relative to x1,y1
-        // x2,y2 becomes relative vector from x1,y1 to end of segment
-        x2 -= x1;
-        y2 -= y1;
-        // px,py becomes relative vector from x1,y1 to test point
-        px -= x1;
-        py -= y1;
-        float dotprod = px * x2 + py * y2;
-        // dotprod is the length of the px,py vector
-        // projected on the x1,y1=>x2,y2 vector times the
-        // length of the x1,y1=>x2,y2 vector
-        float projlenSq = dotprod * dotprod / (x2 * x2 + y2 * y2);
-        // Distance to line is now the length of the relative point
-        // vector minus the length of its projection onto the line
-        float lenSq = px * px + py * py - projlenSq;
-        return lenSq < EPSILON;
-    }
-
-    /**
-     * Returns true if the line segments intersect and are not coincident.
-     * <p>
-     * Based on "Faster Line Segment Intersection" by Franklin Antonio
-     * (from Graphics Gems III).
-     */
-    static boolean linesCross(float x1, float y1,
-                              float x2, float y2,
-                              float x3, float y3,
-                              float x4, float y4)
-    {
-        if (pointOnLine(x1, y1, x3, y3, x4, y4) ||
-            pointOnLine(x2, y2, x3, y3, x4, y4) ||
-            pointOnLine(x3, y3, x1, y1, x2, y2) ||
-            pointOnLine(x4, y4, x1, y1, x2, y2))
-        {
-            // the line segments share an endpoint, or the endpoint of one
-            // line touches the other line segment without crossing it
-            return false;
-        }
-
-        float ax = x2-x1;
-        float ay = y2-y1;
-        float bx = x3-x4;
-        float by = y3-y4;
-        float denom = (ay*bx) - (ax*by);
-        if (isCloseToZero(denom)) {
-            // the line segments are coincident
-            return false;
-        }
-        float cx = x1-x3;
-        float cy = y1-y3;
-        float p = (by*cx) - (bx*cy);
-        if (denom > 0) {
-            if (p < 0 || p > denom) {
-                return false;
-            }
-        } else {
-            if (p > 0 || p < denom) {
-                return false;
-            }
-        }
-        float q = (ax*cy) - (ay*cx);
-        if (denom > 0) {
-            if (q < 0 || q > denom) {
-                return false;
-            }
-        } else {
-            if (q > 0 || q < denom) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Returns true if the given point (px,py) is inside the triangle
-     * extending from (x1,y1) to (x2,y2) to (x3,y3), or returns false if
-     * the point is outside or coincident with the triangle.
-     * <p>
-     * Based on algorithm described at:
-     *   http://mathworld.wolfram.com/TriangleInterior.html
-     */
-    static boolean triangleContainsPoint(float px, float py,
-                                         float x1, float y1,
-                                         float x2, float y2,
-                                         float x3, float y3)
-    {
-        px -= x1;
-        py -= y1;
-        x2 -= x1;
-        y2 -= y1;
-        x3 -= x1;
-        y3 -= y1;
-
-        float denom = (x2*y3) - (x3*y2);
-        if (isCloseToZero(denom)) {
-            // TODO: triangle is actually a line?
-            return false;
-        }
-
-        float a = ((px*y3) - (py*x3)) / denom;
-        float b = ((px*y2) - (py*x2)) / -denom;
-
-        return (a > 0) && (b > 0) && (a+b < 1);
-    }
-
-    static boolean isCloseToZero(float x) {
-        return x < EPSILON && x > -EPSILON;
-    }
-
-    /**
-     * Returns true if any of {@code num} elements in the given array
-     * are Inf or NaN.  Ideally PathIterators would never produce segments
-     * with these values, but they are sometimes seen in practice and can
-     * confuse the Tessellator, so it is a good idea to protect against
-     * them here.
-     */
-    static boolean hasInfOrNaN(float[] coords, int num) {
-        for (int i = 0; i < num; i++) {
-            if (Float.isInfinite(coords[i]) || Float.isNaN(coords[i])) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    static void emitVert(Tessellator tess, float x, float y) {
-        double[] vert = new double[] { x, y, 0 }; // TODO: reduce garbage
-        Tess.tessVertex(tess, vert, 0, vert);
-    }
-}
-
-class AATessCallbacks extends TessellatorCallbackAdapter {
-
-    private int nPrims = 0;
-    private int nVerts = 0;
-    private VertexBuffer vb;
-
-    public void setVertexBuffer(VertexBuffer vb) {
-        this.vb = vb;
-        nPrims = 0;
-        nVerts = 0;
-    }
-
-    public int getNumVerts() {
-        return nVerts;
-    }
-
-    @Override
-    public void begin(int primType) {
-        if (primType != GL_TRIANGLES) {
-            throw new InternalError("Only GL_TRIANGLES is supported");
-        }
-        nVerts = 0;
-    }
-
-    @Override
-    public void end() {
-        nPrims++;
-    }
-
-    @Override
-    public void vertex(Object vertexData) {
-        double[] coords = (double[]) vertexData;
-        vb.addVert((float)coords[0], (float)coords[1]);
-        nVerts++;
-    }
-
-    @Override
-    public void edgeFlag(boolean edge) {
-    }
-
-    @Override
-    public void combine(double[] coords, Object[] data,
-                        float[] weight, Object[] outData)
-    {
-        double[] vertex = new double[3];
-        for (int i = 0; i < 3; i++) {
-            vertex[i] = coords[i];
-        }
-        outData[0] = vertex;
-    }
-
-    @Override
-    public void error(int errorNumber) {
-        System.err.println("Tesselation error " + errorNumber);
-    }
-}
--- a/modules/graphics/src/main/java/com/sun/prism/impl/ps/BaseShaderFactory.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/prism/impl/ps/BaseShaderFactory.java	Tue Jul 23 17:23:49 2013 -0700
@@ -36,43 +36,23 @@
 public abstract class BaseShaderFactory extends BaseResourceFactory
     implements ShaderFactory
 {
-    public ShapeRep createPathRep(boolean needs3D) {
-        if (needs3D || PrismSettings.tessShapes) {
-            return PrismSettings.tessShapesAA ?
-                new AATessShapeRep() : new TessShapeRep();
-        } else {
-            return PrismSettings.cacheComplexShapes ?
+    public ShapeRep createPathRep() {
+        return PrismSettings.cacheComplexShapes ?
                 new CachingShapeRep() : new BasicShapeRep();
-        }
     }
 
-    public ShapeRep createRoundRectRep(boolean needs3D) {
-        if (needs3D || PrismSettings.tessShapes) {
-            return PrismSettings.tessShapesAA ?
-                new AATessRoundRectRep() : new TessRoundRectRep();
-        } else {
-            return PrismSettings.cacheSimpleShapes ?
-                new CachingRoundRectRep() : new BasicRoundRectRep();
-        }
+    public ShapeRep createRoundRectRep() {
+        return PrismSettings.cacheSimpleShapes ?
+            new CachingRoundRectRep() : new BasicRoundRectRep();
     }
 
-    public ShapeRep createEllipseRep(boolean needs3D) {
-        if (needs3D || PrismSettings.tessShapes) {
-            return PrismSettings.tessShapesAA ?
-                new AATessEllipseRep() : new TessEllipseRep();
-        } else {
-            return PrismSettings.cacheSimpleShapes ?
-                new CachingEllipseRep() : new BasicEllipseRep();
-        }
+    public ShapeRep createEllipseRep() {
+        return PrismSettings.cacheSimpleShapes ?
+            new CachingEllipseRep() : new BasicEllipseRep();
     }
 
-    public ShapeRep createArcRep(boolean needs3D) {
-        if (needs3D || PrismSettings.tessShapes) {
-            return PrismSettings.tessShapesAA ?
-                new AATessArcRep() : new TessArcRep();
-        } else {
-            return PrismSettings.cacheComplexShapes ?
-                new CachingShapeRep() : new BasicShapeRep();
-        }
+    public ShapeRep createArcRep() {
+        return PrismSettings.cacheComplexShapes ?
+            new CachingShapeRep() : new BasicShapeRep();
     }
 }
--- a/modules/graphics/src/main/java/com/sun/prism/impl/ps/PaintHelper.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/prism/impl/ps/PaintHelper.java	Tue Jul 23 17:23:49 2013 -0700
@@ -25,14 +25,17 @@
 
 package com.sun.prism.impl.ps;
 
+import java.nio.ByteBuffer;
+import java.nio.FloatBuffer;
+import java.util.List;
 import com.sun.javafx.geom.PickRay;
 import com.sun.javafx.geom.Point2D;
 import com.sun.javafx.geom.Vec3d;
 import com.sun.javafx.geom.transform.Affine2D;
 import com.sun.javafx.geom.transform.Affine3D;
 import com.sun.javafx.geom.transform.AffineBase;
+import com.sun.javafx.geom.transform.BaseTransform;
 import com.sun.javafx.geom.transform.NoninvertibleTransformException;
-import com.sun.javafx.geom.transform.BaseTransform;
 import com.sun.prism.Image;
 import com.sun.prism.PixelFormat;
 import com.sun.prism.ResourceFactory;
@@ -42,17 +45,14 @@
 import com.sun.prism.camera.PrismCameraImpl;
 import com.sun.prism.camera.PrismPerspectiveCameraImpl;
 import com.sun.prism.impl.BufferUtil;
-import com.sun.prism.ps.Shader;
 import com.sun.prism.paint.Color;
 import com.sun.prism.paint.Gradient;
+import com.sun.prism.paint.ImagePattern;
 import com.sun.prism.paint.LinearGradient;
 import com.sun.prism.paint.RadialGradient;
-import com.sun.prism.paint.ImagePattern;
 import com.sun.prism.paint.Stop;
+import com.sun.prism.ps.Shader;
 import com.sun.prism.ps.ShaderGraphics;
-import java.nio.ByteBuffer;
-import java.nio.FloatBuffer;
-import java.util.List;
 
 class PaintHelper {
 
--- a/modules/graphics/src/main/java/com/sun/prism/impl/ps/TessArcRep.java	Tue Jul 23 09:18:52 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.prism.impl.ps;
-
-import com.sun.javafx.geom.Arc2D;
-import com.sun.javafx.geom.Shape;
-
-public class TessArcRep extends TessShapeRep {
-    @Override
-    protected void adjustLocation(Shape shape) {
-        Arc2D a = (Arc2D)shape;
-        savedX = a.x;
-        savedY = a.y;
-        a.x = 0f;
-        a.y = 0f;
-    }
-    @Override
-    protected void restoreLocation(Shape shape) {
-        Arc2D a = (Arc2D)shape;
-        a.x = savedX;
-        a.y = savedY;
-    }
-}
--- a/modules/graphics/src/main/java/com/sun/prism/impl/ps/TessEllipseRep.java	Tue Jul 23 09:18:52 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.prism.impl.ps;
-
-import com.sun.javafx.geom.Ellipse2D;
-import com.sun.javafx.geom.Shape;
-
-public class TessEllipseRep extends TessShapeRep {
-    @Override
-    protected void adjustLocation(Shape shape) {
-        Ellipse2D e = (Ellipse2D)shape;
-        savedX = e.x;
-        savedY = e.y;
-        e.x = 0f;
-        e.y = 0f;
-    }
-    @Override
-    protected void restoreLocation(Shape shape) {
-        Ellipse2D e = (Ellipse2D)shape;
-        e.x = savedX;
-        e.y = savedY;
-    }
-}
--- a/modules/graphics/src/main/java/com/sun/prism/impl/ps/TessRoundRectRep.java	Tue Jul 23 09:18:52 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.prism.impl.ps;
-
-import com.sun.javafx.geom.RoundRectangle2D;
-import com.sun.javafx.geom.Shape;
-
-public class TessRoundRectRep extends TessShapeRep {
-    @Override
-    protected void adjustLocation(Shape shape) {
-        RoundRectangle2D r = (RoundRectangle2D)shape;
-        savedX = r.x;
-        savedY = r.y;
-        r.x = 0f;
-        r.y = 0f;
-    }
-    @Override
-    protected void restoreLocation(Shape shape) {
-        RoundRectangle2D r = (RoundRectangle2D)shape;
-        r.x = savedX;
-        r.y = savedY;
-    }
-}
--- a/modules/graphics/src/main/java/com/sun/prism/impl/ps/TessShapeRep.java	Tue Jul 23 09:18:52 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.prism.impl.ps;
-
-import com.sun.javafx.geom.BaseBounds;
-import com.sun.prism.impl.shape.*;
-import com.sun.javafx.geom.RectBounds;
-import com.sun.javafx.geom.Shape;
-import com.sun.prism.Graphics;
-import com.sun.prism.BasicStroke;
-import com.sun.prism.impl.BaseGraphics;
-import com.sun.prism.impl.VertexBuffer;
-import com.sun.prism.paint.Color;
-import com.sun.prism.paint.Paint;
-import com.sun.prism.shape.ShapeRep;
-import static com.sun.prism.shape.ShapeRep.InvalidationType.*;
-
-public class TessShapeRep implements ShapeRep {
-
-    // static fields used by adjust/restoreLocation()
-    static float savedX;
-    static float savedY;
-
-    private TessShapeRepState fillState;
-    private TessShapeRepState drawState;
-
-    public TessShapeRep() {
-    }
-
-    public boolean is3DCapable() {
-        return true;
-    }
-
-    public void invalidate(InvalidationType type) {
-        if (type == LOCATION_AND_GEOMETRY) {
-            if (fillState != null) {
-                fillState.invalidate();
-            }
-            if (drawState != null) {
-                drawState.invalidate();
-            }
-        }
-    }
-
-    public void fill(Graphics g, Shape shape, BaseBounds bounds) {
-        adjustLocation(shape);
-        if (fillState == null) {
-            fillState = new TessShapeRepState();
-        }
-        fillState.render(g, shape, null, savedX, savedY);
-        restoreLocation(shape);
-    }
-
-    public void draw(Graphics g, Shape shape, BaseBounds bounds) {
-        adjustLocation(shape);
-        if (drawState == null) {
-            drawState = new TessShapeRepState();
-        }
-        drawState.render(g, shape, g.getStroke(), savedX, savedY);
-        restoreLocation(shape);
-    }
-
-    public void dispose() {
-    }
-
-    /**
-     * Saves the current (x,y) location of the given shape and adjusts
-     * the shape location to be relative to a known point such as (0,0)
-     * so that the geometry can be cached based on that position.
-     */
-    protected void adjustLocation(Shape shape) {
-        savedX = savedY = 0f;
-    }
-
-    /**
-     * Restores the original (x,y) location of the given shape.
-     */
-    protected void restoreLocation(Shape shape) {
-    }
-}
-
-class TessShapeRepState {
-    private static final TesselatorImpl tess = new TesselatorImpl();
-
-    private boolean valid;
-    private VertexBuffer vb;
-    private int numVerts;
-    private Paint lastPaint;
-    private float lastExtraAlpha = -1f;
-
-    void invalidate() {
-        valid = false;
-        lastPaint = null;
-        lastExtraAlpha = -1f;
-    }
-
-    void render(Graphics g, Shape shape, BasicStroke stroke, float x, float y) {
-        BaseGraphics bg = (BaseGraphics)g;
-        Paint paint = bg.getPaint();
-        float ea = bg.getExtraAlpha();
-        if (vb == null) {
-            vb = g.getResourceFactory().createVertexBuffer(16);
-        }
-        boolean updatePaint = false;
-        if (!valid) {
-            numVerts = generate(shape, stroke, vb);
-            valid = true;
-            updatePaint = true;
-        }
-        if (updatePaint || paint != lastPaint || ea != lastExtraAlpha) {
-            if (paint.getType() == Paint.Type.COLOR) {
-                vb.setPerVertexColor((Color)paint, ea);
-                vb.updateVertexColors(numVerts);
-            } else {
-                vb.setPerVertexColor(ea);
-                vb.updateVertexColors(numVerts);
-            }
-
-            lastPaint = paint;
-            lastExtraAlpha = ea;
-        }
-
-        float bx = 0f, by = 0f, bw = 0f, bh = 0f;
-        if (paint.isProportional()) {
-            RectBounds b = shape.getBounds();
-            bx = b.getMinX();
-            by = b.getMinY();
-            bw = b.getWidth();
-            bh = b.getHeight();
-        }
-
-        // RT-27376
-        // TODO: should not be using translate() here, as that will
-        // affect the way non-proportional gradients are rendered...
-        bg.translate(x, y);
-        bg.fillTriangles(vb, numVerts, bx, by, bw, bh);
-        bg.translate(-x, -y);
-    }
-
-    private int generate(Shape shape, BasicStroke stroke, VertexBuffer vb) {
-        if (stroke != null) {
-            shape = stroke.createStrokedShape(shape);
-        }
-        vb.rewind();
-        return tess.generate(shape, vb);
-    }
-}
--- a/modules/graphics/src/main/java/com/sun/prism/impl/shape/NativePiscesRasterizer.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/prism/impl/shape/NativePiscesRasterizer.java	Tue Jul 23 17:23:49 2013 -0700
@@ -68,7 +68,7 @@
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
             @Override
             public Void run() {
-                String libName = "prism-common";
+                String libName = "prism_common";
 
                 if (PrismSettings.verbose) {
                     System.out.println("Loading Prism common native library ...");
--- a/modules/graphics/src/main/java/com/sun/prism/impl/shape/TesselatorImpl.java	Tue Jul 23 09:18:52 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,183 +0,0 @@
-/*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.prism.impl.shape;
-
-import com.sun.javafx.geom.PathIterator;
-import com.sun.javafx.geom.Shape;
-import com.sun.javafx.geom.transform.BaseTransform;
-import com.sun.prism.impl.VertexBuffer;
-import com.sun.prism.util.tess.Tess;
-import com.sun.prism.util.tess.Tessellator;
-import com.sun.prism.util.tess.TessellatorCallbackAdapter;
-import static com.sun.prism.util.tess.Tess.*;
-
-public final class TesselatorImpl {
-
-    private final TessCallbacks listener;
-    private final Tessellator tess;
-    private final float[] coords = new float[6];
-
-    public TesselatorImpl() {
-        listener = new TessCallbacks();
-        tess = Tess.newTess();
-        Tess.tessCallback(tess, TESS_BEGIN, listener);
-        Tess.tessCallback(tess, TESS_VERTEX, listener);
-        Tess.tessCallback(tess, TESS_END, listener);
-        Tess.tessCallback(tess, TESS_COMBINE, listener);
-        Tess.tessCallback(tess, TESS_ERROR, listener);
-        // we don't care about the edge flag callback, but registering
-        // it here ensures that we only get triangles (no fans or strips)
-        Tess.tessCallback(tess, TESS_EDGE_FLAG, listener);
-    }
-
-    /**
-     * @return the number of vertices added to the given vertex buffer
-     */
-    public int generate(Shape shape, VertexBuffer vb) {
-        listener.setVertexBuffer(vb);
-
-        BaseTransform xform = BaseTransform.IDENTITY_TRANSFORM;
-        PathIterator pi = shape.getPathIterator(xform, 1f/*TODO*/);
-        Tess.tessProperty(tess, TESS_WINDING_RULE,
-                            (pi.getWindingRule() == PathIterator.WIND_NON_ZERO) ?
-                            TESS_WINDING_NONZERO : TESS_WINDING_ODD);
-
-        double[] vert;
-        boolean started = false;
-        Tess.tessBeginPolygon(tess, null);
-        while (!pi.isDone()) {
-            int type = pi.currentSegment(coords);
-            switch (type) {
-            case PathIterator.SEG_MOVETO:
-                if (started) {
-                    Tess.tessEndContour(tess);
-                }
-                Tess.tessBeginContour(tess);
-                started = true;
-                // TODO: reduce garbage
-                vert = new double[] { coords[0], coords[1], 0 };
-                Tess.tessVertex(tess, vert, 0, vert);
-                break;
-            case PathIterator.SEG_LINETO:
-                if (!hasInfOrNaN(coords, 2)) {
-                    started = true;
-                    vert = new double[] { coords[0], coords[1], 0 };
-                    Tess.tessVertex(tess, vert, 0, vert);
-                }
-                break;
-            case PathIterator.SEG_CLOSE:
-                if (started) {
-                    Tess.tessEndContour(tess);
-                    started = false;
-                }
-                break;
-            default:
-                throw new InternalError("Path must be flattened");
-            }
-            pi.next();
-        }
-        if (started) {
-            Tess.tessEndContour(tess);
-        }
-        Tess.tessEndPolygon(tess);
-
-        return listener.getNumVerts();
-    }
-
-    /**
-     * Returns true if any of {@code num} elements in the given array
-     * are Inf or NaN.  Ideally PathIterators would never produce segments
-     * with these values, but they are sometimes seen in practice and can
-     * confuse the Tessellator, so it is a good idea to protect against
-     * them here.
-     */
-    private static boolean hasInfOrNaN(float[] coords, int num) {
-        for (int i = 0; i < num; i++) {
-            if (Float.isInfinite(coords[i]) || Float.isNaN(coords[i])) {
-                return true;
-            }
-        }
-        return false;
-    }
-}
-
-class TessCallbacks extends TessellatorCallbackAdapter {
-
-    private int nPrims = 0;
-    private int nVerts = 0;
-    private VertexBuffer vb;
-
-    public void setVertexBuffer(VertexBuffer vb) {
-        this.vb = vb;
-        nPrims = 0;
-        nVerts = 0;
-    }
-
-    public int getNumVerts() {
-        return nVerts;
-    }
-
-    @Override
-    public void begin(int primType) {
-        if (primType != GL_TRIANGLES) {
-            throw new InternalError("Only GL_TRIANGLES is supported");
-        }
-        nVerts = 0;
-    }
-
-    @Override
-    public void end() {
-        nPrims++;
-        //System.out.println("End primitive: " + nPrims + " " + nVerts);
-    }
-
-    @Override
-    public void vertex(Object vertexData) {
-        double[] coords = (double[]) vertexData;
-        vb.addVert((float)coords[0], (float)coords[1]);
-        nVerts++;
-    }
-
-    @Override
-    public void edgeFlag(boolean edge) {
-    }
-
-    @Override
-    public void combine(double[] coords, Object[] data,
-                        float[] weight, Object[] outData)
-    {
-        double[] vertex = new double[3];
-        for (int i = 0; i < 3; i++) {
-            vertex[i] = coords[i];
-        }
-        outData[0] = vertex;
-    }
-
-    @Override
-    public void error(int errorNumber) {
-        System.err.println("Tesselation error " + errorNumber);
-    }
-}
--- a/modules/graphics/src/main/java/com/sun/prism/j2d/J2DResourceFactory.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/prism/j2d/J2DResourceFactory.java	Tue Jul 23 17:23:49 2013 -0700
@@ -61,19 +61,19 @@
 
     private static ShapeRep theRep = new BasicShapeRep();
 
-    public ShapeRep createArcRep(boolean needs3D) {
+    public ShapeRep createArcRep() {
         return theRep;
     }
 
-    public ShapeRep createEllipseRep(boolean needs3D) {
+    public ShapeRep createEllipseRep() {
         return theRep;
     }
 
-    public ShapeRep createRoundRectRep(boolean needs3D) {
+    public ShapeRep createRoundRectRep() {
         return theRep;
     }
 
-    public ShapeRep createPathRep(boolean needs3D) {
+    public ShapeRep createPathRep() {
         return theRep;
     }
 
--- a/modules/graphics/src/main/java/com/sun/prism/sw/SWGraphics.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/prism/sw/SWGraphics.java	Tue Jul 23 17:23:49 2013 -0700
@@ -333,11 +333,19 @@
                 }
 
                 paintTx.setTransform(tx);
+                convertToPiscesTransform(paintTx, piscesTx);
+
+                float x1 = lg.getX1();
+                float y1 = lg.getY1();
+                float x2 = lg.getX2();
+                float y2 = lg.getY2();
                 if (lg.isProportional()) {
-                    paintTx.deriveWithConcatenation(width, 0, 0, height, x, y);
+                    x1 = x + width * x1;
+                    y1 = y + height * y1;
+                    x2 = x + width * x2;
+                    y2 = y + height * y2;
                 }
-                convertToPiscesTransform(paintTx, piscesTx);
-                this.pr.setLinearGradient((int)(TO_PISCES * lg.getX1()), (int)(TO_PISCES * lg.getY1()), (int)(TO_PISCES * lg.getX2()), (int)(TO_PISCES * lg.getY2()),
+                this.pr.setLinearGradient((int)(TO_PISCES * x1), (int)(TO_PISCES * y1), (int)(TO_PISCES * x2), (int)(TO_PISCES * y2),
                     getFractions(lg), getARGB(lg, this.compositeAlpha), getPiscesGradientCycleMethod(lg.getSpreadMethod()), piscesTx);
                 break;
             case RADIAL_GRADIENT:
@@ -347,13 +355,29 @@
                 }
 
                 paintTx.setTransform(tx);
+
+                float cx = rg.getCenterX();
+                float cy = rg.getCenterY();
+                float r = rg.getRadius();
                 if (rg.isProportional()) {
-                    paintTx.deriveWithConcatenation(width, 0, 0, height, x, y);
+                    float dim = Math.min(width, height);
+                    float bcx = x + width * 0.5f;
+                    float bcy = y + height * 0.5f;
+                    cx = bcx + (cx - 0.5f) * dim;
+                    cy = bcy + (cy - 0.5f) * dim;
+                    r *= dim;
+                    if (width != height && width != 0.0 && height != 0.0) {
+                        paintTx.deriveWithTranslation(bcx, bcy);
+                        paintTx.deriveWithConcatenation(width / dim, 0, 0, height / dim, 0, 0);
+                        paintTx.deriveWithTranslation(-bcx, -bcy);
+                    }
                 }
                 convertToPiscesTransform(paintTx, piscesTx);
-                final float fx = (float)(rg.getCenterX() + rg.getFocusDistance() * rg.getRadius() * Math.cos(Math.toRadians(rg.getFocusAngle())));
-                final float fy = (float)(rg.getCenterY() + rg.getFocusDistance() * rg.getRadius() * Math.sin(Math.toRadians(rg.getFocusAngle())));
-                this.pr.setRadialGradient((int) (TO_PISCES * rg.getCenterX()), (int) (TO_PISCES * rg.getCenterY()), (int) (TO_PISCES * fx), (int) (TO_PISCES * fy), (int) (TO_PISCES * rg.getRadius()),
+
+                final float fx = (float)(cx + rg.getFocusDistance() * r * Math.cos(Math.toRadians(rg.getFocusAngle())));
+                final float fy = (float)(cy + rg.getFocusDistance() * r * Math.sin(Math.toRadians(rg.getFocusAngle())));
+
+                this.pr.setRadialGradient((int) (TO_PISCES * cx), (int) (TO_PISCES * cy), (int) (TO_PISCES * fx), (int) (TO_PISCES * fy), (int) (TO_PISCES * r),
                         getFractions(rg), getARGB(rg, this.compositeAlpha), getPiscesGradientCycleMethod(rg.getSpreadMethod()), piscesTx);
                 break;
             case IMAGE_PATTERN:
@@ -584,8 +608,17 @@
             }
             return;
         }
+        this.setPaintFromShape(shape, tr, 0,0,0,0);
+        this.paintShapePaintAlreadySet(shape, st, tr);
+    }
 
-        this.setPaintFromShape(shape, tr, 0,0,0,0);
+    private void paintShapePaintAlreadySet(Shape shape, BasicStroke st, BaseTransform tr) {
+        if (this.finalClip.isEmpty()) {
+            if (PrismSettings.debug) {
+                System.out.println("Final clip is empty: not rendering the shape: " + shape);
+            }
+            return;
+        }
 
         if (PrismSettings.debug) {
             System.out.println("GR: " + this);
@@ -687,28 +720,6 @@
                     ", selectStart: " + selectStart + ", selectEnd: " + selectEnd);
         }
 
-        int selectGlyphStart = -1;
-        int selectGlyphEnd = -1;
-        if ((selectColor != null) && (selectStart < selectEnd)) {
-            // convert selectStart / selectEnd from char indexes to glyph indexes
-            int i = 0;
-            while (i < gl.getGlyphCount()) {
-                if (gl.getCharOffset(i) >= selectStart) {
-                    selectGlyphStart = i;
-                    selectGlyphEnd = gl.getGlyphCount();
-                    break;
-                }
-                i++;
-            }
-            while (i < gl.getGlyphCount()) {
-                if (gl.getCharOffset(i) >= selectEnd) {
-                    selectGlyphEnd = i;
-                    break;
-                }
-                i++;
-            }
-        }
-
         final float bx, by, bw, bh;
         if (paint.isProportional()) {
             if (nodeBounds != null) {
@@ -727,80 +738,73 @@
             bx = by = bw = bh = 0;
         }
 
-        // check for selection that is out of range of this line (TextArea)
-        if ((selectGlyphStart < 0 && selectGlyphEnd < 0)||(selectGlyphStart >= gl.getGlyphCount() && selectGlyphEnd >= gl.getGlyphCount())) {
-            this.drawStringInternal(gl, strike, x, y, 0, gl.getGlyphCount(), this.paint, bx, by, bw, bh);
+        final boolean drawAsMasks = tx.isTranslateOrIdentity() && (!strike.drawAsShapes());
+        final boolean doLCDText = drawAsMasks &&
+                (strike.getAAMode() == FontResource.AA_LCD) &&
+                getRenderTarget().isOpaque() &&
+                (this.paint.getType() == Paint.Type.COLOR) &&
+                tx.is2D();
+        BaseTransform glyphTx = null;
+
+        if (doLCDText) {
+            this.pr.setLCDGammaCorrection(1f / PrismFontFactory.getLCDContrast());
+        } else if (drawAsMasks) {
+            final FontResource fr = strike.getFontResource();
+            final float origSize = strike.getSize();
+            final BaseTransform origTx = strike.getTransform();
+            strike = fr.getStrike(origSize, origTx, FontResource.AA_GREYSCALE);
         } else {
-            float advanceX = 0;
-            if (selectGlyphStart > 0) {
-                advanceX = this.drawStringInternal(gl, strike, x, y, 0, selectGlyphStart, this.paint, bx, by, bw, bh);
+            glyphTx = new Affine2D();
+        }
+
+        if (selectColor == null) {
+            this.setPaintBeforeDraw(this.paint, bx, by, bw, bh);
+            for (int i = 0; i < gl.getGlyphCount(); i++) {
+                this.drawGlyph(strike, gl, i, glyphTx, drawAsMasks, x, y);
             }
-            advanceX += this.drawStringInternal(gl, strike, x+advanceX, y,
-                                                Math.max(0, selectGlyphStart), Math.min(gl.getGlyphCount(), selectGlyphEnd),
-                                                selectColor, 0, 0, 0, 0);
-            if (selectGlyphEnd < gl.getGlyphCount()) {
-                this.drawStringInternal(gl, strike, x+advanceX, y, selectGlyphEnd, gl.getGlyphCount(),
-                                        this.paint, bx, by, bw, bh);
+        } else {
+            for (int i = 0; i < gl.getGlyphCount(); i++) {
+                final int offset = gl.getCharOffset(i);
+                final boolean selected = selectStart <= offset && offset < selectEnd;
+                this.setPaintBeforeDraw(selected ? selectColor : this.paint, bx, by, bw, bh);
+                this.drawGlyph(strike, gl, i, glyphTx, drawAsMasks, x, y);
             }
         }
     }
 
-    private float drawStringInternal(GlyphList gl, FontStrike strike, float x, float y, int strFrom, int strTo,
-                                     Paint p, float bx, float by, float bw, float bh)
+    private void drawGlyph(FontStrike strike, GlyphList gl, int idx, BaseTransform glyphTx,
+                           boolean drawAsMasks, float x, float y)
     {
-        float advanceX = 0;
-        if (tx.isTranslateOrIdentity() && (!strike.drawAsShapes())) {
-            final boolean doLCDText = (strike.getAAMode() == FontResource.AA_LCD) &&
-                    getRenderTarget().isOpaque() &&
-                    (p.getType() == Paint.Type.COLOR) &&
-                    tx.is2D();
 
-            if (doLCDText) {
-                this.pr.setLCDGammaCorrection(1f / PrismFontFactory.getLCDContrast());
-            } else {
-                final FontResource fr = strike.getFontResource();
-                final float origSize = strike.getSize();
-                final BaseTransform origTx = strike.getTransform();
-                strike = fr.getStrike(origSize, origTx, FontResource.AA_GREYSCALE);
-            }
-            this.setPaintBeforeDraw(p, bx, by, bw, bh);
-
-            for (int i = strFrom; i < strTo; i++) {
-                final Glyph g = strike.getGlyph(gl.getGlyphCode(i));
-                final byte pixelData[] = g.getPixelData();
-                if (pixelData != null) {
-                    if (doLCDText && g.isLCDGlyph()) {
-                        final double posX = x + tx.getMxt() + g.getOriginX() + gl.getPosX(i) + 0.5f;
-                        int subPosX = ((int)(3*posX)) % 3;
-                        if (subPosX < 0) {
-                            subPosX += 3;
-                        }
-                        this.pr.fillLCDAlphaMask(pixelData,
-                                (int)posX,
-                                (int)(y + tx.getMyt() + g.getOriginY() + gl.getPosY(i) + 0.5f),
-                                subPosX,
-                                g.getWidth(), g.getHeight(),
-                                0, g.getWidth());
-                    } else {
-                        this.pr.fillAlphaMask(pixelData,
-                                (int)(x + tx.getMxt() + g.getOriginX() + gl.getPosX(i) + 0.5f),
-                                (int)(y + tx.getMyt() + g.getOriginY() + gl.getPosY(i) + 0.5f),
-                                g.getWidth(), g.getHeight(),
-                                0, g.getWidth());
+        final Glyph g = strike.getGlyph(gl.getGlyphCode(idx));
+        if (drawAsMasks) {
+            final byte pixelData[] = g.getPixelData();
+            if (pixelData != null) {
+                if (g.isLCDGlyph()) {
+                    final double posX = x + tx.getMxt() + g.getOriginX() + gl.getPosX(idx) + 0.5f;
+                    int subPosX = ((int)(3*posX)) % 3;
+                    if (subPosX < 0) {
+                        subPosX += 3;
                     }
+                    this.pr.fillLCDAlphaMask(pixelData,
+                            (int)posX,
+                            (int)(y + tx.getMyt() + g.getOriginY() + gl.getPosY(idx) + 0.5f),
+                            subPosX,
+                            g.getWidth(), g.getHeight(),
+                            0, g.getWidth());
+                } else {
+                    this.pr.fillAlphaMask(pixelData,
+                            (int)(x + tx.getMxt() + g.getOriginX() + gl.getPosX(idx) + 0.5f),
+                            (int)(y + tx.getMyt() + g.getOriginY() + gl.getPosY(idx) + 0.5f),
+                            g.getWidth(), g.getHeight(),
+                            0, g.getWidth());
                 }
             }
         } else {
-            final BaseTransform glyphTx = tx.copy();
-            glyphTx.deriveWithTranslation(x, y);
-            for (int i = strFrom; i < strTo; i++) {
-                final Glyph g = strike.getGlyph(gl.getGlyphCode(i));
-                this.paintShape(g.getShape(), null, glyphTx);
-                advanceX += g.getAdvance();
-                glyphTx.deriveWithTranslation(g.getAdvance(), 0);
-            }
+            glyphTx.setTransform(tx);
+            glyphTx.deriveWithTranslation(x + gl.getPosX(idx), y + gl.getPosY(idx));
+            this.paintShapePaintAlreadySet(g.getShape(), null, glyphTx);
         }
-        return advanceX;
     }
 
     public void drawTexture(Texture tex, float x, float y, float w, float h) {
--- a/modules/graphics/src/main/java/com/sun/prism/sw/SWPipeline.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/prism/sw/SWPipeline.java	Tue Jul 23 17:23:49 2013 -0700
@@ -40,7 +40,7 @@
     static {
         AccessController.doPrivileged(new PrivilegedAction<Object>() {
             public Object run() {
-                NativeLibLoader.loadLibrary("prism-sw");
+                NativeLibLoader.loadLibrary("prism_sw");
                 return null;
             }
         });
--- a/modules/graphics/src/main/java/com/sun/prism/sw/SWResourceFactory.java	Tue Jul 23 09:18:52 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/prism/sw/SWResourceFactory.java	Tue Jul 23 17:23:49 2013 -0700
@@ -77,19 +77,19 @@
         context.dispose();
     }
 
-    @Override public ShapeRep createArcRep(boolean needs3D) {
+    @Override public ShapeRep createArcRep() {
         return theRep;
     }
     
-    @Override public ShapeRep createEllipseRep(boolean needs3D) {
+    @Override public ShapeRep createEllipseRep() {
         return theRep;
     }
     
-    @Override public ShapeRep createRoundRectRep(boolean needs3D) {
+    @Override public ShapeRep createRoundRectRep() {
         return rectRep;
     }
     
-    @Override public ShapeRep createPathRep(boolean needs3D) {
+    @Override public ShapeRep createPathRep() {
         return theRep;
     }
             
--- a/modules/graphics/src/main/java/com/sun/prism/util/tess/Tess.java	Tue Jul 23 09:18:52 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,932 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.prism.util.tess;
-
-import com.sun.prism.util.tess.impl.tess.TessellatorImpl;
-
-
-// TODO: RT-17486 - Need a replacement for GLU Tessellator
-
- /**
-  * Provides access to the OpenGL Utility Library (Tess).
-  * 
-  * <P>
-  *
-  * Notes from the Reference Implementation for this class:
-  * Thanks to the contributions of many individuals, this class is a
-  * pure Java port of SGI's original C sources. All of the projection,
-  * mipmap, scaling, and tessellation routines that are exposed are
-  * compatible with the GLU 1.3 specification. The GLU NURBS routines
-  * are not currently exposed.
-  */
-public class Tess
-{ 
-    // TODO: Temporary constants needed to isolate jogl
-    public static final int GL_POINTS = 0; // GL.GL_POINTS;
-    public static final int GL_LINES = 1; //GL.GL_LINES;
-    public static final int GL_LINE_LOOP = 2; //GL.GL_LINE_LOOP;
-    public static final int GL_LINE_STRIP = 3; //GL.GL_LINE_STRIP;
-    public static final int GL_TRIANGLES = 4; //GL.GL_TRIANGLES;
-    public static final int GL_TRIANGLE_STRIP = 5; //GL.GL_TRIANGLE_STRIP;
-    public static final int GL_TRIANGLE_FAN = 6; //GL.GL_TRIANGLE_FAN;
-
-  
-  //----------------------------------------------------------------------
-  // Tessellation routines
-  //
-  
-  /*****************************************************************************
-   * <b>newTess</b> creates and returns a new tessellation object.  This
-   * object must be referred to when calling tesselation methods.  A return
-   * value of null means that there was not enough memeory to allocate the
-   * object.
-   *
-   * Optional, throws GLException if not available in profile
-   *
-   * @return A new tessellation object.
-   *
-   * @see #tessBeginPolygon tessBeginPolygon
-   * @see #deleteTess       deleteTess
-   * @see #tessCallback     tessCallback
-   ****************************************************************************/
-  public static final Tessellator newTess() {
-      return TessellatorImpl.gluNewTess();
-  }
-
-  /*****************************************************************************
-   * <b>deleteTess</b> destroys the indicated tessellation object (which was
-   * created with {@link #newTess newTess}).
-   *
-   * Optional, throws GLException if not available in profile
-   *
-   * @param tessellator
-   *        Specifies the tessellation object to destroy.
-   *
-   * @see #beginPolygon beginPolygon
-   * @see #newTess      newTess
-   * @see #tessCallback tessCallback
-   ****************************************************************************/
-  public static final void deleteTess(Tessellator tessellator) {
-      TessellatorImpl tess = (TessellatorImpl) tessellator;
-      tess.gluDeleteTess();
-  }
-
-  /*****************************************************************************
-   * <b>tessProperty</b> is used to control properites stored in a
-   * tessellation object.  These properties affect the way that the polygons are
-   * interpreted and rendered.  The legal value for <i>which</i> are as
-   * follows:<P>
-   *
-   * Optional, throws GLException if not available in profile
-   *
-   * <b>TESS_WINDING_RULE</b>
-   * <UL>
-   *   Determines which parts of the polygon are on the "interior".
-   *   <em>value</em> may be set to one of
-   *   <BR><b>TESS_WINDING_ODD</b>,
-   *   <BR><b>TESS_WINDING_NONZERO</b>,
-   *   <BR><b>TESS_WINDING_POSITIVE</b>, or
-   *   <BR><b>TESS_WINDING_NEGATIVE</b>, or
-   *   <BR><b>TESS_WINDING_ABS_GEQ_TWO</b>.<P>
-   *
-   *   To understand how the winding rule works, consider that the input
-   *   contours partition the plane into regions.  The winding rule determines
-   *   which of these regions are inside the polygon.<P>
-   *
-   *   For a single contour C, the winding number of a point x is simply the
-   *   signed number of revolutions we make around x as we travel once around C
-   *   (where CCW is positive).  When there are several contours, the individual
-   *   winding numbers are summed.  This procedure associates a signed integer
-   *   value with each point x in the plane.  Note that the winding number is
-   *   the same for all points in a single region.<P>
-   *
-   *   The winding rule classifies a region as "inside" if its winding number
-   *   belongs to the chosen category (odd, nonzero, positive, negative, or
-   *   absolute value of at least two).  The previous Tess tessellator (prior to
-   *   Tess 1.2) used the "odd" rule.  The "nonzero" rule is another common way
-   *   to define the interior.  The other three rules are useful for polygon CSG
-   *   operations.
-   * </UL>
-   * <BR><b>TESS_BOUNDARY_ONLY</b>
-   * <UL>
-   *   Is a boolean value ("value" should be set to GL_TRUE or GL_FALSE). When
-   *   set to GL_TRUE, a set of closed contours separating the polygon interior
-   *   and exterior are returned instead of a tessellation.  Exterior contours
-   *   are oriented CCW with respect to the normal; interior contours are
-   *   oriented CW. The <b>TESS_BEGIN</b> and <b>TESS_BEGIN_DATA</b>
-   *   callbacks use the type GL_LINE_LOOP for each contour.
-   * </UL>
-   * <BR><b>TESS_TOLERANCE</b>
-   * <UL>
-   *   Specifies a tolerance for merging features to reduce the size of the
-   *   output. For example, two vertices that are very close to each other
-   *   might be replaced by a single vertex.  The tolerance is multiplied by the
-   *   largest coordinate magnitude of any input vertex; this specifies the
-   *   maximum distance that any feature can move as the result of a single
-   *   merge operation.  If a single feature takes part in several merge
-   *   operations, the toal distance moved could be larger.<P>
-   *
-   *   Feature merging is completely optional; the tolerance is only a hint.
-   *   The implementation is free to merge in some cases and not in others, or
-   *   to never merge features at all.  The initial tolerance is 0.<P>
-   *
-   *   The current implementation merges vertices only if they are exactly
-   *   coincident, regardless of the current tolerance.  A vertex is spliced
-   *   into an edge only if the implementation is unable to distinguish which
-   *   side of the edge the vertex lies on.  Two edges are merged only when both
-   *   endpoints are identical.
-   * </UL>
-   *
-   * @param tessellator
-   *        Specifies the tessellation object created with
-   *        {@link #newTess newTess}
-   * @param which
-   *        Specifies the property to be set.  Valid values are
-   *        <b>TESS_WINDING_RULE</b>, <b>GLU_TESS_BOUNDARDY_ONLY</b>,
-   *        <b>TESS_TOLERANCE</b>.
-   * @param value
-   *        Specifices the value of the indicated property.
-   *
-   * @see #gluGetTessProperty gluGetTessProperty
-   * @see #newTess         newTess
-   ****************************************************************************/
-  public static final void tessProperty(Tessellator tessellator, int which, double value) {
-      TessellatorImpl tess = (TessellatorImpl) tessellator;
-      tess.gluTessProperty(which, value);
-  }
-
-  /*****************************************************************************
-   * <b>gluGetTessProperty</b> retrieves properties stored in a tessellation
-   * object.  These properties affect the way that tessellation objects are
-   * interpreted and rendered.  See the
-   * {@link #tessProperty tessProperty} reference
-   * page for information about the properties and what they do.
-   *
-   * Optional, throws GLException if not available in profile
-   *
-   * @param tessellator
-   *        Specifies the tessellation object (created with
-   *        {@link #newTess newTess}).
-   * @param which
-   *        Specifies the property whose value is to be fetched. Valid values
-   *        are <b>TESS_WINDING_RULE</b>, <b>TESS_BOUNDARY_ONLY</b>,
-   *        and <b>GLU_TESS_TOLERANCES</b>.
-   * @param value
-   *        Specifices an array into which the value of the named property is
-   *        written.
-   *
-   * @see #newTess      newTess
-   * @see #tessProperty tessProperty
-   ****************************************************************************/
-  public static final void gluGetTessProperty(Tessellator tessellator, int which, double[] value, int value_offset) {
-      TessellatorImpl tess = (TessellatorImpl) tessellator;
-      tess.gluGetTessProperty(which, value, value_offset);
-  }
-
-  /*****************************************************************************
-   * <b>tessNormal</b> describes a normal for a polygon that the program is
-   * defining. All input data will be projected onto a plane perpendicular to
-   * the one of the three coordinate axes before tessellation and all output
-   * triangles will be oriented CCW with repsect to the normal (CW orientation
-   * can be obtained by reversing the sign of the supplied normal).  For
-   * example, if you know that all polygons lie in the x-y plane, call
-   * <b>tessNormal</b>(tess, 0.0, 0.0, 0.0) before rendering any polygons.<P>
-   *
-   * If the supplied normal is (0.0, 0.0, 0.0)(the initial value), the normal
-   * is determined as follows.  The direction of the normal, up to its sign, is
-   * found by fitting a plane to the vertices, without regard to how the
-   * vertices are connected.  It is expected that the input data lies
-   * approximately in the plane; otherwise, projection perpendicular to one of
-   * the three coordinate axes may substantially change the geometry.  The sign
-   * of the normal is chosen so that the sum of the signed areas of all input
-   * contours is nonnegative (where a CCW contour has positive area).<P>
-   *
-   * The supplied normal persists until it is changed by another call to
-   * <b>tessNormal</b>.
-   *
-   * Optional, throws GLException if not available in profile
-   *
-   * @param tessellator
-   *        Specifies the tessellation object (created by
-   *        {@link #newTess newTess}).
-   * @param x
-   *        Specifies the first component of the normal.
-   * @param y
-   *        Specifies the second component of the normal.
-   * @param z
-   *        Specifies the third component of the normal.
-   *
-   * @see #tessBeginPolygon tessBeginPolygon
-   * @see #tessEndPolygon   tessEndPolygon
-   ****************************************************************************/
-  public static final void tessNormal(Tessellator tessellator, double x, double y, double z) {
-      TessellatorImpl tess = (TessellatorImpl) tessellator;
-      tess.gluTessNormal(x, y, z);
-  }
-
-  /*****************************************************************************
-   * <b>tessCallback</b> is used to indicate a callback to be used by a
-   * tessellation object. If the specified callback is already defined, then it
-   * is replaced. If <i>aCallback</i> is null, then the existing callback
-   * becomes undefined.<P>
-   *
-   * Optional, throws GLException if not available in profile
-   *
-   * These callbacks are used by the tessellation object to describe how a
-   * polygon specified by the user is broken into triangles. Note that there are
-   * two versions of each callback: one with user-specified polygon data and one
-   * without. If both versions of a particular callback are specified, then the
-   * callback with user-specified polygon data will be used. Note that the
-   * polygonData parameter used by some of the methods is a copy of the
-   * reference that was specified when
-   * {@link #tessBeginPolygon tessBeginPolygon}
-   * was called. The legal callbacks are as follows:<P>
-   *
-   * <b>TESS_BEGIN</b>
-   * <UL>
-   *   The begin callback is invoked like {@link com.sun.prism.opengl.GL#glBegin
-   *   glBegin} to indicate the start of a (triangle) primitive. The method
-   *   takes a single argument of type int. If the
-   *   <b>TESS_BOUNDARY_ONLY</b> property is set to <b>GL_FALSE</b>, then
-   *   the argument is set to either <b>GL_TRIANGLE_FAN</b>,
-   *   <b>GL_TRIANGLE_STRIP</b>, or <b>GL_TRIANGLES</b>. If the
-   *   <b>TESS_BOUNDARY_ONLY</b> property is set to <b>GL_TRUE</b>, then the
-   *   argument will be set to <b>GL_LINE_LOOP</b>. The method prototype for
-   *   this callback is:
-   * </UL>
-   *
-   * <PRE>
-   *         void begin(int type);</PRE><P>
-   *
-   * <b>TESS_BEGIN_DATA</b>
-   * <UL>
-   *   The same as the <b>TESS_BEGIN</b> callback except
-   *   that it takes an additional reference argument. This reference is
-   *   identical to the opaque reference provided when
-   *   {@link #tessBeginPolygon tessBeginPolygon}
-   *   was called. The method prototype for this callback is:
-   * </UL>
-   *
-   * <PRE>
-   *         void beginData(int type, Object polygonData);</PRE>
-   *
-   * <b>TESS_EDGE_FLAG</b>
-   * <UL>
-   *   The edge flag callback is similar to
-   *   {@link com.sun.prism.opengl.GL#glEdgeFlag glEdgeFlag}. The method takes
-   *   a single boolean boundaryEdge that indicates which edges lie on the
-   *   polygon boundary. If the boundaryEdge is <b>GL_TRUE</b>, then each vertex
-   *   that follows begins an edge that lies on the polygon boundary, that is,
-   *   an edge that separates an interior region from an exterior one. If the
-   *   boundaryEdge is <b>GL_FALSE</b>, then each vertex that follows begins an
-   *   edge that lies in the polygon interior. The edge flag callback (if
-   *   defined) is invoked before the first vertex callback.<P>
-   *
-   *   Since triangle fans and triangle strips do not support edge flags, the
-   *   begin callback is not called with <b>GL_TRIANGLE_FAN</b> or
-   *   <b>GL_TRIANGLE_STRIP</b> if a non-null edge flag callback is provided.
-   *   (If the callback is initialized to null, there is no impact on
-   *   performance). Instead, the fans and strips are converted to independent
-   *   triangles. The method prototype for this callback is:
-   * </UL>
-   *
-   * <PRE>
-   *         void edgeFlag(boolean boundaryEdge);</PRE>
-   *
-   * <b>TESS_EDGE_FLAG_DATA</b>
-   * <UL>
-   *   The same as the <b>TESS_EDGE_FLAG</b> callback except that it takes
-   *   an additional reference argument. This reference is identical to the
-   *   opaque reference provided when
-   *   {@link #tessBeginPolygon tessBeginPolygon}
-   *   was called. The method prototype for this callback is:
-   * </UL>
-   *
-   * <PRE>
-   *         void edgeFlagData(boolean boundaryEdge, Object polygonData);</PRE>
-   *
-   * <b>TESS_VERTEX</b>
-   * <UL>
-   *   The vertex callback is invoked between the begin and end callbacks. It is
-   *   similar to {@link com.sun.prism.opengl.GL#glVertex3f glVertex3f}, and it
-   *   defines the vertices of the triangles created by the tessellation
-   *   process. The method takes a reference as its only argument. This
-   *   reference is identical to the opaque reference provided by the user when
-   *   the vertex was described (see
-   *   {@link #tessVertex tessVertex}). The method
-   *   prototype for this callback is:
-   * </UL>
-   *
-   * <PRE>
-   *         void vertex(Object vertexData);</PRE>
-   *
-   * <b>TESS_VERTEX_DATA</b>
-   * <UL>
-   *   The same as the <b>TESS_VERTEX</b> callback except that it takes an
-   *   additional reference argument. This reference is identical to the opaque
-   *   reference provided when
-   *   {@link #tessBeginPolygon tessBeginPolygon}
-   *   was called. The method prototype for this callback is:
-   * </UL>
-   *
-   * <PRE>
-   *         void vertexData(Object vertexData, Object polygonData);</PRE>
-   *
-   * <b>TESS_END</b>
-   * <UL>
-   *   The end callback serves the same purpose as
-   *   {@link com.sun.prism.opengl.GL#glEnd glEnd}. It indicates the end of a
-   *   primitive and it takes no arguments. The method prototype for this
-   *   callback is:
-   * </UL>
-   *
-   * <PRE>
-   *         void end();</PRE>
-   *
-   * <b>TESS_END_DATA</b>
-   * <UL>
-   *   The same as the <b>TESS_END</b> callback except that it takes an
-   *   additional reference argument. This reference is identical to the opaque
-   *   reference provided when
-   *   {@link #tessBeginPolygon tessBeginPolygon}
-   *   was called. The method prototype for this callback is:
-   * </UL>
-   *
-   * <PRE>
-   *         void endData(Object polygonData);</PRE>
-   *
-   * <b>TESS_COMBINE</b>
-   * <UL>
-   *   The combine callback is called to create a new vertex when the
-   *   tessellation detects an intersection, or wishes to merge features. The
-   *   method takes four arguments: an array of three elements each of type
-   *   double, an array of four references, an array of four elements each of
-   *   type float, and a reference to a reference. The prototype is:
-   * </UL>
-   *
-   * <PRE>
-   *         void combine(double[] coords, Object[] data,
-   *                      float[] weight, Object[] outData);</PRE>
-   *
-   * <UL>
-   *   The vertex is defined as a linear combination of up to four existing
-   *   vertices, stored in <i>data</i>. The coefficients of the linear
-   *   combination are given by <i>weight</i>; these weights always add up to 1.
-   *   All vertex pointers are valid even when some of the weights are 0.
-   *   <i>coords</i> gives the location of the new vertex.<P>
-   *
-   *   The user must allocate another vertex, interpolate parameters using
-   *   <i>data</i> and <i>weight</i>, and return the new vertex pointer
-   *   in <i>outData</i>. This handle is supplied during rendering callbacks.
-   *   The user is responsible for freeing the memory some time after
-   *   {@link #tessEndPolygon tessEndPolygon} is
-   *   called.<P>
-   *
-   *   For example, if the polygon lies in an arbitrary plane in 3-space, and a
-   *   color is associated with each vertex, the <b>TESS_COMBINE</b>
-   *   callback might look like this:
-   * </UL>
-   * <PRE>
-   *         void myCombine(double[] coords, Object[] data,
-   *                        float[] weight, Object[] outData)
-   *         {
-   *            MyVertex newVertex = new MyVertex();
-   *
-   *            newVertex.x = coords[0];
-   *            newVertex.y = coords[1];
-   *            newVertex.z = coords[2];
-   *            newVertex.r = weight[0]*data[0].r +
-   *                          weight[1]*data[1].r +
-   *                          weight[2]*data[2].r +
-   *                          weight[3]*data[3].r;
-   *            newVertex.g = weight[0]*data[0].g +
-   *                          weight[1]*data[1].g +
-   *                          weight[2]*data[2].g +
-   *                          weight[3]*data[3].g;
-   *            newVertex.b = weight[0]*data[0].b +
-   *                          weight[1]*data[1].b +
-   *                          weight[2]*data[2].b +
-   *                          weight[3]*data[3].b;
-   *            newVertex.a = weight[0]*data[0].a +
-   *                          weight[1]*data[1].a +
-   *                          weight[2]*data[2].a +
-   *                          weight[3]*data[3].a;
-   *            outData = newVertex;
-   *         }</PRE>
-   *
-   * <UL>
-   *   If the tessellation detects an intersection, then the
-   *   <b>TESS_COMBINE</b> or <b>TESS_COMBINE_DATA</b> callback (see
-   *   below) must be defined, and it must write a non-null reference into
-   *   <i>outData</i>. Otherwise the <b>TESS_NEED_COMBINE_CALLBACK</b> error
-   *   occurs, and no output is generated.
-   * </UL>
-   *
-   * <b>TESS_COMBINE_DATA</b>
-   * <UL>
-   *   The same as the <b>TESS_COMBINE</b> callback except that it takes an
-   *   additional reference argument. This reference is identical to the opaque
-   *   reference provided when
-   *   {@link #tessBeginPolygon tessBeginPolygon}
-   *   was called. The method prototype for this callback is:
-   * </UL>
-   *
-   * <PRE>
-   *         void combineData(double[] coords, Object[] data,
-                              float[] weight, Object[] outData,
-                              Object polygonData);</PRE>
-   *
-   * <b>TESS_ERROR</b>
-   * <UL>
-   *   The error callback is called when an error is encountered. The one
-   *   argument is of type int; it indicates the specific error that occurred
-   *   and will be set to one of <b>TESS_MISSING_BEGIN_POLYGON</b>,
-   *   <b>TESS_MISSING_END_POLYGON</b>,
-   *   <b>TESS_MISSING_BEGIN_CONTOUR</b>,
-   *   <b>TESS_MISSING_END_CONTOUR</b>, <b>TESS_COORD_TOO_LARGE</b>,
-   *   <b>TESS_NEED_COMBINE_CALLBACK</b> or <b>OUT_OF_MEMORY</b>.
-   *   Character strings describing these errors can be retrieved with the
-   *   {@link #gluErrorString gluErrorString} call. The
-   *   method prototype for this callback is:
-   * </UL>
-   *
-   * <PRE>
-   *         void error(int errnum);</PRE>
-   *
-   * <UL>
-   *   The Tess library will recover from the first four errors by inserting the
-   *   missing call(s). <b>TESS_COORD_TOO_LARGE</b> indicates that some
-   *   vertex coordinate exceeded the predefined constant
-   *   <b>TESS_MAX_COORD</b> in absolute value, and that the value has been
-   *   clamped. (Coordinate values must be small enough so that two can be
-   *   multiplied together without overflow.)
-   *   <b>TESS_NEED_COMBINE_CALLBACK</b> indicates that the tessellation
-   *   detected an intersection between two edges in the input data, and the
-   *   <b>TESS_COMBINE</b> or <b>TESS_COMBINE_DATA</b> callback was not
-   *   provided. No output is generated. <b>OUT_OF_MEMORY</b> indicates that
-   *   there is not enough memory so no output is generated.
-   * </UL>
-   *
-   * <b>TESS_ERROR_DATA</b>
-   * <UL>
-   *   The same as the TESS_ERROR callback except that it takes an
-   *   additional reference argument. This reference is identical to the opaque
-   *   reference provided when
-   *   {@link #tessBeginPolygon tessBeginPolygon}
-   *   was called. The method prototype for this callback is:
-   * </UL>
-   *
-   * <PRE>
-   *         void errorData(int errnum, Object polygonData);</PRE>
-   *
-   * @param tessellator
-   *        Specifies the tessellation object (created with
-   *        {@link #newTess newTess}).
-   * @param which
-   *        Specifies the callback being defined. The following values are
-   *        valid: <b>TESS_BEGIN</b>, <b>TESS_BEGIN_DATA</b>,
-   *        <b>TESS_EDGE_FLAG</b>, <b>TESS_EDGE_FLAG_DATA</b>,
-   *        <b>TESS_VERTEX</b>, <b>TESS_VERTEX_DATA</b>,
-   *        <b>TESS_END</b>, <b>TESS_END_DATA</b>,
-   *        <b>TESS_COMBINE</b>,  <b>TESS_COMBINE_DATA</b>,
-   *        <b>TESS_ERROR</b>, and <b>TESS_ERROR_DATA</b>.
-   * @param aCallback
-   *        Specifies the callback object to be called.
-   *
-   * @see com.sun.prism.opengl.GL#glBegin              glBegin
-   * @see com.sun.prism.opengl.GL#glEdgeFlag           glEdgeFlag
-   * @see com.sun.prism.opengl.GL#glVertex3f           glVertex3f
-   * @see #newTess          newTess
-   * @see #gluErrorString      gluErrorString
-   * @see #tessVertex       tessVertex
-   * @see #tessBeginPolygon tessBeginPolygon
-   * @see #tessBeginContour tessBeginContour
-   * @see #tessProperty     tessProperty
-   * @see #tessNormal       tessNormal
-   ****************************************************************************/
-  public static final void tessCallback(Tessellator tessellator, int which, TessellatorCallback aCallback) {
-      TessellatorImpl tess = (TessellatorImpl) tessellator;
-      tess.gluTessCallback(which, aCallback);
-  }
-
-  /*********************************************************************