From e01fc6a8d55576dc4b0f856a4d77da7eed51652b Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Thu, 17 May 2007 05:34:26 +0000 Subject: Fixed problem in TextRenderer where custom render delegates would result in corrupted backing store due to semantics of Graphics.copyArea() paying attention to transparent pixels; need to clear out the destination rectangle first git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@1248 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/com/sun/opengl/util/j2d/TextRenderer.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/classes/com/sun/opengl/util/j2d') diff --git a/src/classes/com/sun/opengl/util/j2d/TextRenderer.java b/src/classes/com/sun/opengl/util/j2d/TextRenderer.java index 2bbd2ee60..7d0a8ea2d 100755 --- a/src/classes/com/sun/opengl/util/j2d/TextRenderer.java +++ b/src/classes/com/sun/opengl/util/j2d/TextRenderer.java @@ -882,6 +882,14 @@ public class TextRenderer { TextureRenderer oldRenderer = (TextureRenderer) oldBackingStore; TextureRenderer newRenderer = (TextureRenderer) newBackingStore; + if (!renderDelegate.intensityOnly()) { + // Transparent pixels in the source image will not overwrite + // the contents of the backing store + g.setComposite(AlphaComposite.Clear); + g.fillRect(newLocation.x(), newLocation.y(), newLocation.w(), newLocation.h()); + g.setComposite(AlphaComposite.Src); + } + if (oldRenderer == newRenderer) { // Movement on the same backing store -- easy case g.copyArea(oldLocation.x(), oldLocation.y(), -- cgit v1.2.3