]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Rename toWriteableString into output and added StringBuilder parameter
authorVincent Hennebert <vhennebert@apache.org>
Mon, 14 Jul 2014 21:24:52 +0000 (21:24 +0000)
committerVincent Hennebert <vhennebert@apache.org>
Mon, 14 Jul 2014 21:24:52 +0000 (21:24 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP-2393_gradient-rendering@1610537 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/pdf/PDFFunction.java
src/java/org/apache/fop/render/gradient/Function.java
src/java/org/apache/fop/render/ps/svg/PSSVGGraphics2D.java

index be74dfc10f4ef1cbf7e20ffe5b27f608b1ea2620..ed2d1d16ca60c2caf7dbc6527089907a61fe0e7e 100644 (file)
@@ -118,7 +118,9 @@ public class PDFFunction extends PDFObject {
                 out.append(pdfFunctions.get(functionIndex).referencePDF());
             }
         };
-        return encode(function.toWriteableString(subFunctionRenderer));
+        StringBuilder out = new StringBuilder();
+        function.output(out, subFunctionRenderer);
+        return encode(out.toString());
     }
 
     /** {@inheritDoc} */
index e83f6dc0535179d5fad033655e182fce81b222b4..220c5f79107d3299f05f273c51b19d5dcb6f5ca2 100644 (file)
@@ -338,8 +338,7 @@ public class Function {
         return cOne;
     }
 
-    public String toWriteableString(SubFunctionRenderer subFunctionRenderer) {
-        StringBuilder out = new StringBuilder(256);
+    public String output(StringBuilder out, SubFunctionRenderer subFunctionRenderer) {
         out.append("<<\n/FunctionType " + functionType + "\n");
         outputDomain(out);
         if (this.functionType == 0) {
index b8ddc20d80de7d5140f9d9d34a992c16f4e0fbfb..a89b16bde57bae6fdfd1a37f3f797e77ae0d3666 100644 (file)
@@ -121,7 +121,7 @@ public class PSSVGGraphics2D extends PSGraphics2D {
         return p.toString();
     }
 
-    private void outputShading(StringBuilder p, Shading shading) {
+    private void outputShading(StringBuilder out, Shading shading) {
         final Function function = shading.getFunction();
         Shading.FunctionRenderer functionRenderer = new Shading.FunctionRenderer() {
 
@@ -131,13 +131,13 @@ public class PSSVGGraphics2D extends PSGraphics2D {
                     public void outputFunction(StringBuilder out, int functionIndex) {
                         Function subFunction = function.getFunctions().get(functionIndex);
                         assert subFunction.getFunctions().isEmpty();
-                        out.append(subFunction.toWriteableString(null));
+                        subFunction.output(out, null);
                     }
                 };
-                out.append(function.toWriteableString(subFunctionRenderer));
+                function.output(out, subFunctionRenderer);
             }
         };
-        shading.output(p, functionRenderer);
+        shading.output(out, functionRenderer);
     }
 
     protected AffineTransform getBaseTransform() {