diff options
| author | Sven de Marothy <sven@physto.se> | 2006-06-06 02:22:27 +0000 |
|---|---|---|
| committer | Sven de Marothy <sven@physto.se> | 2006-06-06 02:22:27 +0000 |
| commit | 30244554380220f71036afa3d69a79aebcd80c6d (patch) | |
| tree | 0d3815e263477a924b94fb13bd3fb794412bff85 /gnu/java/awt/peer/gtk/GtkVolatileImage.java | |
| parent | 3a6022395076032f58d1584fc2a70e8801afa129 (diff) | |
| download | classpath-30244554380220f71036afa3d69a79aebcd80c6d.tar.gz | |
2006-06-05 Sven de Marothy <sven@physto.se>
* include/gnu_java_awt_peer_gtk_ComponentGraphics.h
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c
* gnu/java/awt/peer/gtk/ComponentGraphics.java
(initFromVolatile): New method.
* gnu/java/awt/peer/gtk/GtkVolatileImage.java
* gnu/java/awt/peer/gtk/VolatileImageGraphics.java
Reimplement.
* include/gnu_java_awt_peer_gtk_GtkVolatileImage.h
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkVolatileImage.c
(copyArea, drawVolatileImage): New methods.
Diffstat (limited to 'gnu/java/awt/peer/gtk/GtkVolatileImage.java')
| -rw-r--r-- | gnu/java/awt/peer/gtk/GtkVolatileImage.java | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/gnu/java/awt/peer/gtk/GtkVolatileImage.java b/gnu/java/awt/peer/gtk/GtkVolatileImage.java index cebb715ab..53bcd739d 100644 --- a/gnu/java/awt/peer/gtk/GtkVolatileImage.java +++ b/gnu/java/awt/peer/gtk/GtkVolatileImage.java @@ -53,23 +53,18 @@ public class GtkVolatileImage extends VolatileImage /** * Don't touch, accessed from native code. */ - private long nativePointer; - - /** - * Offscreen image we draw to. - */ - CairoSurface offScreen; - - private boolean needsUpdate = false; + long nativePointer; native long init(GtkComponentPeer component, int width, int height); native void destroy(); native int[] getPixels(); - - native void update(GtkImage image); + native void copyArea( int x, int y, int w, int h, int dx, int dy ); + + native void drawVolatile( long ptr, int x, int y, int w, int h ); + public GtkVolatileImage(GtkComponentPeer component, int width, int height, ImageCapabilities caps) { @@ -77,7 +72,6 @@ public class GtkVolatileImage extends VolatileImage this.height = height; this.caps = caps; nativePointer = init( component, width, height ); - offScreen = new CairoSurface( width, height ); } public GtkVolatileImage(int width, int height, ImageCapabilities caps) @@ -100,11 +94,6 @@ public class GtkVolatileImage extends VolatileImage destroy(); } - void invalidate() - { - needsUpdate = true; - } - public BufferedImage getSnapshot() { CairoSurface cs = new CairoSurface( width, height ); @@ -119,24 +108,17 @@ public class GtkVolatileImage extends VolatileImage public Graphics2D createGraphics() { - invalidate(); - return offScreen.getGraphics(); + return new VolatileImageGraphics( this ); } public int validate(GraphicsConfiguration gc) { - if( needsUpdate ) - { - update( offScreen.getGtkImage() ); - needsUpdate = false; - return VolatileImage.IMAGE_RESTORED; - } return VolatileImage.IMAGE_OK; } public boolean contentsLost() { - return needsUpdate; + return false; } public ImageCapabilities getCapabilities() |
