]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
For a Shading object, domain is optional and its default value is what we need
authorVincent Hennebert <vhennebert@apache.org>
Fri, 18 Jul 2014 13:48:07 +0000 (13:48 +0000)
committerVincent Hennebert <vhennebert@apache.org>
Fri, 18 Jul 2014 13:48:07 +0000 (13:48 +0000)
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
src/java/org/apache/fop/render/gradient/Shading.java
test/java/org/apache/fop/render/gradient/GradientTestCase.java
test/java/org/apache/fop/render/ps/svg/expected-linear-gradient.ps
test/java/org/apache/fop/render/ps/svg/expected-radial-gradient.ps

index fa12771b97145820489d210acf60addd7eb31890..db9e57c309c1641ffde641a19ba6a4b2d59ba9e2 100644 (file)
@@ -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;
index a9c9b10729dbe9632760f27aa2dc3466a37fe874..53a6f7d9e577793154cf038d84df0c8b445ef6fb 100644 (file)
@@ -73,16 +73,6 @@ public class Shading {
      */
     private final List<Double> 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<Double> 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<Double> getDomain() {
-        return domain;
-    }
-
     public List<Double> 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);
index b96631db701f3bd649d736aa5dd4295fc035634f..a7796ca46c71aa46378765c957a50fe2965214c7 100644 (file)
@@ -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)
index 8c753d06a5789cce6f3834388a4394d1c07f1c41..8ddc64486bb3046e0b81d5607fd7729ebf4bf3a8 100644 (file)
@@ -6,7 +6,6 @@
 /ShadingType 2
 /ColorSpace /DeviceRGB
 /Coords [ 115 285 15 15 ]
-/Domain [ 0 1 ]
 /Extend [ true true ]
 /Function <<
 /FunctionType 3
index b4af477b26bc30f120431c2b4091174ba2f8972a..527f2796539ef141c7d669386d899e6c5a7f7fc8 100644 (file)
@@ -6,7 +6,6 @@
 /ShadingType 3
 /ColorSpace /DeviceRGB
 /Coords [ 840 180 0 840 180 16 ]
-/Domain [ 0 1 ]
 /Extend [ true true ]
 /Function <<
 /FunctionType 3