/hg/icedtea6: added patches/openjdk/6896068-sg2d.patch

dlila at icedtea.classpath.org dlila at icedtea.classpath.org
Wed Feb 16 11:49:23 PST 2011


changeset 22fa1c53c1b8 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=22fa1c53c1b8
author: dlila
date: Wed Feb 16 12:27:53 2011 -0500

	added patches/openjdk/6896068-sg2d.patch


diffstat:

4 files changed, 218 insertions(+), 1 deletion(-)
ChangeLog                          |    6 +
Makefile.am                        |    3 
NEWS                               |    1 
patches/openjdk/6896068-sg2d.patch |  209 ++++++++++++++++++++++++++++++++++++

diffs (250 lines):

diff -r b58a717c532c -r 22fa1c53c1b8 ChangeLog
--- a/ChangeLog	Wed Feb 16 16:51:12 2011 +0000
+++ b/ChangeLog	Wed Feb 16 12:27:53 2011 -0500
@@ -1,3 +1,9 @@ 2011-02-16  Andrew John Hughes  <ahughes
+2011-02-16  Denis Lila <dlila at redhat.com>
+
+	* NEWS: Update with the backport
+	* Makefile.am (ICEDTEA_PATCHES): Added the patch
+	* patches/openjdk/6896068-sg2d.patch: Patch
+
 2011-02-16  Andrew John Hughes  <ahughes at redhat.com>
 
 	* NEWS: Include new releases:
diff -r b58a717c532c -r 22fa1c53c1b8 Makefile.am
--- a/Makefile.am	Wed Feb 16 16:51:12 2011 +0000
+++ b/Makefile.am	Wed Feb 16 12:27:53 2011 -0500
@@ -302,7 +302,8 @@ ICEDTEA_PATCHES = \
 	patches/openjdk/4645692-CubicCurve2D.solveCubic.patch \
 	patches/no-static-linking.patch \
 	patches/rh676659-gcc-export-dynamic.patch \
-	patches/g344659-sparc_fix.patch
+	patches/g344659-sparc_fix.patch \
+	patches/openjdk/6896068-sg2d.patch
 
 if !WITH_ALT_HSBUILD
 ICEDTEA_PATCHES += \
diff -r b58a717c532c -r 22fa1c53c1b8 NEWS
--- a/NEWS	Wed Feb 16 16:51:12 2011 +0000
+++ b/NEWS	Wed Feb 16 12:27:53 2011 -0500
@@ -417,6 +417,7 @@ New in release 1.10 (2011-XX-XX):
   - S6633275: Need to support shaped/translucent windows
   - S7015232: missing copyright header in CheckZOrderChange.java
   - S7017581: missing copyright header in test/sun/java2d/pipe/RegionOps.java
+  - S6896068: SunGraphics2D exposes a reference to itself while non fully initialised.
 * Bug fixes
   - RH661505: JPEGs with sRGB IEC61966-2.1 color profiles have wrong colors
   - PR616, PR99: Don't statically link libstdc++ or libgcc
diff -r b58a717c532c -r 22fa1c53c1b8 patches/openjdk/6896068-sg2d.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/6896068-sg2d.patch	Wed Feb 16 12:27:53 2011 -0500
@@ -0,0 +1,209 @@
+# HG changeset patch
+# User neugens
+# Date 1256926775 -3600
+# Node ID 634221297c37bc73c0f598e6ce212ef83ba74d14
+# Parent  1f2ef3a7d7c023c7ffcdf4e8fbb204ec66098f80
+6896068: SunGraphics2D exposes a reference to itself while non fully initialised.
+Summary: Introduce a new Interface to mark the Loops based pipes and initialise the loops accordingly.
+Reviewed-by: flar, rkennke
+
+diff -r 1f2ef3a7d7c0 -r 634221297c37 src/share/classes/sun/java2d/SunGraphics2D.java
+--- openjdk.orig/jdk/src/share/classes/sun/java2d/SunGraphics2D.java	Fri Oct 23 16:21:50 2009 +0400
++++ openjdk/jdk/src/share/classes/sun/java2d/SunGraphics2D.java	Fri Oct 30 19:19:35 2009 +0100
+@@ -257,7 +257,6 @@
+             font = defaultFont;
+         }
+ 
+-        loops = sd.getRenderLoops(this);
+         setDevClip(sd.getBounds());
+         invalidatePipe();
+     }
+@@ -367,6 +366,7 @@
+         shapepipe = invalidpipe;
+         textpipe = invalidpipe;
+         imagepipe = invalidpipe;
++        loops = null;
+     }
+ 
+     public void validatePipe() {
+diff -r 1f2ef3a7d7c0 -r 634221297c37 src/share/classes/sun/java2d/SurfaceData.java
+--- openjdk.orig/jdk/src/share/classes/sun/java2d/SurfaceData.java	Fri Oct 23 16:21:50 2009 +0400
++++ openjdk/jdk/src/share/classes/sun/java2d/SurfaceData.java	Fri Oct 30 19:19:35 2009 +0100
+@@ -69,6 +69,7 @@
+ import sun.java2d.pipe.DrawImage;
+ import sun.awt.SunHints;
+ import sun.awt.image.SurfaceManager;
++import sun.java2d.pipe.LoopBasedPipe;
+ 
+ /**
+  * This class provides various pieces of information relevant to a
+@@ -506,7 +507,6 @@
+                     sg2d.textpipe = solidTextRenderer;
+                 }
+                 sg2d.shapepipe = colorPrimitives;
+-                sg2d.loops = getRenderLoops(sg2d);
+                 // assert(sg2d.surfaceData == this);
+             }
+         } else if (sg2d.compositeState == sg2d.COMP_CUSTOM) {
+@@ -603,8 +603,17 @@
+ 
+             sg2d.textpipe = getTextPipe(sg2d, false /* AA==OFF */);
+             sg2d.shapepipe = colorPrimitives;
++            // assert(sg2d.surfaceData == this);
++        }
++
++        // check for loops
++        if (sg2d.textpipe  instanceof LoopBasedPipe ||
++            sg2d.shapepipe instanceof LoopBasedPipe ||
++            sg2d.fillpipe  instanceof LoopBasedPipe ||
++            sg2d.drawpipe  instanceof LoopBasedPipe ||
++            sg2d.imagepipe instanceof LoopBasedPipe)
++        {
+             sg2d.loops = getRenderLoops(sg2d);
+-            // assert(sg2d.surfaceData == this);
+         }
+     }
+ 
+diff -r 1f2ef3a7d7c0 -r 634221297c37 src/share/classes/sun/java2d/pipe/AATextRenderer.java
+--- openjdk.orig/jdk/src/share/classes/sun/java2d/pipe/AATextRenderer.java	Fri Oct 23 16:21:50 2009 +0400
++++ openjdk/jdk/src/share/classes/sun/java2d/pipe/AATextRenderer.java	Fri Oct 30 19:19:35 2009 +0100
+@@ -34,8 +34,9 @@
+  * a solid source colour to an opaque destination.
+  */
+ 
+-public class AATextRenderer extends GlyphListLoopPipe {
+-
++public class AATextRenderer extends GlyphListLoopPipe
++    implements LoopBasedPipe
++{
+    protected void drawGlyphList(SunGraphics2D sg2d, GlyphList gl) {
+        sg2d.loops.drawGlyphListAALoop.DrawGlyphListAA(sg2d, sg2d.surfaceData,
+                                                       gl);
+diff -r 1f2ef3a7d7c0 -r 634221297c37 src/share/classes/sun/java2d/pipe/GlyphListLoopPipe.java
+--- openjdk.orig/jdk/src/share/classes/sun/java2d/pipe/GlyphListLoopPipe.java	Fri Oct 23 16:21:50 2009 +0400
++++ openjdk/jdk/src/share/classes/sun/java2d/pipe/GlyphListLoopPipe.java	Fri Oct 30 19:19:35 2009 +0100
+@@ -36,8 +36,9 @@
+  * the installed loop may not match the glyphvector.
+  */
+ 
+-public abstract class GlyphListLoopPipe extends GlyphListPipe {
+-
++public abstract class GlyphListLoopPipe extends GlyphListPipe
++    implements LoopBasedPipe
++{
+     protected void drawGlyphList(SunGraphics2D sg2d, GlyphList gl,
+                                  int aaHint) {
+         switch (aaHint) {
+diff -r 1f2ef3a7d7c0 -r 634221297c37 src/share/classes/sun/java2d/pipe/LoopBasedPipe.java
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
++++ openjdk/jdk/src/share/classes/sun/java2d/pipe/LoopBasedPipe.java	Fri Oct 30 19:19:35 2009 +0100
+@@ -0,0 +1,37 @@
++/*
++ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ *
++ * This code is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 only, as
++ * published by the Free Software Foundation.  Sun designates this
++ * particular file as subject to the "Classpath" exception as provided
++ * by Sun in the LICENSE file that accompanied this code.
++ *
++ * This code is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
++ * version 2 for more details (a copy is included in the LICENSE file that
++ * accompanied this code).
++ *
++ * You should have received a copy of the GNU General Public License version
++ * 2 along with this work; if not, write to the Free Software Foundation,
++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
++ * CA 95054 USA or visit www.sun.com if you need additional information or
++ * have any questions.
++ */
++
++package sun.java2d.pipe;
++
++/**
++ * This is a marker interface used by Pipes that need RenderLoops.
++ * RenderLoops are validated in SurfaceData when a pipe is recognised to
++ * implement this interface.
++ *
++ * @author Mario Torre <neugens at aicas.com>
++ */
++public interface LoopBasedPipe {
++
++}
+diff -r 1f2ef3a7d7c0 -r 634221297c37 src/share/classes/sun/java2d/pipe/LoopPipe.java
+--- openjdk.orig/jdk/src/share/classes/sun/java2d/pipe/LoopPipe.java	Fri Oct 23 16:21:50 2009 +0400
++++ openjdk/jdk/src/share/classes/sun/java2d/pipe/LoopPipe.java	Fri Oct 30 19:19:35 2009 +0100
+@@ -46,7 +46,8 @@
+ public class LoopPipe
+     implements PixelDrawPipe,
+                PixelFillPipe,
+-               ShapeDrawPipe
++               ShapeDrawPipe,
++               LoopBasedPipe
+ {
+     final static RenderingEngine RenderEngine = RenderingEngine.getInstance();
+ 
+diff -r 1f2ef3a7d7c0 -r 634221297c37 src/share/classes/sun/java2d/pipe/SolidTextRenderer.java
+--- openjdk.orig/jdk/src/share/classes/sun/java2d/pipe/SolidTextRenderer.java	Fri Oct 23 16:21:50 2009 +0400
++++ openjdk/jdk/src/share/classes/sun/java2d/pipe/SolidTextRenderer.java	Fri Oct 30 19:19:35 2009 +0100
+@@ -35,8 +35,9 @@
+  * a solid source colour to an opaque destination.
+  */
+ 
+-public class SolidTextRenderer extends GlyphListLoopPipe {
+-
++public class SolidTextRenderer extends GlyphListLoopPipe
++    implements LoopBasedPipe
++{
+     protected void drawGlyphList(SunGraphics2D sg2d, GlyphList gl) {
+         sg2d.loops.drawGlyphListLoop.DrawGlyphList(sg2d, sg2d.surfaceData, gl);
+     }
+diff -r 1f2ef3a7d7c0 -r 634221297c37 src/share/classes/sun/java2d/pipe/SpanShapeRenderer.java
+--- openjdk.orig/jdk/src/share/classes/sun/java2d/pipe/SpanShapeRenderer.java	Fri Oct 23 16:21:50 2009 +0400
++++ openjdk/jdk/src/share/classes/sun/java2d/pipe/SpanShapeRenderer.java	Fri Oct 30 19:19:35 2009 +0100
+@@ -65,7 +65,9 @@
+         }
+     }
+ 
+-    public static class Simple extends SpanShapeRenderer {
++    public static class Simple extends SpanShapeRenderer
++        implements  LoopBasedPipe
++    {
+         public Object startSequence(SunGraphics2D sg, Shape s,
+                                     Rectangle devR, int[] bbox) {
+             return sg;
+diff -r 1f2ef3a7d7c0 -r 634221297c37 src/solaris/classes/sun/java2d/x11/X11SurfaceData.java
+--- openjdk.orig/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java	Fri Oct 23 16:21:50 2009 +0400
++++ openjdk/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java	Fri Oct 30 19:19:35 2009 +0100
+@@ -388,7 +388,10 @@
+             // if a GlyphVector overrides the AA setting.
+             // We use getRenderLoops() rather than setting solidloops
+             // directly so that we get the appropriate loops in XOR mode.
+-            sg2d.loops = getRenderLoops(sg2d);
++            if (sg2d.loops == null) {
++                // assert(some pipe will always be a LoopBasedPipe)
++                sg2d.loops = getRenderLoops(sg2d);
++            }
+         } else {
+             super.validatePipe(sg2d);
+         }
+diff -r 1f2ef3a7d7c0 -r 634221297c37 src/windows/classes/sun/java2d/windows/GDIWindowSurfaceData.java
+--- openjdk.orig/jdk/src/windows/classes/sun/java2d/windows/GDIWindowSurfaceData.java	Fri Oct 23 16:21:50 2009 +0400
++++ openjdk/jdk/src/windows/classes/sun/java2d/windows/GDIWindowSurfaceData.java	Fri Oct 30 19:19:35 2009 +0100
+@@ -210,7 +210,10 @@
+             // if a GlyphVector overrides the AA setting.
+             // We use getRenderLoops() rather than setting solidloops
+             // directly so that we get the appropriate loops in XOR mode.
+-            sg2d.loops = getRenderLoops(sg2d);
++            if (sg2d.loops == null) {
++                // assert(some pipe will always be a LoopBasedPipe)
++                sg2d.loops = getRenderLoops(sg2d);
++            }
+         } else {
+             super.validatePipe(sg2d);
+         }



More information about the distro-pkg-dev mailing list