You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by de...@apache.org on 2005/09/15 03:37:46 UTC

svn commit: r289128 - in /xmlgraphics/batik/branches/svg11: ./ samples/tests/spec/scripting/ sources/org/apache/batik/ext/awt/geom/ sources/org/apache/batik/gvt/ sources/org/apache/batik/svggen/ test-references/org/apache/batik/svggen/ test-sources/org...

Author: deweese
Date: Wed Sep 14 18:37:21 2005
New Revision: 289128

URL: http://svn.apache.org/viewcvs?rev=289128&view=rev
Log:
1) Fixed PR: 36511 - Rendering error.
   Problem was that the rect list manager didn't recompute bounds properly.
2) Some of the performance fixes from the 'static' work.
3) Some more small tweaks to GeneratorContext precision.  Default 
   precision now matches previous default.  Also now correctly reports
   precision when it is the default.
4) Fixed SVG generator test-references to be in sync with changes.
5) Tweaked Memory leak test so it seems to actually work with the
   generational GC (it now basically just allocates memory until
   the objects are collected or it get's an OutOfMemoryError -
   not very elegant I know ;)


Modified:
    xmlgraphics/batik/branches/svg11/build.xml
    xmlgraphics/batik/branches/svg11/samples/tests/spec/scripting/addDescOnClick.svg
    xmlgraphics/batik/branches/svg11/sources/org/apache/batik/ext/awt/geom/RectListManager.java
    xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/AbstractGraphicsNode.java
    xmlgraphics/batik/branches/svg11/sources/org/apache/batik/svggen/SVGGeneratorContext.java
    xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/ATransform.svg
    xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/BasicShapes.svg
    xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Bug4945.svg
    xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Clip.svg
    xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Color1.svg
    xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Color2.svg
    xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Paints.svg
    xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/ShearTest.svg
    xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/test/MemoryLeakTest.java

Modified: xmlgraphics/batik/branches/svg11/build.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/build.xml?rev=289128&r1=289127&r2=289128&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/build.xml (original)
+++ xmlgraphics/batik/branches/svg11/build.xml Wed Sep 14 18:37:21 2005
@@ -1158,7 +1158,7 @@
 <!--      <jvmarg value="-Xincgc" /> -->
 <!--      <jvmarg value="-Xrunhprof:format=b" /> -->
 <!--      <jvmarg value="-Xrunhprof:net=localhost:1234,format=b" /> -->
-      <jvmarg value="-Xmx512m"/>  <jvmarg value="-Xms64m"/>
+      <jvmarg value="-Xmx256m"/>  <jvmarg value="-Xms64m"/>
       <classpath>
         <pathelement location="${dest}" />
         <path refid="libs-classpath"/>

Modified: xmlgraphics/batik/branches/svg11/samples/tests/spec/scripting/addDescOnClick.svg
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/samples/tests/spec/scripting/addDescOnClick.svg?rev=289128&r1=289127&r2=289128&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/samples/tests/spec/scripting/addDescOnClick.svg (original)
+++ xmlgraphics/batik/branches/svg11/samples/tests/spec/scripting/addDescOnClick.svg Wed Sep 14 18:37:21 2005
@@ -71,6 +71,32 @@
     toggleDesc();
     toggleTitle();
 
+
+    var desc2  = document.getElementById("foo2");
+    var newD2 = document.createTextNode("Text 1");
+    var oldD2 = desc2.firstChild;
+
+    function toggleDesc2() {
+       desc2.removeChild(oldD2);
+       desc2.appendChild(newD2);
+       var tmp = newD2; newD2=oldD2; oldD2=tmp;
+       setTimeout("toggleDesc2()", 1000);
+    }
+
+    var title2  = document.getElementById("bar2");
+    var newT2 = document.createTextNode("Title 2");
+    var oldT2 = title2.firstChild;
+
+    function toggleTitle2() {
+       title2.removeChild(oldT2);
+       title2.appendChild(newT2);
+       var tmp = newT2; newT2=oldT2; oldT2=tmp;
+       setTimeout("toggleTitle2()", 1000);
+    }
+
+    toggleDesc2();
+    toggleTitle2();
+
     var elT = document.getElementById("title");
     var tglTitle = elT.firstChild;
     var elD = document.getElementById("desc");
@@ -155,6 +181,14 @@
 
        <rect x="135" y="285" width="75" height="75" style="fill:gold"
           ><title id="bar">Title 1</title
+          ><desc >Pre-existing Desc</desc></rect>
+
+       <rect x="240" y="285" width="75" height="75" style="fill:crimson"
+          ><title>Pre Existing Title</title
+          ><desc id="foo2">Text 2</desc></rect>
+
+       <rect x="345" y="285" width="75" height="75" style="fill:gold"
+          ><title id="bar2">Title 1</title
           ><desc >Pre-existing Desc</desc></rect>
 
     </g>

Modified: xmlgraphics/batik/branches/svg11/sources/org/apache/batik/ext/awt/geom/RectListManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/sources/org/apache/batik/ext/awt/geom/RectListManager.java?rev=289128&r1=289127&r2=289128&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/sources/org/apache/batik/ext/awt/geom/RectListManager.java (original)
+++ xmlgraphics/batik/branches/svg11/sources/org/apache/batik/ext/awt/geom/RectListManager.java Wed Sep 14 18:37:21 2005
@@ -44,6 +44,16 @@
 
     Rectangle bounds = null;
 
+    public void dump() {
+        System.err.println("RLM: " + this + " Sz: " + size);
+        System.err.println("Bounds: " + getBounds());
+        for (int i=0; i<size; i++) {
+            Rectangle r = rects[i];
+            System.err.println("  [" + r.x + ", " + r.y + ", " +
+                               r.width + ", " + r.height + "]");
+        }
+    }
+
     /**
      * The comparator used to sort the elements of this List.
      * Sorts on x value of Rectangle.
@@ -179,6 +189,7 @@
         for (int i=0; i<size; i++) 
             rects[i] = null;
         size=0;
+        bounds = null;
     }
 
     /**
@@ -290,6 +301,7 @@
 
         rects[idx] = rect;
         size++;
+        bounds=null;
     }
 
     public boolean addAll(Collection c) {
@@ -404,6 +416,7 @@
             if (rects[idx].equals(rect)) {
                 System.arraycopy(rects, idx+1, rects, idx, size-idx);
                 size--;
+                bounds = null;
                 return true;
             }
             if (rects[idx].x != rect.x)  break;
@@ -414,6 +427,7 @@
             if (rects[idx].equals(rect)) {
                 System.arraycopy(rects, idx+1, rects, idx, size-idx);
                 size--;
+                bounds = null;
                 return true;
             }
             if (rects[idx].x != rect.x)  break;
@@ -469,6 +483,7 @@
                 i++;
             }
             size = j;
+            bounds = null;
         }
         return ret;
     }
@@ -522,6 +537,7 @@
                 i++;
             }
             size = j;
+            bounds = null;
         }
         return ret;
     }
@@ -545,6 +561,7 @@
         if (size == 0) {
             System.arraycopy(rlm.rects, 0, dst, size, rlm.size);
             size = rlm.size;
+            bounds = null;
             return;
         }
         
@@ -582,6 +599,7 @@
         }
         rects = dst;
         size += rlm.size;
+        bounds = null;
     }
 
     public void mergeRects(int overhead, int lineOverhead) {
@@ -675,6 +693,7 @@
             i++;
         }
         size = j;
+        bounds=null;
         r = getBounds();
         if (r == null) return;
         if (overhead + (r.height*lineOverhead) + (r.height*r.width) < area) {
@@ -793,6 +812,7 @@
             i++;
         }
         size = j;
+        bounds = null;
     }
 
     protected void splitRect(Rectangle r, Rectangle sr,

Modified: xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/AbstractGraphicsNode.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/AbstractGraphicsNode.java?rev=289128&r1=289127&r2=289128&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/AbstractGraphicsNode.java (original)
+++ xmlgraphics/batik/branches/svg11/sources/org/apache/batik/gvt/AbstractGraphicsNode.java Wed Sep 14 18:37:21 2005
@@ -273,6 +273,9 @@
     }
 
     public void setClip(ClipRable newClipper) {
+        if ((newClipper == null) && (this.clip == null))
+            return; // No change still no clip.
+
         fireGraphicsNodeChangeStarted();
         invalidateGeometryCache();
         this.clip = newClipper;
@@ -344,6 +347,9 @@
      * @param newMask the new mask of this node
      */
     public void setMask(Mask newMask) {
+        if ((newMask == null) && (this.mask == null)) 
+            return; // No change still no mask.
+
         fireGraphicsNodeChangeStarted();
         invalidateGeometryCache();
         this.mask = newMask;
@@ -363,6 +369,9 @@
      * @param newFilter the new filter of this node
      */
     public void setFilter(Filter newFilter) {
+        if ((newFilter == null) && (this.filter == null)) 
+            return; // No change still no filter.
+
         fireGraphicsNodeChangeStarted();
         invalidateGeometryCache();
         this.filter = newFilter;

Modified: xmlgraphics/batik/branches/svg11/sources/org/apache/batik/svggen/SVGGeneratorContext.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/sources/org/apache/batik/svggen/SVGGeneratorContext.java?rev=289128&r1=289127&r2=289128&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/sources/org/apache/batik/svggen/SVGGeneratorContext.java (original)
+++ xmlgraphics/batik/branches/svg11/sources/org/apache/batik/svggen/SVGGeneratorContext.java Wed Sep 14 18:37:21 2005
@@ -108,7 +108,12 @@
      * Number of decimal places to use in output values.
      * 3 decimal places are used by default.
      */
-    int precision;
+    int precision = 4;
+
+    /**
+     * Current double value formatter
+     */
+    protected DecimalFormat decimalFormat = decimalFormats[precision];
 
     /**
      * Class to describe the GraphicContext defaults to
@@ -429,11 +434,6 @@
             return decimalFormat.format(value);
         } 
     }
-
-    /**
-     * Current double value formatter
-     */
-    protected DecimalFormat decimalFormat = decimalFormats[3];
 
     protected static DecimalFormatSymbols dsf 
         = new DecimalFormatSymbols(Locale.US);

Modified: xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/ATransform.svg
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/ATransform.svg?rev=289128&r1=289127&r2=289128&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/ATransform.svg (original)
+++ xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/ATransform.svg Wed Sep 14 18:37:21 2005
@@ -21,7 +21,7 @@
       <text xml:space="preserve" x="10" y="12" stroke="none">Shear</text>
       <rect x="10" y="20" transform="matrix(1,1,0.2,1,0,0)" width="50" height="30" stroke="none" />
     </g>
-    <g fill="rgb(0,0,0)" text-rendering="optimizeLegibility" fill-opacity="0.5019608139992" stroke-opacity="0.5019608139992" stroke="rgb(0,0,0)">
+    <g fill="rgb(0,0,0)" text-rendering="optimizeLegibility" fill-opacity="0.501960813999" stroke-opacity="0.501960813999" stroke="rgb(0,0,0)">
       <rect width="56" x="164" height="80" y="150" stroke="none" />
     </g>
   </g>

Modified: xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/BasicShapes.svg
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/BasicShapes.svg?rev=289128&r1=289127&r2=289128&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/BasicShapes.svg (original)
+++ xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/BasicShapes.svg Wed Sep 14 18:37:21 2005
@@ -19,7 +19,7 @@
       <text xml:space="preserve" x="10" y="20" transform="translate(150,90)" stroke="none">GeneralPath</text>
       <path fill="none" d="M30 30 Q30 50 50 60 Q30 50 10 60 Q30 50 30 30 Z" transform="translate(150,90)" />
       <text xml:space="preserve" x="10" y="20" transform="translate(150,180)" stroke="none">Area</text>
-      <path d="M35 32 C47.7025489807129 32 58 42.2974510192871 58 55 C58 67.7025527954102 47.7025489807129 78 35 78 C22.2974510192871 78 12 67.7025527954102 12 55 C12 42.2974510192871 22.2974510192871 32 35 32 ZM10 30 L10 80 L60 80 L60 30 Z" transform="translate(150,180)" stroke="none" />
+      <path d="M35 32 C47.702548980713 32 58 42.297451019287 58 55 C58 67.70255279541 47.702548980713 78 35 78 C22.297451019287 78 12 67.70255279541 12 55 C12 42.297451019287 22.297451019287 32 35 32 ZM10 30 L10 80 L60 80 L60 30 Z" transform="translate(150,180)" stroke="none" />
       <text xml:space="preserve" x="10" y="20" transform="translate(150,270)" stroke="none">QuadCurve2D</text>
       <path fill="none" d="M10 55 Q35 105 60 55" transform="translate(150,270)" />
       <text xml:space="preserve" x="10" y="20" transform="translate(75,340)" stroke="none">Line2D</text>

Modified: xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Bug4945.svg
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Bug4945.svg?rev=289128&r1=289127&r2=289128&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Bug4945.svg (original)
+++ xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Bug4945.svg Wed Sep 14 18:37:21 2005
@@ -15,7 +15,7 @@
       <line y2="80" fill="none" x1="20" x2="120" y1="80" />
       <text xml:space="preserve" x="20" y="120" transform="matrix(1,0.5,0.5,1,-60,-10)" stroke="none">Sheared Font</text>
     </g>
-    <g text-rendering="optimizeLegibility" transform="matrix(0.7071067811865,0.7071067811865,-0.7071067811865,0.7071067811865,149.2893218813452,-120.4163056034261)">
+    <g text-rendering="optimizeLegibility" transform="matrix(0.707106781187,0.707106781187,-0.707106781187,0.707106781187,149.289321881345,-120.416305603426)">
       <text xml:space="preserve" x="220" y="120" stroke="none">Rotated Font</text>
     </g>
   </g>

Modified: xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Clip.svg
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Clip.svg?rev=289128&r1=289127&r2=289128&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Clip.svg (original)
+++ xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Clip.svg Wed Sep 14 18:37:21 2005
@@ -13,13 +13,13 @@
         <path d="M50 0 L100 0 L100 25 L50 25 L50 0 Z" />
       </clipPath>
       <clipPath clipPathUnits="userSpaceOnUse" id="clipPath3">
-        <path d="M100 25 C100 38.8071136474609 77.6142349243164 50 50 50 C22.385763168335 50 0 38.8071136474609 0 25 C0 11.1928863525391 22.385763168335 0 50 0 C77.6142349243164 0 100 11.1928863525391 100 25 Z" />
+        <path d="M100 25 C100 38.807113647461 77.614234924316 50 50 50 C22.385763168335 50 0 38.807113647461 0 25 C0 11.192886352539 22.385763168335 0 50 0 C77.614234924316 0 100 11.192886352539 100 25 Z" />
       </clipPath>
       <clipPath clipPathUnits="userSpaceOnUse" id="clipPath4">
-        <path d="M100 25 C100 38.80712890625 77.6142349243164 50 50 50 C22.385763168335 50 0 38.80712890625 0 25 C0 11.19287109375 22.385763168335 0 50 0 C77.6142349243164 0 100 11.19287109375 100 25 Z" />
+        <path d="M100 25 C100 38.80712890625 77.614234924316 50 50 50 C22.385763168335 50 0 38.80712890625 0 25 C0 11.19287109375 22.385763168335 0 50 0 C77.614234924316 0 100 11.19287109375 100 25 Z" />
       </clipPath>
       <clipPath clipPathUnits="userSpaceOnUse" id="clipPath5">
-        <path d="M200 50 C200 77.6142578125 155.2284698486328 100 100 100 C44.7715263366699 100 0 77.6142578125 0 50 C0 22.3857421875 44.7715263366699 0 100 0 C155.2284698486328 0 200 22.3857421875 200 50 Z" />
+        <path d="M200 50 C200 77.6142578125 155.228469848633 100 100 100 C44.77152633667 100 0 77.6142578125 0 50 C0 22.3857421875 44.77152633667 0 100 0 C155.228469848633 0 200 22.3857421875 200 50 Z" />
       </clipPath>
     </defs>
     <g text-rendering="optimizeLegibility">

Modified: xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Color1.svg
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Color1.svg?rev=289128&r1=289127&r2=289128&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Color1.svg (original)
+++ xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Color1.svg Wed Sep 14 18:37:21 2005
@@ -51,13 +51,13 @@
       <text xml:space="preserve" x="0" y="0" stroke="none">Various opacities</text>
       <rect x="0" y="0" transform="translate(0,10)" fill="rgb(80,255,80)" width="40" height="260" stroke="none" />
     </g>
-    <g font-size="9" transform="translate(150,30)" fill-opacity="0.0470588244498" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.0470588244498">
+    <g font-size="9" transform="translate(150,30)" fill-opacity="0.04705882445" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.04705882445">
       <rect width="40" x="0" height="13" y="0" stroke="none" />
     </g>
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,30)">
       <text xml:space="preserve" x="50" y="6" stroke="none">12</text>
     </g>
-    <g font-size="9" transform="translate(150,43)" fill-opacity="0.0980392172933" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.0980392172933">
+    <g font-size="9" transform="translate(150,43)" fill-opacity="0.098039217293" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.098039217293">
       <rect width="40" x="0" height="13" y="0" stroke="none" />
     </g>
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,43)">
@@ -69,31 +69,31 @@
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,56)">
       <text xml:space="preserve" x="50" y="6" stroke="none">38</text>
     </g>
-    <g font-size="9" transform="translate(150,69)" fill-opacity="0.2000000029802" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.2000000029802">
+    <g font-size="9" transform="translate(150,69)" fill-opacity="0.20000000298" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.20000000298">
       <rect width="40" x="0" height="13" y="0" stroke="none" />
     </g>
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,69)">
       <text xml:space="preserve" x="50" y="6" stroke="none">51</text>
     </g>
-    <g font-size="9" transform="translate(150,82)" fill-opacity="0.2470588237047" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.2470588237047">
+    <g font-size="9" transform="translate(150,82)" fill-opacity="0.247058823705" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.247058823705">
       <rect width="40" x="0" height="13" y="0" stroke="none" />
     </g>
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,82)">
       <text xml:space="preserve" x="50" y="6" stroke="none">63</text>
     </g>
-    <g font-size="9" transform="translate(150,95)" fill-opacity="0.2980392277241" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.2980392277241">
+    <g font-size="9" transform="translate(150,95)" fill-opacity="0.298039227724" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.298039227724">
       <rect width="40" x="0" height="13" y="0" stroke="none" />
     </g>
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,95)">
       <text xml:space="preserve" x="50" y="6" stroke="none">76</text>
     </g>
-    <g font-size="9" transform="translate(150,108)" fill-opacity="0.3490196168423" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.3490196168423">
+    <g font-size="9" transform="translate(150,108)" fill-opacity="0.349019616842" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.349019616842">
       <rect width="40" x="0" height="13" y="0" stroke="none" />
     </g>
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,108)">
       <text xml:space="preserve" x="50" y="6" stroke="none">89</text>
     </g>
-    <g font-size="9" transform="translate(150,121)" fill-opacity="0.4000000059605" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.4000000059605">
+    <g font-size="9" transform="translate(150,121)" fill-opacity="0.40000000596" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.40000000596">
       <rect width="40" x="0" height="13" y="0" stroke="none" />
     </g>
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,121)">
@@ -105,61 +105,61 @@
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,134)">
       <text xml:space="preserve" x="50" y="6" stroke="none">114</text>
     </g>
-    <g font-size="9" transform="translate(150,147)" fill-opacity="0.4980392158031" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.4980392158031">
+    <g font-size="9" transform="translate(150,147)" fill-opacity="0.498039215803" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.498039215803">
       <rect width="40" x="0" height="13" y="0" stroke="none" />
     </g>
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,147)">
       <text xml:space="preserve" x="50" y="6" stroke="none">127</text>
     </g>
-    <g font-size="9" transform="translate(150,160)" fill-opacity="0.5490196347237" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.5490196347237">
+    <g font-size="9" transform="translate(150,160)" fill-opacity="0.549019634724" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.549019634724">
       <rect width="40" x="0" height="13" y="0" stroke="none" />
     </g>
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,160)">
       <text xml:space="preserve" x="50" y="6" stroke="none">140</text>
     </g>
-    <g font-size="9" transform="translate(150,173)" fill-opacity="0.6000000238419" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.6000000238419">
+    <g font-size="9" transform="translate(150,173)" fill-opacity="0.600000023842" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.600000023842">
       <rect width="40" x="0" height="13" y="0" stroke="none" />
     </g>
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,173)">
       <text xml:space="preserve" x="50" y="6" stroke="none">153</text>
     </g>
-    <g font-size="9" transform="translate(150,186)" fill-opacity="0.6470588445663" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.6470588445663">
+    <g font-size="9" transform="translate(150,186)" fill-opacity="0.647058844566" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.647058844566">
       <rect width="40" x="0" height="13" y="0" stroke="none" />
     </g>
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,186)">
       <text xml:space="preserve" x="50" y="6" stroke="none">165</text>
     </g>
-    <g font-size="9" transform="translate(150,199)" fill-opacity="0.6980392336845" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.6980392336845">
+    <g font-size="9" transform="translate(150,199)" fill-opacity="0.698039233685" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.698039233685">
       <rect width="40" x="0" height="13" y="0" stroke="none" />
     </g>
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,199)">
       <text xml:space="preserve" x="50" y="6" stroke="none">178</text>
     </g>
-    <g font-size="9" transform="translate(150,212)" fill-opacity="0.7490196228027" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.7490196228027">
+    <g font-size="9" transform="translate(150,212)" fill-opacity="0.749019622803" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.749019622803">
       <rect width="40" x="0" height="13" y="0" stroke="none" />
     </g>
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,212)">
       <text xml:space="preserve" x="50" y="6" stroke="none">191</text>
     </g>
-    <g font-size="9" transform="translate(150,225)" fill-opacity="0.8000000119209" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.8000000119209">
+    <g font-size="9" transform="translate(150,225)" fill-opacity="0.800000011921" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.800000011921">
       <rect width="40" x="0" height="13" y="0" stroke="none" />
     </g>
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,225)">
       <text xml:space="preserve" x="50" y="6" stroke="none">204</text>
     </g>
-    <g font-size="9" transform="translate(150,238)" fill-opacity="0.8470588326454" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.8470588326454">
+    <g font-size="9" transform="translate(150,238)" fill-opacity="0.847058832645" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.847058832645">
       <rect width="40" x="0" height="13" y="0" stroke="none" />
     </g>
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,238)">
       <text xml:space="preserve" x="50" y="6" stroke="none">216</text>
     </g>
-    <g font-size="9" transform="translate(150,251)" fill-opacity="0.8980392217636" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.8980392217636">
+    <g font-size="9" transform="translate(150,251)" fill-opacity="0.898039221764" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.898039221764">
       <rect width="40" x="0" height="13" y="0" stroke="none" />
     </g>
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,251)">
       <text xml:space="preserve" x="50" y="6" stroke="none">229</text>
     </g>
-    <g font-size="9" transform="translate(150,264)" fill-opacity="0.9490196108818" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.9490196108818">
+    <g font-size="9" transform="translate(150,264)" fill-opacity="0.949019610882" fill="rgb(0,0,0)" text-rendering="optimizeLegibility" stroke="rgb(0,0,0)" stroke-opacity="0.949019610882">
       <rect width="40" x="0" height="13" y="0" stroke="none" />
     </g>
     <g text-rendering="optimizeLegibility" font-size="9" transform="translate(150,264)">

Modified: xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Color2.svg
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Color2.svg?rev=289128&r1=289127&r2=289128&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Color2.svg (original)
+++ xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Color2.svg Wed Sep 14 18:37:21 2005
@@ -12,7 +12,7 @@
       <rect x="10" y="40" width="100" height="50" opacity="0.5" stroke="none" stroke-width="5" />
       <text x="10" y="30" transform="translate(0,90)" stroke="none" stroke-width="5" xml:space="preserve">Transparent Colors, Opaque AlphaComposite SrcOver</text>
     </g>
-    <g transform="translate(0,90)" fill-opacity="0.5019608139992" fill="rgb(0,0,255)" text-rendering="optimizeLegibility" stroke="rgb(0,0,255)" stroke-width="5" stroke-opacity="0.5019608139992">
+    <g transform="translate(0,90)" fill-opacity="0.501960813999" fill="rgb(0,0,255)" text-rendering="optimizeLegibility" stroke="rgb(0,0,255)" stroke-width="5" stroke-opacity="0.501960813999">
       <rect width="100" x="10" height="50" y="40" stroke="none" />
       <rect x="10" y="40" fill="none" width="100" height="50" stroke="rgb(0,255,0)" />
     </g>

Modified: xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Paints.svg
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Paints.svg?rev=289128&r1=289127&r2=289128&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Paints.svg (original)
+++ xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/Paints.svg Wed Sep 14 18:37:21 2005
@@ -19,7 +19,7 @@
       <text xml:space="preserve" x="10" y="10" stroke="none">Semi transparent black</text>
       <text xml:space="preserve" x="40" y="60" stroke="none">Behind Rectangle</text>
     </g>
-    <g transform="translate(0,30)" fill-opacity="0.5019608139992" fill="rgb(255,255,0)" text-rendering="optimizeLegibility" stroke="rgb(255,255,0)" stroke-opacity="0.5019608139992">
+    <g transform="translate(0,30)" fill-opacity="0.501960813999" fill="rgb(255,255,0)" text-rendering="optimizeLegibility" stroke="rgb(255,255,0)" stroke-opacity="0.501960813999">
       <rect width="100" x="10" height="60" y="20" stroke="none" />
     </g>
     <g text-rendering="optimizeLegibility" transform="translate(0,120)">

Modified: xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/ShearTest.svg
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/ShearTest.svg?rev=289128&r1=289127&r2=289128&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/ShearTest.svg (original)
+++ xmlgraphics/batik/branches/svg11/test-references/org/apache/batik/svggen/ShearTest.svg Wed Sep 14 18:37:21 2005
@@ -9,7 +9,7 @@
       <ellipse rx="25" fill="none" ry="30" cx="25" cy="30" />
     </g>
     <g fill="gray" text-rendering="optimizeLegibility" stroke-width="15" transform="translate(0,-150)" stroke="gray">
-      <path fill="none" d="M150 280 C150 296.5685424804688 138.8071136474609 298.80712890625 125 285 C111.1928787231445 271.19287109375 100 246.5685424804688 100 230 C100 213.4314575195312 111.1928787231445 211.1928863525391 125 225 C138.8071136474609 238.8071136474609 150 263.4314575195312 150 280 Z" />
+      <path fill="none" d="M150 280 C150 296.568542480469 138.807113647461 298.80712890625 125 285 C111.192878723145 271.19287109375 100 246.568542480469 100 230 C100 213.431457519531 111.192878723145 211.192886352539 125 225 C138.807113647461 238.807113647461 150 263.431457519531 150 280 Z" />
     </g>
   </g>
 </svg>

Modified: xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/test/MemoryLeakTest.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/test/MemoryLeakTest.java?rev=289128&r1=289127&r2=289128&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/test/MemoryLeakTest.java (original)
+++ xmlgraphics/batik/branches/svg11/test-sources/org/apache/batik/test/MemoryLeakTest.java Wed Sep 14 18:37:21 2005
@@ -45,7 +45,9 @@
     // (why so large I don't know) - it will bail if the all
     // the objects of interest are collected sooner so the runtime
     // is really only a concern for failures.
-    final static int NUM_GC=60;
+    final static int NUM_GC=10;
+    final static int MIN_MEMORY=200000; // 200KB
+    final static int ALLOC_SZ=1000; // 100KB
 
     final static String ERROR_OBJS_NOT_CLEARED = 
         "MemoryLeakTest.message.error.objs.not.cleared";
@@ -82,37 +84,59 @@
     }
 
     public boolean checkObjects(String [] descs) {
-        for (int i=0; i<NUM_GC; i++) {
-            System.gc();
-            boolean passed = true;
-            for (int j=0; j< descs.length; j++) {
-                String desc = descs[j];
-                WeakRef wr = (WeakRef)objs.get(desc);
-                if ((wr != null) && (wr.get() != null)) {
-                    passed = false;
-                    break;
+        Runtime rt = Runtime.getRuntime();
+        List l = new ArrayList();
+        int nBlock = (int)(rt.totalMemory()/(ALLOC_SZ*NUM_GC));
+        try {
+            while (true) {
+                boolean passed = true;
+                synchronized (objs) {
+                    // System.err.println("FreeMemory: " + rt.freeMemory() + 
+                    //                    " of " +rt.totalMemory());
+
+                    for (int i=0; i<descs.length; i++) {
+                        String desc = descs[i];
+                        WeakRef wr = (WeakRef)objs.get(desc);
+                        if ((wr == null) || (wr.get() == null)) continue;
+                        passed = false;
+                        break;
+                    }
                 }
+                if (passed) return true;
+
+                List l2 = new ArrayList();
+                for (int i=0; i<nBlock; i++) {
+                    l2.add(new byte[ALLOC_SZ]);
+                }
+                l.add(l2);
             }
-            if (passed) return true;
-            Thread.yield();
+        } catch (OutOfMemoryError oom) {
+        } finally {
+            l = null;
         }
+        
+        for (int i=0; i<NUM_GC; i++)
+            rt.gc();
 
         StringBuffer sb = new StringBuffer();
+        boolean passed = true;
         synchronized (objs) {
-            boolean passed = true;
-            for (int j=0; j< descs.length; j++) {
-                String desc = descs[j];
+            for (int i=0; i<descs.length; i++) {
+                String desc = descs[i];
                 WeakRef wr = (WeakRef)objs.get(desc);
-                if ((wr == null) || (wr.get() == null)) continue;
+                if (wr == null) continue;
+                Object o = wr.get();
+                if (o == null) continue;
                 if (!passed)
-                    sb.append(","); // Already put one obj out
+                    sb.append(",");
                 passed = false;
                 sb.append("'");
                 sb.append(wr.getDesc());
                 sb.append("'");
             }
+            if (passed) return true;
         }
-        
+
         String objStr = sb.toString();
         TestReport.Entry entry = new TestReport.Entry
             (fmt(ERROR_DESCRIPTION, null),
@@ -134,23 +158,42 @@
     }
 
     public boolean checkAllObjects() {
-        for (int i=0; i<NUM_GC; i++) {
-            System.gc();
-            synchronized (objs) {
+        Runtime rt = Runtime.getRuntime();
+        List l = new ArrayList();
+        int nBlock = (int)(rt.totalMemory()/(ALLOC_SZ*NUM_GC));
+        try {
+            while (true) {
+                // System.err.println("FreeMemory: " + rt.freeMemory() + 
+                //                    " of " +rt.totalMemory());
+
                 boolean passed = true;
-                Iterator iter = objs.values().iterator();
-                while (iter.hasNext()) {
-                    WeakRef wr = (WeakRef)iter.next();
-                    Object o = wr.get();
-                    if (o != null) {
-                        passed = false;
-                        break;
+                synchronized (objs) {
+                    Iterator iter = objs.values().iterator();
+                    while (iter.hasNext()) {
+                        WeakRef wr = (WeakRef)iter.next();
+                        if ((wr != null) && (wr.get() != null)) {
+                            passed = false;
+                            break;
+                        }
                     }
                 }
                 if (passed) return true;
+
+                List l2 = new ArrayList();
+                for (int i=0; i<nBlock; i++) {
+                    l2.add(new byte[ALLOC_SZ]);
+                }
+                l.add(l2);
             }
+        } catch (OutOfMemoryError oom) {
+        } finally {
+            l = null;
         }
-        
+
+        for (int i=0; i<NUM_GC; i++)
+            rt.gc();
+
+
         StringBuffer sb = new StringBuffer();
         synchronized (objs) {
             boolean passed = true;
@@ -168,7 +211,7 @@
             }
             if (passed) return true;
         }
-        
+
         String objStr = sb.toString();
 
         TestReport.Entry entry = new TestReport.Entry