< prev index next >

openjfx9/modules/javafx.graphics/src/main/java/com/sun/marlin/TransformingPathConsumer2D.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2016, 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

@@ -21,44 +21,44 @@
  * 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 sun.java2d.marlin;
+package com.sun.marlin;
 
-import sun.awt.geom.PathConsumer2D;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Path2D;
+import com.sun.javafx.geom.PathConsumer2D;
+import com.sun.javafx.geom.Path2D;
+import com.sun.javafx.geom.transform.BaseTransform;
 
-final class TransformingPathConsumer2D {
+public final class TransformingPathConsumer2D {
 
     TransformingPathConsumer2D() {
         // used by RendererContext
     }
 
     // recycled PathConsumer2D instance from wrapPath2d()
     private final Path2DWrapper        wp_Path2DWrapper        = new Path2DWrapper();
 
-    PathConsumer2D wrapPath2d(Path2D.Float p2d)
+    PathConsumer2D wrapPath2d(Path2D p2d)
     {
         return wp_Path2DWrapper.init(p2d);
     }
 
     // recycled PathConsumer2D instances from deltaTransformConsumer()
     private final DeltaScaleFilter     dt_DeltaScaleFilter     = new DeltaScaleFilter();
     private final DeltaTransformFilter dt_DeltaTransformFilter = new DeltaTransformFilter();
 
-    PathConsumer2D deltaTransformConsumer(PathConsumer2D out,
-                                          AffineTransform at)
+    public PathConsumer2D deltaTransformConsumer(PathConsumer2D out,
+                                                 BaseTransform at)
     {
         if (at == null) {
             return out;
         }
-        float mxx = (float) at.getScaleX();
-        float mxy = (float) at.getShearX();
-        float myx = (float) at.getShearY();
-        float myy = (float) at.getScaleY();
+        float mxx = (float) at.getMxx();
+        float mxy = (float) at.getMxy();
+        float myx = (float) at.getMyx();
+        float myy = (float) at.getMyy();
 
         if (mxy == 0f && myx == 0f) {
             if (mxx == 1f && myy == 1f) {
                 return out;
             } else {

@@ -71,20 +71,20 @@
 
     // recycled PathConsumer2D instances from inverseDeltaTransformConsumer()
     private final DeltaScaleFilter     iv_DeltaScaleFilter     = new DeltaScaleFilter();
     private final DeltaTransformFilter iv_DeltaTransformFilter = new DeltaTransformFilter();
 
-    PathConsumer2D inverseDeltaTransformConsumer(PathConsumer2D out,
-                                                 AffineTransform at)
+    public PathConsumer2D inverseDeltaTransformConsumer(PathConsumer2D out,
+                                                        BaseTransform at)
     {
         if (at == null) {
             return out;
         }
-        float mxx = (float) at.getScaleX();
-        float mxy = (float) at.getShearX();
-        float myx = (float) at.getShearY();
-        float myy = (float) at.getScaleY();
+        float mxx = (float) at.getMxx();
+        float mxy = (float) at.getMxy();
+        float myx = (float) at.getMyx();
+        float myy = (float) at.getMyy();
 
         if (mxy == 0f && myx == 0f) {
             if (mxx == 1f && myy == 1f) {
                 return out;
             } else {

@@ -151,15 +151,10 @@
 
         @Override
         public void pathDone() {
             out.pathDone();
         }
-
-        @Override
-        public long getNativeConsumer() {
-            return 0;
-        }
     }
 
     static final class DeltaTransformFilter implements PathConsumer2D {
         private PathConsumer2D out;
         private float mxx, mxy, myx, myy;

@@ -220,23 +215,18 @@
 
         @Override
         public void pathDone() {
             out.pathDone();
         }
-
-        @Override
-        public long getNativeConsumer() {
-            return 0;
-        }
     }
 
     static final class Path2DWrapper implements PathConsumer2D {
-        private Path2D.Float p2d;
+        private Path2D p2d;
 
         Path2DWrapper() {}
 
-        Path2DWrapper init(Path2D.Float p2d) {
+        Path2DWrapper init(Path2D p2d) {
             this.p2d = p2d;
             return this;
         }
 
         @Override

@@ -267,12 +257,7 @@
 
         @Override
         public void quadTo(float x1, float y1, float x2, float y2) {
             p2d.quadTo(x1, y1, x2, y2);
         }
-
-        @Override
-        public long getNativeConsumer() {
-            throw new InternalError("Not using a native peer");
-        }
     }
 }
< prev index next >