diff options
author | Kenneth Russel <[email protected]> | 2007-03-27 05:38:50 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2007-03-27 05:38:50 +0000 |
commit | 2328bf37e95371c74a8d102dfd462cdf6e1df10d (patch) | |
tree | 4636f6013298f05230e7c032e86c74a0818820cd /src/classes/com/sun/opengl/util/j2d/TextRenderer.java | |
parent | 03be3bd1c7c33667518e618350ac75f545d2b84b (diff) |
Added a markDirty() method to TextureRenderer and removed the sync()
method. markDirty() may be called at an arbitrary point (in
particular, when no OpenGL context is current) and the union of the
dirty regions is automatically synced with the underlying texture
during the next getTexture() operation, at which point the dirty
region is cleared. Adjusted Overlay and TextRenderer classes.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@1182 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl/util/j2d/TextRenderer.java')
-rwxr-xr-x | src/classes/com/sun/opengl/util/j2d/TextRenderer.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/classes/com/sun/opengl/util/j2d/TextRenderer.java b/src/classes/com/sun/opengl/util/j2d/TextRenderer.java index e07935690..d25888be2 100755 --- a/src/classes/com/sun/opengl/util/j2d/TextRenderer.java +++ b/src/classes/com/sun/opengl/util/j2d/TextRenderer.java @@ -488,8 +488,8 @@ public class TextRenderer { g.setComposite(AlphaComposite.Src); // Draw the string renderDelegate.draw(g, curStr, strx, stry); - // Sync to the OpenGL texture - getBackingStore().sync(rect.x(), rect.y(), rect.w(), rect.h()); + // Mark this region of the TextureRenderer as dirty + getBackingStore().markDirty(rect.x(), rect.y(), rect.w(), rect.h()); } // OK, now draw the portion of the backing store to the screen @@ -728,7 +728,7 @@ public class TextRenderer { } if (DEBUG) { - getBackingStore().sync(0, 0, getBackingStore().getWidth(), getBackingStore().getHeight()); + getBackingStore().markDirty(0, 0, getBackingStore().getWidth(), getBackingStore().getHeight()); } } @@ -835,7 +835,7 @@ public class TextRenderer { g.dispose(); // Sync the whole surface TextureRenderer newRenderer = (TextureRenderer) newBackingStore; - newRenderer.sync(0, 0, newRenderer.getWidth(), newRenderer.getHeight()); + newRenderer.markDirty(0, 0, newRenderer.getWidth(), newRenderer.getHeight()); // Re-enter the begin / end pair if necessary if (inBeginEndPair) { if (isOrthoMode) { |