diff options
author | fitzsim <fitzsim@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-17 20:15:53 +0000 |
---|---|---|
committer | fitzsim <fitzsim@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-17 20:15:53 +0000 |
commit | 9b85a05d82abe0a25b5811eb1191ba554c31c6d2 (patch) | |
tree | 2a9bf0482db315956df7cf772dc3988469964047 /libjava/classpath/native | |
parent | c3384caec46177c3b95ec8ea9c93dbd77d643851 (diff) | |
download | gcc-9b85a05d82abe0a25b5811eb1191ba554c31c6d2.tar.gz |
2007-04-17 Francis Kung <fkung@redhat.com>
PR classpath/31311
* gnu/java/awt/peer/gtk/ComponentGraphics.java
(dispose): Removed method.
(disposeSurface): Removed method.
* gnu_java_awt_peer_gtk_ComponentGraphics.h: Regenerated.
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c
(Java_gnu_java_awt_peer_gtk_ComponentGraphics_disposeSurface): Removed.
(Java_gnu_java_awt_peer_gtk_ComponentGraphics_initState): Destroy surface
after it is used to create a cairo context.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123928 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/native')
-rw-r--r-- | libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c index 25163cd9f3e..ed9cf3d6ddc 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_ComponentGraphics.c @@ -1,5 +1,5 @@ /* gnu_java_awt_peer_gtk_ComponentGraphics.c - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -159,40 +159,13 @@ Java_gnu_java_awt_peer_gtk_ComponentGraphics_initState cr = cairo_create (surface); g_assert(cr != NULL); + cairo_surface_destroy(surface); gdk_threads_leave(); return PTR_TO_JLONG(cr); } -/** - * Disposes of the surface - */ -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_ComponentGraphics_disposeSurface - (JNIEnv *env __attribute__((unused)), jobject obj __attribute__((unused)), - jlong value) -{ - struct cairographics2d *gr; - cairo_surface_t *surface; - - gr = JLONG_TO_PTR(struct cairographics2d, value); - - if (gr == NULL) - return; - - if (gr->cr == NULL) - return; - - surface = cairo_get_target (gr->cr); - if (surface != NULL) - { - gdk_threads_enter(); - cairo_surface_destroy (surface); - gdk_threads_leave(); - } -} - JNIEXPORT jlong JNICALL Java_gnu_java_awt_peer_gtk_ComponentGraphics_initFromVolatile (JNIEnv *env __attribute__ ((unused)), jobject obj __attribute__ ((unused)), @@ -224,6 +197,7 @@ Java_gnu_java_awt_peer_gtk_ComponentGraphics_initFromVolatile cr = cairo_create (surface); g_assert(cr != NULL); + cairo_surface_destroy(surface); gdk_threads_leave(); |