From fd5c47183ea4a2d9bbee434b5333c539113042d1 Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Fri, 11 Jul 2014 17:58:59 +0000 Subject: Renamed GradientFactory into GradientMaker Moved PDF/PSGradientMaker into dedicated packages Factory stands for a pattern relating to application deployment. This is just about rendering a gradient to a certain output format. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP-2393_gradient-rendering@1609758 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/render/pdf/svg/PDFGradientMaker.java | 59 ++++++++ .../apache/fop/render/ps/svg/PSGradientMaker.java | 39 +++++ .../apache/fop/render/ps/svg/PSSVGGraphics2D.java | 9 +- .../apache/fop/render/shading/GradientFactory.java | 156 -------------------- .../apache/fop/render/shading/GradientMaker.java | 157 +++++++++++++++++++++ .../fop/render/shading/PDFGradientFactory.java | 56 -------- .../fop/render/shading/PSGradientFactory.java | 38 ----- src/java/org/apache/fop/svg/PDFGraphics2D.java | 10 +- 8 files changed, 264 insertions(+), 260 deletions(-) create mode 100644 src/java/org/apache/fop/render/pdf/svg/PDFGradientMaker.java create mode 100644 src/java/org/apache/fop/render/ps/svg/PSGradientMaker.java delete mode 100644 src/java/org/apache/fop/render/shading/GradientFactory.java create mode 100644 src/java/org/apache/fop/render/shading/GradientMaker.java delete mode 100644 src/java/org/apache/fop/render/shading/PDFGradientFactory.java delete mode 100644 src/java/org/apache/fop/render/shading/PSGradientFactory.java (limited to 'src/java') diff --git a/src/java/org/apache/fop/render/pdf/svg/PDFGradientMaker.java b/src/java/org/apache/fop/render/pdf/svg/PDFGradientMaker.java new file mode 100644 index 000000000..dca2801a2 --- /dev/null +++ b/src/java/org/apache/fop/render/pdf/svg/PDFGradientMaker.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.fop.render.pdf.svg; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.fop.pdf.PDFDeviceColorSpace; +import org.apache.fop.pdf.PDFFunction; +import org.apache.fop.pdf.PDFPattern; +import org.apache.fop.pdf.PDFShading; +import org.apache.fop.render.shading.Function; +import org.apache.fop.render.shading.GradientMaker; +import org.apache.fop.render.shading.Shading; +import org.apache.fop.svg.PDFGraphics2D; + +public class PDFGradientMaker extends GradientMaker { + + private final PDFGraphics2D graphics2D; + + public PDFGradientMaker(PDFGraphics2D pdfGraphics2D) { + this.graphics2D = pdfGraphics2D; + } + + @Override + protected Shading makeShading(int shadingType, PDFDeviceColorSpace colorSpace, + List coords, Function function) { + List pdfFunctions = new ArrayList(function.getFunctions().size()); + for (Function f : function.getFunctions()) { + pdfFunctions.add(graphics2D.registerFunction(new PDFFunction(f))); + } + PDFFunction pdfFunction = graphics2D.registerFunction(new PDFFunction(function, pdfFunctions)); + PDFShading shading = new PDFShading(shadingType, colorSpace, null, null, false, + coords, null, pdfFunction, null); + return graphics2D.registerShading(shading); + } + + @Override + protected PDFPattern makePattern(int patternType, Shading shading, List matrix) { + PDFPattern pattern = new PDFPattern(patternType, shading, null, null, matrix); + return graphics2D.registerPattern(pattern); + } + +} diff --git a/src/java/org/apache/fop/render/ps/svg/PSGradientMaker.java b/src/java/org/apache/fop/render/ps/svg/PSGradientMaker.java new file mode 100644 index 000000000..c66cd8c24 --- /dev/null +++ b/src/java/org/apache/fop/render/ps/svg/PSGradientMaker.java @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.fop.render.ps.svg; + +import java.util.List; + +import org.apache.fop.pdf.PDFDeviceColorSpace; +import org.apache.fop.render.shading.Function; +import org.apache.fop.render.shading.GradientMaker; +import org.apache.fop.render.shading.Shading; + +public class PSGradientMaker extends GradientMaker { + + @Override + protected Shading makeShading(int shadingType, + PDFDeviceColorSpace colorSpace, List coords, Function function) { + return new PSShading(shadingType, colorSpace, null, null, false, coords, null, function, null); + } + + @Override + protected PSPattern makePattern(int patternType, Shading shading, List matrix) { + return new PSPattern(patternType, shading, null, null, matrix); + } +} diff --git a/src/java/org/apache/fop/render/ps/svg/PSSVGGraphics2D.java b/src/java/org/apache/fop/render/ps/svg/PSSVGGraphics2D.java index 8e7315801..ebc7ef8a0 100644 --- a/src/java/org/apache/fop/render/ps/svg/PSSVGGraphics2D.java +++ b/src/java/org/apache/fop/render/ps/svg/PSSVGGraphics2D.java @@ -33,7 +33,6 @@ import org.apache.batik.ext.awt.RadialGradientPaint; import org.apache.xmlgraphics.java2d.ps.PSGraphics2D; import org.apache.xmlgraphics.ps.PSGenerator; -import org.apache.fop.render.shading.PSGradientFactory; import org.apache.fop.render.shading.Pattern; @@ -71,16 +70,16 @@ public class PSSVGGraphics2D extends PSGraphics2D { protected void applyPaint(Paint paint, boolean fill) { super.applyPaint(paint, fill); if (paint instanceof LinearGradientPaint) { - Pattern pattern = new PSGradientFactory() - .createLinearGradient((LinearGradientPaint) paint, getBaseTransform(), getTransform()); + Pattern pattern = new PSGradientMaker() + .makeLinearGradient((LinearGradientPaint) paint, getBaseTransform(), getTransform()); try { gen.write(pattern.toString()); } catch (IOException ioe) { handleIOException(ioe); } } else if (paint instanceof RadialGradientPaint) { - Pattern pattern = new PSGradientFactory() - .createRadialGradient((RadialGradientPaint) paint, getBaseTransform(), getTransform()); + Pattern pattern = new PSGradientMaker() + .makeRadialGradient((RadialGradientPaint) paint, getBaseTransform(), getTransform()); try { gen.write(pattern.toString()); } catch (IOException ioe) { diff --git a/src/java/org/apache/fop/render/shading/GradientFactory.java b/src/java/org/apache/fop/render/shading/GradientFactory.java deleted file mode 100644 index 94fe21ae9..000000000 --- a/src/java/org/apache/fop/render/shading/GradientFactory.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.render.shading; - -import java.awt.Color; -import java.awt.geom.AffineTransform; -import java.awt.geom.Point2D; -import java.util.ArrayList; -import java.util.List; - -import org.apache.batik.ext.awt.LinearGradientPaint; -import org.apache.batik.ext.awt.MultipleGradientPaint; -import org.apache.batik.ext.awt.RadialGradientPaint; - -import org.apache.xmlgraphics.java2d.color.ColorUtil; - -import org.apache.fop.pdf.PDFDeviceColorSpace; - -public abstract class GradientFactory

{ - - public P createLinearGradient(LinearGradientPaint gp, - AffineTransform baseTransform, AffineTransform transform) { - Point2D startPoint = gp.getStartPoint(); - Point2D endPoint = gp.getEndPoint(); - List coords = new java.util.ArrayList(4); - coords.add(new Double(startPoint.getX())); - coords.add(new Double(startPoint.getY())); - coords.add(new Double(endPoint.getX())); - coords.add(new Double(endPoint.getY())); - return createGradient(gp, coords, baseTransform, transform); - } - - public P createRadialGradient(RadialGradientPaint gradient, - AffineTransform baseTransform, AffineTransform transform) { - double radius = gradient.getRadius(); - Point2D center = gradient.getCenterPoint(); - Point2D focus = gradient.getFocusPoint(); - double dx = focus.getX() - center.getX(); - double dy = focus.getY() - center.getY(); - double d = Math.sqrt(dx * dx + dy * dy); - if (d > radius) { - // The center point must be within the circle with - // radius radius centered at center so limit it to that. - double scale = (radius * .9999) / d; - dx *= scale; - dy *= scale; - } - List coords = new java.util.ArrayList(6); - coords.add(Double.valueOf(center.getX() + dx)); - coords.add(Double.valueOf(center.getY() + dy)); - coords.add(Double.valueOf(0)); - coords.add(Double.valueOf(center.getX())); - coords.add(Double.valueOf(center.getY())); - coords.add(Double.valueOf(radius)); - return createGradient(gradient, coords, baseTransform, transform); - } - - private P createGradient(MultipleGradientPaint gradient, List coords, - AffineTransform baseTransform, AffineTransform transform) { - List matrix = createTransform(gradient, baseTransform, transform); - List bounds = createBounds(gradient); - List functions = createFunctions(gradient); - // Gradients are currently restricted to sRGB - PDFDeviceColorSpace colorSpace = new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_RGB); - Function function = new Function(3, null, null, functions, bounds, null); - Shading shading = makeShading(gradient instanceof LinearGradientPaint ? 2 : 3, colorSpace, - coords, function); - return makePattern(2, shading, matrix); - } - - private List createTransform(MultipleGradientPaint gradient, - AffineTransform baseTransform, AffineTransform transform) { - AffineTransform gradientTransform = new AffineTransform(baseTransform); - gradientTransform.concatenate(transform); - gradientTransform.concatenate(gradient.getTransform()); - List matrix = new ArrayList(6); - double[] m = new double[6]; - gradientTransform.getMatrix(m); - for (double d : m) { - matrix.add(Double.valueOf(d)); - } - return matrix; - } - - private Color getsRGBColor(Color c) { - // Color space must be consistent, so convert to sRGB if necessary - // TODO really? - return c.getColorSpace().isCS_sRGB() ? c : ColorUtil.toSRGBColor(c); - } - - private List createBounds(MultipleGradientPaint gradient) { - // TODO is the conversion to double necessary? - float[] fractions = gradient.getFractions(); - List bounds = new java.util.ArrayList(fractions.length); - for (float offset : fractions) { - if (0f < offset && offset < 1f) { - bounds.add(Double.valueOf(offset)); - } - } - return bounds; - } - - private List createFunctions(MultipleGradientPaint gradient) { - List colors = createColors(gradient); - List functions = new ArrayList(); - for (int currentPosition = 0, lastPosition = colors.size() - 1; - currentPosition < lastPosition; - currentPosition++) { - Color currentColor = colors.get(currentPosition); - Color nextColor = colors.get(currentPosition + 1); - float[] c0 = currentColor.getColorComponents(null); - float[] c1 = nextColor.getColorComponents(null); - Function function = new Function(2, null, null, c0, c1, 1.0); - functions.add(function); - } - return functions; - } - - private List createColors(MultipleGradientPaint gradient) { - Color[] svgColors = gradient.getColors(); - List gradientColors = new ArrayList(svgColors.length + 2); - float[] fractions = gradient.getFractions(); - if (fractions[0] > 0f) { - gradientColors.add(getsRGBColor(svgColors[0])); - } - for (Color c : svgColors) { - gradientColors.add(getsRGBColor(c)); - } - if (fractions[fractions.length - 1] < 1f) { - gradientColors.add(getsRGBColor(svgColors[svgColors.length - 1])); - } - return gradientColors; - } - - protected abstract Shading makeShading(int shadingType, PDFDeviceColorSpace colorSpace, - List coords, Function function); - - protected abstract P makePattern(int patternType, Shading shading, List matrix); -} diff --git a/src/java/org/apache/fop/render/shading/GradientMaker.java b/src/java/org/apache/fop/render/shading/GradientMaker.java new file mode 100644 index 000000000..62eab6a48 --- /dev/null +++ b/src/java/org/apache/fop/render/shading/GradientMaker.java @@ -0,0 +1,157 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.render.shading; + +import java.awt.Color; +import java.awt.geom.AffineTransform; +import java.awt.geom.Point2D; +import java.util.ArrayList; +import java.util.List; + +import org.apache.batik.ext.awt.LinearGradientPaint; +import org.apache.batik.ext.awt.MultipleGradientPaint; +import org.apache.batik.ext.awt.RadialGradientPaint; + +import org.apache.xmlgraphics.java2d.color.ColorUtil; + +import org.apache.fop.pdf.PDFDeviceColorSpace; + +public abstract class GradientMaker

{ + + public P makeLinearGradient(LinearGradientPaint gp, + AffineTransform baseTransform, AffineTransform transform) { + Point2D startPoint = gp.getStartPoint(); + Point2D endPoint = gp.getEndPoint(); + List coords = new java.util.ArrayList(4); + coords.add(new Double(startPoint.getX())); + coords.add(new Double(startPoint.getY())); + coords.add(new Double(endPoint.getX())); + coords.add(new Double(endPoint.getY())); + return makeGradient(gp, coords, baseTransform, transform); + } + + public P makeRadialGradient(RadialGradientPaint gradient, + AffineTransform baseTransform, AffineTransform transform) { + double radius = gradient.getRadius(); + Point2D center = gradient.getCenterPoint(); + Point2D focus = gradient.getFocusPoint(); + double dx = focus.getX() - center.getX(); + double dy = focus.getY() - center.getY(); + double d = Math.sqrt(dx * dx + dy * dy); + if (d > radius) { + // The center point must be within the circle with + // radius radius centered at center so limit it to that. + double scale = (radius * .9999) / d; + dx *= scale; + dy *= scale; + } + List coords = new java.util.ArrayList(6); + coords.add(Double.valueOf(center.getX() + dx)); + coords.add(Double.valueOf(center.getY() + dy)); + coords.add(Double.valueOf(0)); + coords.add(Double.valueOf(center.getX())); + coords.add(Double.valueOf(center.getY())); + coords.add(Double.valueOf(radius)); + return makeGradient(gradient, coords, baseTransform, transform); + } + + private P makeGradient(MultipleGradientPaint gradient, List coords, + AffineTransform baseTransform, AffineTransform transform) { + List matrix = makeTransform(gradient, baseTransform, transform); + List bounds = makeBounds(gradient); + List functions = makeFunctions(gradient); + // Gradients are currently restricted to sRGB + PDFDeviceColorSpace colorSpace = new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_RGB); + Function function = new Function(3, null, null, functions, bounds, null); + Shading shading = makeShading(gradient instanceof LinearGradientPaint ? 2 : 3, colorSpace, + coords, function); + return makePattern(2, shading, matrix); + } + + private List makeTransform(MultipleGradientPaint gradient, + AffineTransform baseTransform, AffineTransform transform) { + AffineTransform gradientTransform = new AffineTransform(baseTransform); + gradientTransform.concatenate(transform); + gradientTransform.concatenate(gradient.getTransform()); + List matrix = new ArrayList(6); + double[] m = new double[6]; + gradientTransform.getMatrix(m); + for (double d : m) { + matrix.add(Double.valueOf(d)); + } + return matrix; + } + + private Color getsRGBColor(Color c) { + // Color space must be consistent, so convert to sRGB if necessary + // TODO really? + return c.getColorSpace().isCS_sRGB() ? c : ColorUtil.toSRGBColor(c); + } + + private List makeBounds(MultipleGradientPaint gradient) { + // TODO is the conversion to double necessary? + float[] fractions = gradient.getFractions(); + List bounds = new java.util.ArrayList(fractions.length); + for (float offset : fractions) { + if (0f < offset && offset < 1f) { + bounds.add(Double.valueOf(offset)); + } + } + return bounds; + } + + private List makeFunctions(MultipleGradientPaint gradient) { + List colors = makeColors(gradient); + List functions = new ArrayList(); + for (int currentPosition = 0, lastPosition = colors.size() - 1; + currentPosition < lastPosition; + currentPosition++) { + Color currentColor = colors.get(currentPosition); + Color nextColor = colors.get(currentPosition + 1); + float[] c0 = currentColor.getColorComponents(null); + float[] c1 = nextColor.getColorComponents(null); + Function function = new Function(2, null, null, c0, c1, 1.0); + functions.add(function); + } + return functions; + } + + private List makeColors(MultipleGradientPaint gradient) { + Color[] svgColors = gradient.getColors(); + List gradientColors = new ArrayList(svgColors.length + 2); + float[] fractions = gradient.getFractions(); + if (fractions[0] > 0f) { + gradientColors.add(getsRGBColor(svgColors[0])); + } + for (Color c : svgColors) { + gradientColors.add(getsRGBColor(c)); + } + if (fractions[fractions.length - 1] < 1f) { + gradientColors.add(getsRGBColor(svgColors[svgColors.length - 1])); + } + return gradientColors; + } + + protected abstract Shading makeShading(int shadingType, PDFDeviceColorSpace colorSpace, + List coords, Function function); + + protected abstract P makePattern(int patternType, Shading shading, List matrix); + +} diff --git a/src/java/org/apache/fop/render/shading/PDFGradientFactory.java b/src/java/org/apache/fop/render/shading/PDFGradientFactory.java deleted file mode 100644 index 576ae3649..000000000 --- a/src/java/org/apache/fop/render/shading/PDFGradientFactory.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.fop.render.shading; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.fop.pdf.PDFDeviceColorSpace; -import org.apache.fop.pdf.PDFFunction; -import org.apache.fop.pdf.PDFPattern; -import org.apache.fop.pdf.PDFShading; -import org.apache.fop.svg.PDFGraphics2D; - -public class PDFGradientFactory extends GradientFactory { - - private final PDFGraphics2D graphics2D; - - public PDFGradientFactory(PDFGraphics2D pdfGraphics2D) { - this.graphics2D = pdfGraphics2D; - } - - @Override - protected Shading makeShading(int shadingType, PDFDeviceColorSpace colorSpace, - List coords, Function function) { - List pdfFunctions = new ArrayList(function.getFunctions().size()); - for (Function f : function.getFunctions()) { - pdfFunctions.add(graphics2D.registerFunction(new PDFFunction(f))); - } - PDFFunction pdfFunction = graphics2D.registerFunction(new PDFFunction(function, pdfFunctions)); - PDFShading shading = new PDFShading(shadingType, colorSpace, null, null, false, - coords, null, pdfFunction, null); - return graphics2D.registerShading(shading); - } - - @Override - protected PDFPattern makePattern(int patternType, Shading shading, List matrix) { - PDFPattern pattern = new PDFPattern(patternType, shading, null, null, matrix); - return graphics2D.registerPattern(pattern); - } - -} diff --git a/src/java/org/apache/fop/render/shading/PSGradientFactory.java b/src/java/org/apache/fop/render/shading/PSGradientFactory.java deleted file mode 100644 index 0efdc3192..000000000 --- a/src/java/org/apache/fop/render/shading/PSGradientFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.fop.render.shading; - -import java.util.List; - -import org.apache.fop.pdf.PDFDeviceColorSpace; -import org.apache.fop.render.ps.svg.PSPattern; -import org.apache.fop.render.ps.svg.PSShading; - -public class PSGradientFactory extends GradientFactory { - - @Override - protected Shading makeShading(int shadingType, - PDFDeviceColorSpace colorSpace, List coords, Function function) { - return new PSShading(shadingType, colorSpace, null, null, false, coords, null, function, null); - } - - @Override - protected PSPattern makePattern(int patternType, Shading shading, List matrix) { - return new PSPattern(patternType, shading, null, null, matrix); - } -} diff --git a/src/java/org/apache/fop/svg/PDFGraphics2D.java b/src/java/org/apache/fop/svg/PDFGraphics2D.java index 8a5615cc6..0e4134d95 100644 --- a/src/java/org/apache/fop/svg/PDFGraphics2D.java +++ b/src/java/org/apache/fop/svg/PDFGraphics2D.java @@ -95,7 +95,7 @@ import org.apache.fop.pdf.PDFXObject; import org.apache.fop.render.pdf.ImageRawCCITTFaxAdapter; import org.apache.fop.render.pdf.ImageRawJPEGAdapter; import org.apache.fop.render.pdf.ImageRenderedAdapter; -import org.apache.fop.render.shading.PDFGradientFactory; +import org.apache.fop.render.pdf.svg.PDFGradientMaker; /** *

PDF Graphics 2D. @@ -813,14 +813,14 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand gpaint.isCyclic() ? LinearGradientPaint.REPEAT : LinearGradientPaint.NO_CYCLE); } if (paint instanceof LinearGradientPaint && gradientSupported((LinearGradientPaint) paint)) { - PDFPattern pattern = new PDFGradientFactory(this) - .createLinearGradient((LinearGradientPaint) paint, getBaseTransform(), getTransform()); + PDFPattern pattern = new PDFGradientMaker(this) + .makeLinearGradient((LinearGradientPaint) paint, getBaseTransform(), getTransform()); currentStream.write(pattern.getColorSpaceOut(fill)); return true; } if (paint instanceof RadialGradientPaint && gradientSupported((RadialGradientPaint) paint)) { - PDFPattern pattern = new PDFGradientFactory(this) - .createRadialGradient((RadialGradientPaint) paint, getBaseTransform(), getTransform()); + PDFPattern pattern = new PDFGradientMaker(this) + .makeRadialGradient((RadialGradientPaint) paint, getBaseTransform(), getTransform()); currentStream.write(pattern.getColorSpaceOut(fill)); return true; } -- cgit v1.2.3