aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/util/j2d
diff options
context:
space:
mode:
Diffstat (limited to 'src/classes/com/sun/opengl/util/j2d')
-rwxr-xr-xsrc/classes/com/sun/opengl/util/j2d/TextRenderer.java2
-rwxr-xr-xsrc/classes/com/sun/opengl/util/j2d/TextureRenderer.java8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/classes/com/sun/opengl/util/j2d/TextRenderer.java b/src/classes/com/sun/opengl/util/j2d/TextRenderer.java
index 75fc5ae70..e97c31173 100755
--- a/src/classes/com/sun/opengl/util/j2d/TextRenderer.java
+++ b/src/classes/com/sun/opengl/util/j2d/TextRenderer.java
@@ -310,6 +310,8 @@ public class TextRenderer {
g.setColor(Color.WHITE);
// Draw the string
g.drawString(curStr, strx, stry);
+ // Sync to the OpenGL texture
+ getBackingStore().sync(rect.x(), rect.y(), rect.w(), rect.h());
}
// OK, now draw the portion of the backing store to the screen
diff --git a/src/classes/com/sun/opengl/util/j2d/TextureRenderer.java b/src/classes/com/sun/opengl/util/j2d/TextureRenderer.java
index f758e4f6c..360a82b25 100755
--- a/src/classes/com/sun/opengl/util/j2d/TextureRenderer.java
+++ b/src/classes/com/sun/opengl/util/j2d/TextureRenderer.java
@@ -244,7 +244,12 @@ public class TextureRenderer {
boolean canSkipUpdate = ensureTexture();
if (!canSkipUpdate) {
- // Update specified region
+ // Update specified region.
+ // NOTE that because BufferedImage-based TextureDatas now don't
+ // do anything to their contents, the coordinate systems for
+ // OpenGL and Java 2D actually line up correctly for
+ // updateSubImage calls, so we don't need to do any argument
+ // conversion here (i.e., flipping the Y coordinate).
texture.updateSubImage(textureData, 0, x, y, x, y, width, height);
}
}
@@ -420,6 +425,7 @@ public class TextureRenderer {
texture.dispose();
texture = null;
}
+ mustReallocateTexture = false;
}
if (texture == null) {