From dc62d1034852b4e9102d4a9a200e85717323e5f4 Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Fri, 18 Jul 2014 13:48:07 +0000 Subject: [PATCH] For a Shading object, domain is optional and its default value is what we need git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP-2393_gradient-rendering@1611651 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/pdf/PDFShading.java | 7 ------ .../apache/fop/render/gradient/Shading.java | 23 ------------------- .../fop/render/gradient/GradientTestCase.java | 6 ----- .../render/ps/svg/expected-linear-gradient.ps | 1 - .../render/ps/svg/expected-radial-gradient.ps | 1 - 5 files changed, 38 deletions(-) diff --git a/src/java/org/apache/fop/pdf/PDFShading.java b/src/java/org/apache/fop/pdf/PDFShading.java index fa12771b9..db9e57c30 100644 --- a/src/java/org/apache/fop/pdf/PDFShading.java +++ b/src/java/org/apache/fop/pdf/PDFShading.java @@ -165,13 +165,6 @@ public class PDFShading extends PDFObject { } else if (other.getBBox() != null) { return false; } - if (shading.getDomain() != null) { - if (!shading.getDomain().equals(other.getDomain())) { - return false; - } - } else if (other.getDomain() != null) { - return false; - } if (shading.getMatrix() != null) { if (!shading.getMatrix().equals(other.getMatrix())) { return false; diff --git a/src/java/org/apache/fop/render/gradient/Shading.java b/src/java/org/apache/fop/render/gradient/Shading.java index a9c9b1072..53a6f7d9e 100644 --- a/src/java/org/apache/fop/render/gradient/Shading.java +++ b/src/java/org/apache/fop/render/gradient/Shading.java @@ -73,16 +73,6 @@ public class Shading { */ private final List background; - /** - * Optional for Type 1: Array of four numbers, xmin, xmax, ymin, ymax. - * Default is [0 1 0 1] - * Optional for Type 2: An array of two numbers between which the blend - * varies between start and end points. Default is 0, 1. - * Optional for Type 3: An array of two numbers between which the blend - * varies between start and end points. Default is 0, 1. - */ - private final List domain; - /** * Required for Type 4,5,6, and 7: Array of Doubles which specifies * how to decode coordinate and color component values. @@ -142,7 +132,6 @@ public class Shading { this.bbox = null; this.antiAlias = false; this.coords = coords; - this.domain = Arrays.asList(0.0, 1.0); this.function = function; this.extend = Arrays.asList(true, true); this.matrix = null; @@ -181,10 +170,6 @@ public class Shading { return background; } - public List getDomain() { - return domain; - } - public List getDecode() { return decode; } @@ -258,10 +243,6 @@ public class Shading { private void outputShadingType1(StringBuilder out, DoubleFormatter doubleFormatter, Shading.FunctionRenderer functionRenderer) { - out.append("/Domain "); - GradientMaker.outputDoubles(out, doubleFormatter, domain); - out.append("\n"); - if (matrix != null) { out.append("/Matrix "); GradientMaker.outputDoubles(out, doubleFormatter, matrix); @@ -278,10 +259,6 @@ public class Shading { out.append("\n"); } - out.append("/Domain "); - GradientMaker.outputDoubles(out, doubleFormatter, domain); - out.append("\n"); - out.append("/Extend [ "); for (Boolean b : extend) { out.append(b); diff --git a/test/java/org/apache/fop/render/gradient/GradientTestCase.java b/test/java/org/apache/fop/render/gradient/GradientTestCase.java index b96631db7..a7796ca46 100644 --- a/test/java/org/apache/fop/render/gradient/GradientTestCase.java +++ b/test/java/org/apache/fop/render/gradient/GradientTestCase.java @@ -72,11 +72,6 @@ public class GradientTestCase { return this; } - ShadingChecker domain(Double... expectedDomain) { - assertArrayEquals(expectedDomain, shading.getDomain().toArray()); - return this; - } - ShadingChecker extend(Boolean... expectedExtend) { assertArrayEquals(expectedExtend, shading.getExtend().toArray()); return this; @@ -138,7 +133,6 @@ public class GradientTestCase { ShadingChecker shadingChecker = patternChecker.shading() .shadingType(2) .coords(0.0, 0.0, 100.0, 100.0) - .domain(0.0, 1.0) .extend(true, true); FunctionChecker functionChecker = shadingChecker.function() .functionType(3) diff --git a/test/java/org/apache/fop/render/ps/svg/expected-linear-gradient.ps b/test/java/org/apache/fop/render/ps/svg/expected-linear-gradient.ps index 8c753d06a..8ddc64486 100644 --- a/test/java/org/apache/fop/render/ps/svg/expected-linear-gradient.ps +++ b/test/java/org/apache/fop/render/ps/svg/expected-linear-gradient.ps @@ -6,7 +6,6 @@ /ShadingType 2 /ColorSpace /DeviceRGB /Coords [ 115 285 15 15 ] -/Domain [ 0 1 ] /Extend [ true true ] /Function << /FunctionType 3 diff --git a/test/java/org/apache/fop/render/ps/svg/expected-radial-gradient.ps b/test/java/org/apache/fop/render/ps/svg/expected-radial-gradient.ps index b4af477b2..527f27965 100644 --- a/test/java/org/apache/fop/render/ps/svg/expected-radial-gradient.ps +++ b/test/java/org/apache/fop/render/ps/svg/expected-radial-gradient.ps @@ -6,7 +6,6 @@ /ShadingType 3 /ColorSpace /DeviceRGB /Coords [ 840 180 0 840 180 16 ] -/Domain [ 0 1 ] /Extend [ true true ] /Function << /FunctionType 3 -- 2.39.5