aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/shading/PDFGradientFactory.java
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2014-07-11 16:59:42 +0000
committerVincent Hennebert <vhennebert@apache.org>2014-07-11 16:59:42 +0000
commitd2b8aba1131ab23985a4f390779bd5e8f76e7b53 (patch)
treed3d960245f5d39da5fa6328a330b2ae4b59b60d5 /src/java/org/apache/fop/render/shading/PDFGradientFactory.java
parent2be89ddec6f3381d98cb3a9f9732245573b0ea88 (diff)
downloadxmlgraphics-fop-d2b8aba1131ab23985a4f390779bd5e8f76e7b53.tar.gz
xmlgraphics-fop-d2b8aba1131ab23985a4f390779bd5e8f76e7b53.zip
Removed unnecessary FunctionDelegate class
Removed makeFunction/Shading/Gradient methods in PDFFactory that were not used, duplicates of methods in (PDF)GradientFactory and getting in the way of refactoring git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP-2393_gradient-rendering@1609745 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/shading/PDFGradientFactory.java')
-rw-r--r--src/java/org/apache/fop/render/shading/PDFGradientFactory.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/java/org/apache/fop/render/shading/PDFGradientFactory.java b/src/java/org/apache/fop/render/shading/PDFGradientFactory.java
index e12fa82e5..1e57e72ea 100644
--- a/src/java/org/apache/fop/render/shading/PDFGradientFactory.java
+++ b/src/java/org/apache/fop/render/shading/PDFGradientFactory.java
@@ -17,6 +17,7 @@
package org.apache.fop.render.shading;
+import java.util.ArrayList;
import java.util.List;
import org.apache.fop.pdf.PDFDeviceColorSpace;
@@ -37,18 +38,14 @@ public class PDFGradientFactory extends GradientFactory<PDFPattern> {
public Function makeFunction(int functionType, List<Double> theDomain,
List<Double> theRange, List<Function> theFunctions,
List<Double> theBounds, List<Double> theEncode) {
- PDFFunction newFunction = new PDFFunction(functionType, theDomain, theRange, theFunctions,
- theBounds, theEncode);
- newFunction = graphics2D.registerFunction(newFunction);
- return newFunction;
+ return new Function(functionType, theDomain, theRange, theFunctions, theBounds, theEncode);
}
public Function makeFunction(int functionType, List<Double> theDomain,
List<Double> theRange, List<Double> theCZero, List<Double> theCOne,
double theInterpolationExponentN) {
- PDFFunction newFunction = new PDFFunction(functionType, theDomain, theRange, theCZero,
+ Function newFunction = new Function(functionType, theDomain, theRange, theCZero,
theCOne, theInterpolationExponentN);
- newFunction = graphics2D.registerFunction(newFunction);
return newFunction;
}
@@ -57,8 +54,13 @@ public class PDFGradientFactory extends GradientFactory<PDFPattern> {
PDFDeviceColorSpace theColorSpace, List<Double> theBackground, List<Double> theBBox,
boolean theAntiAlias, List<Double> theCoords, List<Double> theDomain,
Function theFunction, List<Integer> theExtend) {
+ List<PDFFunction> pdfFunctions = new ArrayList<PDFFunction>(theFunction.getFunctions().size());
+ for (Function f : theFunction.getFunctions()) {
+ pdfFunctions.add(graphics2D.registerFunction(new PDFFunction(f)));
+ }
+ PDFFunction pdfFunction = graphics2D.registerFunction(new PDFFunction(theFunction, pdfFunctions));
PDFShading newShading = new PDFShading(theShadingType, theColorSpace, theBackground,
- theBBox, theAntiAlias, theCoords, theDomain, theFunction, theExtend);
+ theBBox, theAntiAlias, theCoords, theDomain, pdfFunction, theExtend);
newShading = graphics2D.registerShading(newShading);
return newShading;
}