You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vh...@apache.org on 2014/07/10 20:04:28 UTC

svn commit: r1609535 - /xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/shading/GradientFactory.java

Author: vhennebert
Date: Thu Jul 10 18:04:28 2014
New Revision: 1609535

URL: http://svn.apache.org/r1609535
Log:
Removed dead code

Modified:
    xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/shading/GradientFactory.java

Modified: xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/shading/GradientFactory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/shading/GradientFactory.java?rev=1609535&r1=1609534&r2=1609535&view=diff
==============================================================================
--- xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/shading/GradientFactory.java (original)
+++ xmlgraphics/fop/branches/FOP-2393_gradient-rendering/src/java/org/apache/fop/render/shading/GradientFactory.java Thu Jul 10 18:04:28 2014
@@ -62,7 +62,7 @@ public abstract class GradientFactory<P 
             dx *= scale;
             dy *= scale;
         }
-        List<Double> coords = new java.util.ArrayList<Double>();
+        List<Double> coords = new java.util.ArrayList<Double>(6);
         coords.add(Double.valueOf(center.getX() + dx));
         coords.add(Double.valueOf(center.getY() + dy));
         coords.add(Double.valueOf(0));
@@ -164,28 +164,7 @@ public abstract class GradientFactory<P 
         }
 
         Function function = makeFunction(3, null, null, functions, bounds, null);
-        Shading shading;
-        if (radial) {
-            if (coords.size() == 6) {
-                shading = makeShading(3, colorspace, null, null, false, coords, null, function, null);
-            } else {    // if the center x, center y, and radius specifiy
-                // the gradient, then assume the same center x, center y,
-                // and radius of zero for the other necessary component
-                List<Double> newCoords = new ArrayList<Double>();
-                newCoords.add(coords.get(0));
-                newCoords.add(coords.get(1));
-                newCoords.add(coords.get(2));
-                newCoords.add(coords.get(0));
-                newCoords.add(coords.get(1));
-                newCoords.add(Double.valueOf(0.0));
-
-                shading = makeShading(3, colorspace, null, null, false, newCoords,
-                        null, function, null);
-            }
-        } else {
-            shading = makeShading(2, colorspace, null, null, false, coords,
-                    null, function, null);
-        }
+        Shading shading = makeShading(radial ? 3 : 2, colorspace, null, null, false, coords, null, function, null);
         return makePattern(2, shading, null, null, matrix);
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org