/hg/icedtea6: Speed up AA rendering to screen.

dlila at icedtea.classpath.org dlila at icedtea.classpath.org
Thu Apr 28 05:32:15 PDT 2011


changeset ad45dd8bcf45 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=ad45dd8bcf45
author: Denis Lila <dlila at redhat.com>
date: Thu Apr 28 08:36:21 2011 -0400

	Speed up AA rendering to screen.


diffstat:

 ChangeLog                                    |   10 ++
 Makefile.am                                  |    2 +
 NEWS                                         |    2 +
 patches/openjdk/6307603-xrender-01.patch     |    6 +-
 patches/openjdk/6708580-exa_slow.patch       |   99 ++++++++++++++++++++++++
 patches/openjdk/6748082-isDisplayLocal.patch |  111 +++++++++++++++++++++++++++
 6 files changed, 228 insertions(+), 2 deletions(-)

diffs (310 lines):

diff -r bc0a045bf271 -r ad45dd8bcf45 ChangeLog
--- a/ChangeLog	Fri Apr 22 17:35:11 2011 -0400
+++ b/ChangeLog	Thu Apr 28 08:36:21 2011 -0400
@@ -1,3 +1,13 @@
+2011-04-28  Denis Lila <dlila at redhat.com>
+
+	* Makefile.am: Apply patches.
+	* NEWS: Update with backports.
+	* patches/openjdk/6748082-isDisplayLocal.patch: New patch.
+	* patches/openjdk/6708580-exa_slow.patch: New patch. Speeds
+	up certain rendering operations.
+	* patches/openjdk/6307603-xrender-01.patch: Make it apply when
+	the previous patch has been applied before it.
+
 2011-04-22  Omair Majid  <omajid at redhat.com>
 
 	Revert previous patch.
diff -r bc0a045bf271 -r ad45dd8bcf45 Makefile.am
--- a/Makefile.am	Fri Apr 22 17:35:11 2011 -0400
+++ b/Makefile.am	Thu Apr 28 08:36:21 2011 -0400
@@ -204,6 +204,7 @@
 	patches/openjdk/6682046-shape_calculation.patch \
 	patches/openjdk/6797195-hw_lw_mixing.patch \
 	patches/openjdk/6725214-direct3d-01.patch \
+	patches/openjdk/6748082-isDisplayLocal.patch \
 	patches/openjdk/6633275-shaped_translucent_windows.patch \
         patches/openjdk/6791612-opengl-jni-fix.patch \
         patches/openjdk/6755274-glgetstring-crash.patch \
@@ -310,6 +311,7 @@
 	patches/g344659-sparc_fix.patch \
 	patches/openjdk/6728834-blurred-lcd-aa-text.patch \
 	patches/openjdk/6749060-bad-lcd-aa-non-opaque-dest.patch \
+	patches/openjdk/6708580-exa_slow.patch \
 	patches/openjdk/6896068-sg2d.patch \
 	patches/pr633-no_javaws_man_page.patch \
 	patches/pr586-include_all_srcs.patch \
diff -r bc0a045bf271 -r ad45dd8bcf45 NEWS
--- a/NEWS	Fri Apr 22 17:35:11 2011 -0400
+++ b/NEWS	Thu Apr 28 08:36:21 2011 -0400
@@ -18,6 +18,8 @@
   - S6768387, PR670: REGRESSION: JTable no longer serializable
   - Add missing privileged block around access to the sun.awt.nativedebug property.
   - S7032388, PR682: Make HotSpot work on machines without cmov instruction again
+  - S6748082: remove platform-specific code from SwingUtilities2.isDisplayLocal
+  - S6708580: Java applications slow when EXA enabled
 * Bug fixes
   - PR637: make check should exit with an error code if any regression test failed.
   - G356743: Support libpng 1.5.
diff -r bc0a045bf271 -r ad45dd8bcf45 patches/openjdk/6307603-xrender-01.patch
--- a/patches/openjdk/6307603-xrender-01.patch	Fri Apr 22 17:35:11 2011 -0400
+++ b/patches/openjdk/6307603-xrender-01.patch	Thu Apr 28 08:36:21 2011 -0400
@@ -9,12 +9,13 @@
                  #Java_sun_awt_motif_MEmbedCanvasPeer_initXEmbedServer;
                  #Java_sun_awt_motif_MEmbedCanvasPeer_destroyXEmbedServer;
                  #Java_sun_awt_motif_MEmbedCanvasPeer_isXEmbedActive;
-@@ -406,17 +407,52 @@
+@@ -406,18 +407,53 @@
  		Java_sun_java2d_x11_X11SurfaceData_initIDs;
  		Java_sun_java2d_x11_X11SurfaceData_initOps;
  		Java_sun_java2d_x11_X11SurfaceData_initSurface;
 -		Java_sun_java2d_x11_X11SurfaceData_isDrawableValid;
  		Java_sun_java2d_x11_X11SurfaceData_isDgaAvailable;
+ 		Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable;
 -		Java_sun_java2d_x11_X11SurfaceData_setInvalid;
 -		Java_sun_java2d_x11_X11SurfaceData_flushNativeSurface;
 -                Java_sun_java2d_x11_X11SurfaceData_XCreateGC;
@@ -178,7 +179,7 @@
          Java_sun_awt_X11GraphicsEnvironment_checkShmExt;
          Java_sun_awt_X11GraphicsEnvironment_getNumScreens;
          Java_sun_awt_X11GraphicsEnvironment_getDefaultScreenNum;
-@@ -337,20 +338,51 @@
+@@ -337,21 +338,52 @@
  	Java_sun_java2d_x11_X11Renderer_XFillRect;
  	Java_sun_java2d_x11_X11Renderer_XFillRoundRect;
          Java_sun_java2d_x11_X11Renderer_devCopyArea;
@@ -186,6 +187,7 @@
          Java_sun_java2d_x11_X11SurfaceData_initIDs;
 -	Java_sun_java2d_x11_X11SurfaceData_isDrawableValid;
          Java_sun_java2d_x11_X11SurfaceData_isDgaAvailable;
+ 	Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable;
 -        Java_sun_java2d_x11_X11SurfaceData_initOps;
          Java_sun_java2d_x11_X11SurfaceData_initSurface;
 -        Java_sun_java2d_x11_X11SurfaceData_flushNativeSurface;
diff -r bc0a045bf271 -r ad45dd8bcf45 patches/openjdk/6708580-exa_slow.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/6708580-exa_slow.patch	Thu Apr 28 08:36:21 2011 -0400
@@ -0,0 +1,103 @@
+# HG changeset patch
+# User tdv
+# Date 1228418486 28800
+# Node ID 15435c60c751bc39af2fc6b3a30744c6713db1de
+# Parent  c8eea39734e85b50977434a5b37b3eb8ac8c0a59
+6708580: Java applications slow when EXA enabled
+Reviewed-by: prr, tdv
+Contributed-by: ceisserer <linuxhippy at gmail.com>
+
+diff -r c8eea39734e8 -r 15435c60c751 make/sun/awt/mapfile-mawt-vers
+--- openjdk.orig/jdk/make/sun/awt/mapfile-mawt-vers	Thu Dec 04 10:05:36 2008 -0800
++++ openjdk/jdk/make/sun/awt/mapfile-mawt-vers	Thu Dec 04 11:21:26 2008 -0800
+@@ -407,6 +407,7 @@
+ 		Java_sun_java2d_x11_X11SurfaceData_initSurface;
+ 		Java_sun_java2d_x11_X11SurfaceData_isDrawableValid;
+ 		Java_sun_java2d_x11_X11SurfaceData_isDgaAvailable;
++		Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable;
+ 		Java_sun_java2d_x11_X11SurfaceData_setInvalid;
+ 		Java_sun_java2d_x11_X11SurfaceData_flushNativeSurface;
+                 Java_sun_java2d_x11_X11SurfaceData_XCreateGC;
+diff -r c8eea39734e8 -r 15435c60c751 make/sun/xawt/mapfile-vers
+--- openjdk.orig/jdk/make/sun/xawt/mapfile-vers	Thu Dec 04 10:05:36 2008 -0800
++++ openjdk/jdk/make/sun/xawt/mapfile-vers	Thu Dec 04 11:21:26 2008 -0800
+@@ -337,6 +337,7 @@
+         Java_sun_java2d_x11_X11SurfaceData_initIDs;
+ 	Java_sun_java2d_x11_X11SurfaceData_isDrawableValid;
+         Java_sun_java2d_x11_X11SurfaceData_isDgaAvailable;
++	Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable;
+         Java_sun_java2d_x11_X11SurfaceData_initOps;
+         Java_sun_java2d_x11_X11SurfaceData_initSurface;
+         Java_sun_java2d_x11_X11SurfaceData_flushNativeSurface;
+diff -r c8eea39734e8 -r 15435c60c751 src/solaris/classes/sun/java2d/x11/X11SurfaceData.java
+--- openjdk.orig/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java	Thu Dec 04 10:05:36 2008 -0800
++++ openjdk/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java	Thu Dec 04 11:21:26 2008 -0800
+@@ -50,6 +50,7 @@
+ import sun.font.X11TextRenderer;
+ import sun.java2d.InvalidPipeException;
+ import sun.java2d.SunGraphics2D;
++import sun.java2d.SunGraphicsEnvironment;
+ import sun.java2d.SurfaceData;
+ import sun.java2d.SurfaceDataProxy;
+ import sun.java2d.loops.SurfaceType;
+@@ -240,6 +241,11 @@
+      */
+     public static native boolean isDgaAvailable();
+ 
++    /**
++     * Returns true if shared memory pixmaps are available
++     */
++    private static native boolean isShmPMAvailable();
++
+     public static boolean isAccelerationEnabled() {
+         if (accelerationEnabled == null) {
+ 
+@@ -253,8 +259,17 @@
+                     // true iff prop==true, false otherwise
+                     accelerationEnabled = Boolean.valueOf(prop);
+                 } else {
+-                    // use pixmaps if there is no dga, no matter local or remote
+-                    accelerationEnabled = Boolean.valueOf(!isDgaAvailable());
++                    boolean isDisplayLocal = false;
++                    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
++                    if (ge instanceof SunGraphicsEnvironment) {
++                        isDisplayLocal = ((SunGraphicsEnvironment) ge).isDisplayLocal();
++                     }
++
++                    // EXA based drivers tend to place pixmaps in VRAM, slowing down readbacks.
++                    // Don't use pixmaps if dga is available,
++                    // or we are local and shared memory Pixmaps are not available.
++                    accelerationEnabled =
++                        !(isDgaAvailable() || (isDisplayLocal && !isShmPMAvailable()));
+                 }
+             }
+         }
+diff -r c8eea39734e8 -r 15435c60c751 src/solaris/native/sun/java2d/x11/X11SurfaceData.c
+--- openjdk.orig/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Thu Dec 04 10:05:36 2008 -0800
++++ openjdk/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Thu Dec 04 11:21:26 2008 -0800
+@@ -208,6 +208,23 @@
+ #endif /* HEADLESS */
+ }
+ 
++
++/*
++ * Class:     sun_java2d_x11_X11SurfaceData
++ * Method:    isShmPMAvailable
++ * Signature: ()Z
++ */
++JNIEXPORT jboolean JNICALL
++Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable(JNIEnv *env, jobject this)
++{
++#if defined(HEADLESS) || !defined(MITSHM)
++    return JNI_FALSE;
++#else
++    return useMitShmPixmaps;
++#endif /* HEADLESS, MITSHM */
++}
++
++
+ /*
+  * Class:     sun_java2d_x11_X11SurfaceData
+  * Method:    initOps
+exporting patch:
+<fdopen>
diff -r bc0a045bf271 -r ad45dd8bcf45 patches/openjdk/6748082-isDisplayLocal.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/6748082-isDisplayLocal.patch	Thu Apr 28 08:36:21 2011 -0400
@@ -0,0 +1,116 @@
+# HG changeset patch
+# User tdv
+# Date 1221256905 25200
+# Node ID b8f91ea2fb33cdbbc177ab1f68170ce7966b5d7b
+# Parent  cd88b4ad7f258f023f12ebcc3b5a01a826e9392d
+6748082: remove platform-specific code from SwingUtilities2.isDisplayLocal
+Reviewed-by: prr, tdv
+Contributed-by: rkennke at kennke.org
+
+diff -r cd88b4ad7f25 -r b8f91ea2fb33 src/share/classes/sun/java2d/SunGraphicsEnvironment.java
+--- openjdk.orig/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java	Thu Aug 28 11:27:14 2008 -0700
++++ openjdk/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java	Fri Sep 12 15:01:45 2008 -0700
+@@ -1272,6 +1272,13 @@
+         displayChanger.notifyPaletteChanged();
+     }
+ 
++    /**
++     * Returns true when the display is local, false for remote displays.
++     *
++     * @return true when the display is local, false for remote displays
++     */
++    public abstract boolean isDisplayLocal();
++
+     /*
+      * ----DISPLAY CHANGE SUPPORT----
+      */
+diff -r cd88b4ad7f25 -r b8f91ea2fb33 src/share/classes/sun/swing/SwingUtilities2.java
+--- openjdk.orig/jdk/src/share/classes/sun/swing/SwingUtilities2.java	Thu Aug 28 11:27:14 2008 -0700
++++ openjdk/jdk/src/share/classes/sun/swing/SwingUtilities2.java	Fri Sep 12 15:01:45 2008 -0700
+@@ -55,6 +55,7 @@
+ import java.util.*;
+ import sun.font.FontDesignMetrics;
+ import sun.font.FontManager;
++import sun.java2d.SunGraphicsEnvironment;
+ 
+ import java.util.concurrent.Callable;
+ import java.util.concurrent.Future;
+@@ -1482,22 +1483,14 @@
+      * appear capable of performing gamma correction needed for LCD text.
+      */
+     public static boolean isLocalDisplay() {
+-        try {
+-            // On Windows just return true. Permission to read os.name
+-            // is granted to all code but wrapped in try to be safe.
+-            if (OSInfo.getOSType() == OSInfo.OSType.WINDOWS) {
+-                return true;
+-            }
+-            // Else probably Solaris or Linux in which case may be remote X11
+-            Class x11Class = Class.forName("sun.awt.X11GraphicsEnvironment");
+-            Method isDisplayLocalMethod = x11Class.getMethod(
+-                      "isDisplayLocal", new Class[0]);
+-            return (Boolean)isDisplayLocalMethod.invoke(null, (Object[])null);
+-        } catch (Throwable t) {
++        boolean isLocal;
++        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
++        if (ge instanceof SunGraphicsEnvironment) {
++            isLocal = ((SunGraphicsEnvironment) ge).isDisplayLocal();
++        } else {
++            isLocal = true;
+         }
+-        // If we get here we're most likely being run on some other O/S
+-        // or we didn't properly detect Windows.
+-        return true;
++        return isLocal;
+     }
+ 
+     /**
+diff -r cd88b4ad7f25 -r b8f91ea2fb33 src/solaris/classes/sun/awt/X11GraphicsEnvironment.java
+--- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java	Thu Aug 28 11:27:14 2008 -0700
++++ openjdk/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java	Fri Sep 12 15:01:45 2008 -0700
+@@ -209,7 +209,7 @@
+     private static native int checkShmExt();
+ 
+     private static  native String getDisplayString();
+-    private static Boolean isDisplayLocal;
++    private Boolean isDisplayLocal;
+ 
+     /**
+      * This should only be called from the static initializer, so no need for
+@@ -234,7 +234,8 @@
+         return getScreenDevices()[getDefaultScreenNum()];
+     }
+ 
+-    public static boolean isDisplayLocal() {
++    @Override
++    public boolean isDisplayLocal() {
+         if (isDisplayLocal == null) {
+             SunToolkit.awtLock();
+             try {
+diff -r cd88b4ad7f25 -r b8f91ea2fb33 src/solaris/native/sun/awt/fontpath.c
+--- openjdk.orig/jdk/src/solaris/native/sun/awt/fontpath.c	Thu Aug 28 11:27:14 2008 -0700
++++ openjdk/jdk/src/solaris/native/sun/awt/fontpath.c	Fri Sep 12 15:01:45 2008 -0700
+@@ -156,7 +156,7 @@
+ 
+     isLocal = JNU_CallStaticMethodByName(env, NULL,
+                                          "sun/awt/X11GraphicsEnvironment",
+-                                         "isDisplayLocal",
++                                         "_isDisplayLocal",
+                                          "()Z").z;
+     isLocalSet = True;
+     return isLocal;
+diff -r cd88b4ad7f25 -r b8f91ea2fb33 src/windows/classes/sun/awt/Win32GraphicsEnvironment.java
+--- openjdk.orig/jdk/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java	Thu Aug 28 11:27:14 2008 -0700
++++ openjdk/jdk/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java	Fri Sep 12 15:01:45 2008 -0700
+@@ -393,4 +393,9 @@
+     private static void dwmCompositionChanged(boolean enabled) {
+         isDWMCompositionEnabled = enabled;
+     }
++
++    @Override
++    public boolean isDisplayLocal() {
++        return true;
++    }
+ }
+exporting patch:
+<fdopen>



More information about the distro-pkg-dev mailing list