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:17:36 UTC

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

Author: vhennebert
Date: Thu Jul 10 18:17:36 2014
New Revision: 1609542

URL: http://svn.apache.org/r1609542
Log:
Removed makeGradient and moved its content into createGradient

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=1609542&r1=1609541&r2=1609542&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:17:36 2014
@@ -79,7 +79,11 @@ public abstract class GradientFactory<P 
         List<Double> bounds = createBounds(gradient);
         //Gradients are currently restricted to sRGB
         PDFDeviceColorSpace colSpace = new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_RGB);
-        return makeGradient(gradient instanceof RadialGradientPaint, colSpace, colors, bounds, coords, matrix);
+        List<Function> functions = createFunctions(colors);
+        Function function = makeFunction(3, null, null, functions, bounds, null);
+        Shading shading = makeShading(gradient instanceof LinearGradientPaint ? 2 : 3,
+                colSpace, null, null, false, coords, null, function, null);
+        return makePattern(2, shading, null, null, matrix);
     }
 
     private List<Double> createTransform(MultipleGradientPaint gradient,
@@ -130,25 +134,6 @@ public abstract class GradientFactory<P 
         return bounds;
     }
 
-    /**
-     * Creates a new gradient.
-     *
-     * @param radial whether the gradient is linear or radial
-     * @param colorspace the colorspace used in PDF and Postscript
-     * @param colors the colors to be used in the gradient
-     * @param bounds the bounds of each color
-     * @param coords the coordinates of the gradient
-     * @param matrix the transformation matrix
-     * @return the Pattern object of the gradient
-     */
-    protected P makeGradient(boolean radial, PDFDeviceColorSpace colorspace,
-            List<Color> colors, List<Double> bounds, List<Double> coords, List<Double> matrix) {
-        List<Function> functions = createFunctions(colors);
-        Function function = makeFunction(3, null, null, functions, bounds, null);
-        Shading shading = makeShading(radial ? 3 : 2, colorspace, null, null, false, coords, null, function, null);
-        return makePattern(2, shading, null, null, matrix);
-    }
-
     private List<Function> createFunctions(List<Color> colors) {
         List<Function> functions = new ArrayList<Function>();
         for (int currentPosition = 0, lastPosition = colors.size() - 1;



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