/hg/icedtea7-forest/jdk: 3 new changesets

andrew at icedtea.classpath.org andrew at icedtea.classpath.org
Sat Oct 3 21:23:42 UTC 2015


changeset 32f25e4cc4aa in /hg/icedtea7-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea7-forest/jdk?cmd=changeset;node=32f25e4cc4aa
author: andrew
date: Sat Oct 03 19:28:14 2015 +0100

	PR2512: Reset success following calls in LayoutManager.cpp


changeset b0194003cf27 in /hg/icedtea7-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea7-forest/jdk?cmd=changeset;node=b0194003cf27
author: ceisserer
date: Mon Apr 09 15:49:33 2012 -0700

	7150134, PR2571: JCK api/java_awt/Graphics/index.html#DrawLine fails with OOM for jdk8 with XRender pipeline
	Reviewed-by: prr


changeset 96b5c3822ce9 in /hg/icedtea7-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea7-forest/jdk?cmd=changeset;node=96b5c3822ce9
author: ceisserer
date: Tue Nov 13 16:12:10 2012 -0800

	7105461, PR2571: Large JTables are not rendered correctly with Xrender pipeline
	Reviewed-by: flar, prr


diffstat:

 src/share/native/sun/font/layout/LayoutEngine.cpp |   8 ++
 src/solaris/classes/sun/java2d/xr/XRRenderer.java |  75 +++++++++++++++-------
 src/solaris/classes/sun/java2d/xr/XRUtils.java    |   4 +-
 3 files changed, 61 insertions(+), 26 deletions(-)

diffs (148 lines):

diff -r 7dd31da3f90a -r 96b5c3822ce9 src/share/native/sun/font/layout/LayoutEngine.cpp
--- a/src/share/native/sun/font/layout/LayoutEngine.cpp	Thu May 22 16:18:01 2014 -0700
+++ b/src/share/native/sun/font/layout/LayoutEngine.cpp	Tue Nov 13 16:12:10 2012 -0800
@@ -672,12 +672,20 @@
             break;
         }
     } else {
+        if (LE_FAILURE(success)) {
+	    // Reset if gsubTable failed
+            success = LE_NO_ERROR;
+        }
         LEReferenceTo<MorphTableHeader2> morxTable(fontInstance, morxTableTag, success);
         if (LE_SUCCESS(success) &&
             morxTable.isValid() &&
             SWAPL(morxTable->version)==0x00020000) {
             result = new GXLayoutEngine2(fontInstance, scriptCode, languageCode, morxTable, typoFlags, success);
         } else {
+          if (LE_FAILURE(success)) {
+	    // Reset if morxTable failed
+            success = LE_NO_ERROR;
+          }
           LEReferenceTo<MorphTableHeader> mortTable(fontInstance, mortTableTag, success);
           if (LE_SUCCESS(success) && mortTable.isValid() && SWAPL(mortTable->version)==0x00010000) { // mort
             result = new GXLayoutEngine(fontInstance, scriptCode, languageCode, mortTable, success);
diff -r 7dd31da3f90a -r 96b5c3822ce9 src/solaris/classes/sun/java2d/xr/XRRenderer.java
--- a/src/solaris/classes/sun/java2d/xr/XRRenderer.java	Thu May 22 16:18:01 2014 -0700
+++ b/src/solaris/classes/sun/java2d/xr/XRRenderer.java	Tue Nov 13 16:12:10 2012 -0800
@@ -27,7 +27,6 @@
 
 import java.awt.*;
 import java.awt.geom.*;
-
 import sun.awt.SunToolkit;
 import sun.java2d.SunGraphics2D;
 import sun.java2d.loops.*;
@@ -39,6 +38,9 @@
 import sun.java2d.pipe.ShapeSpanIterator;
 import sun.java2d.pipe.LoopPipe;
 
+import static sun.java2d.xr.XRUtils.clampToShort;
+import static sun.java2d.xr.XRUtils.clampToUShort;
+
 /**
  * XRender provides only accalerated rectangles. To emulate higher "order"
  *  geometry we have to pass everything else to DoPath/FillSpans.
@@ -69,20 +71,25 @@
     }
 
     public void drawLine(SunGraphics2D sg2d, int x1, int y1, int x2, int y2) {
-        try {
+        Region compClip = sg2d.getCompClip();
+        int transX1 = Region.clipAdd(x1, sg2d.transX);
+        int transY1 = Region.clipAdd(y1, sg2d.transY);
+        int transX2 = Region.clipAdd(x2, sg2d.transX);
+        int transY2 = Region.clipAdd(y2, sg2d.transY);
+
+        // Non clipped fast path
+        if (compClip.contains(transX1, transY1)
+                && compClip.contains(transX2, transY2)) {
             SunToolkit.awtLock();
-
-            validateSurface(sg2d);
-            int transx = sg2d.transX;
-            int transy = sg2d.transY;
-
-            XRSurfaceData xrsd = (XRSurfaceData) sg2d.surfaceData;
-
-            tileManager.addLine(x1 + transx, y1 + transy,
-                                x2 + transx, y2 + transy);
-            tileManager.fillMask(xrsd);
-        } finally {
-            SunToolkit.awtUnlock();
+            try {
+                validateSurface(sg2d);
+                tileManager.addLine(transX1, transY1, transX2, transY2);
+                tileManager.fillMask((XRSurfaceData) sg2d.surfaceData);
+            } finally {
+                SunToolkit.awtUnlock();
+            }
+        } else {
+            draw(sg2d, new Line2D.Float(x1, y1, x2, y2));
         }
     }
 
@@ -109,20 +116,40 @@
         draw(sg2d, new Polygon(xpoints, ypoints, npoints));
     }
 
-    public synchronized void fillRect(SunGraphics2D sg2d,
-                                      int x, int y, int width, int height) {
+    public void fillRect(SunGraphics2D sg2d, int x, int y, int width, int height) {
+        x = Region.clipAdd(x, sg2d.transX);
+        y = Region.clipAdd(y, sg2d.transY);
+
+        /*
+         * Limit x/y to signed short, width/height to unsigned short,
+         * to match the X11 coordinate limits for rectangles.
+         * Correct width/height in case x/y have been modified by clipping.
+         */
+        if (x > Short.MAX_VALUE || y > Short.MAX_VALUE) {
+            return;
+        }
+
+        int x2 = Region.dimAdd(x, width);
+        int y2 = Region.dimAdd(y, height);
+
+        if (x2 < Short.MIN_VALUE || y2 < Short.MIN_VALUE) {
+            return;
+        }
+
+        x = clampToShort(x);
+        y = clampToShort(y);
+        width = clampToUShort(x2 - x);
+        height = clampToUShort(y2 - y);
+
+        if (width == 0 || height == 0) {
+            return;
+        }
+
         SunToolkit.awtLock();
         try {
             validateSurface(sg2d);
-
-            XRSurfaceData xrsd = (XRSurfaceData) sg2d.surfaceData;
-
-            x += sg2d.transform.getTranslateX();
-            y += sg2d.transform.getTranslateY();
-
             tileManager.addRect(x, y, width, height);
-            tileManager.fillMask(xrsd);
-
+            tileManager.fillMask((XRSurfaceData) sg2d.surfaceData);
         } finally {
             SunToolkit.awtUnlock();
         }
diff -r 7dd31da3f90a -r 96b5c3822ce9 src/solaris/classes/sun/java2d/xr/XRUtils.java
--- a/src/solaris/classes/sun/java2d/xr/XRUtils.java	Thu May 22 16:18:01 2014 -0700
+++ b/src/solaris/classes/sun/java2d/xr/XRUtils.java	Tue Nov 13 16:12:10 2012 -0800
@@ -255,7 +255,7 @@
                            : (x < Short.MIN_VALUE ? Short.MIN_VALUE : x));
     }
 
-    public static short clampToUShort(int x) {
-        return (short) (x > 65535 ? 65535 : (x < 0) ? 0 : x);
+    public static int clampToUShort(int x) {
+        return (x > 65535 ? 65535 : (x < 0) ? 0 : x);
     }
 }


More information about the distro-pkg-dev mailing list