aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/ps
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2014-07-10 17:51:53 +0000
committerVincent Hennebert <vhennebert@apache.org>2014-07-10 17:51:53 +0000
commit2cf4301b4fae392b6d904457974092f3634902c0 (patch)
treef86859711020f058008bda74fc6a1475088543f1 /src/java/org/apache/fop/render/ps
parentb1e0d1b19f5bd04f2cdb5715bc04506b34a8183b (diff)
downloadxmlgraphics-fop-2cf4301b4fae392b6d904457974092f3634902c0.tar.gz
xmlgraphics-fop-2cf4301b4fae392b6d904457974092f3634902c0.zip
Small adjustments to make duplication in PDF and PostScript gradients more apparent
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP-2393_gradient-rendering@1609526 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/ps')
-rw-r--r--src/java/org/apache/fop/render/ps/svg/PSSVGGraphics2D.java31
1 files changed, 15 insertions, 16 deletions
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 abfbdd859..12a482c94 100644
--- a/src/java/org/apache/fop/render/ps/svg/PSSVGGraphics2D.java
+++ b/src/java/org/apache/fop/render/ps/svg/PSSVGGraphics2D.java
@@ -104,24 +104,24 @@ public class PSSVGGraphics2D extends PSGraphics2D implements GradientRegistrar {
List<Double> matrix = createGradientTransform(gp);
- List<Double> theCoords = new java.util.ArrayList<Double>();
- theCoords.add(gp.getStartPoint().getX());
- theCoords.add(gp.getStartPoint().getX());
- theCoords.add(gp.getEndPoint().getX());
- theCoords.add(gp.getEndPoint().getY());
+ Point2D startPoint = gp.getStartPoint();
+ Point2D endPoint = gp.getEndPoint();
+ List<Double> coords = new java.util.ArrayList<Double>(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()));
List<Color> colors = createGradientColors(gp);
List<Double> bounds = createGradientBounds(gp);
- PDFDeviceColorSpace colSpace;
- colSpace = new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_RGB);
+ //Gradients are currently restricted to sRGB
+ PDFDeviceColorSpace colSpace = new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_RGB);
PSGradientFactory gradientFactory = new PSGradientFactory();
- PSPattern myPattern = gradientFactory.createGradient(false, colSpace,
- colors, bounds, theCoords, matrix);
-
- gen.write(myPattern.toString());
+ PSPattern pattern = gradientFactory.createGradient(false, colSpace, colors, bounds, coords, matrix);
+ gen.write(pattern.toString());
}
private void handleRadialGradient(RadialGradientPaint gp, PSGenerator gen) throws IOException {
@@ -157,14 +157,13 @@ public class PSSVGGraphics2D extends PSGraphics2D implements GradientRegistrar {
List<Color> colors = createGradientColors(gp);
List<Double> bounds = createGradientBounds(gp);
- PDFDeviceColorSpace colSpace;
- colSpace = new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_RGB);
+ //Gradients are currently restricted to sRGB
+ PDFDeviceColorSpace colSpace = new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_RGB);
PSGradientFactory gradientFactory = new PSGradientFactory();
- PSPattern myPattern = gradientFactory.createGradient(true, colSpace,
- colors, bounds, theCoords, matrix);
+ PSPattern pattern = gradientFactory.createGradient(true, colSpace, colors, bounds, theCoords, matrix);
- gen.write(myPattern.toString());
+ gen.write(pattern.toString());
}
private List<Double> createGradientTransform(MultipleGradientPaint gradient) {