PatchSet 6759 Date: 2005/07/22 11:42:49 Author: guilhem Branch: HEAD Tag: (none) Log: Fixlets for XLIB-AWT.
* libraries/clib/awt/X/gra.c, libraries/clib/awt/X/imggif.c, libraries/clib/awt/X/imgjpeg.c, libraries/clib/awt/X/imgpng.c: Fixed the use of real raw data inside native calls. Members: ChangeLog:1.4284->1.4285 libraries/clib/awt/X/gra.c:1.24->1.25 libraries/clib/awt/X/imggif.c:1.17->1.18 libraries/clib/awt/X/imgjpeg.c:1.20->1.21 libraries/clib/awt/X/imgpng.c:1.22->1.23 Index: kaffe/ChangeLog diff -u kaffe/ChangeLog:1.4284 kaffe/ChangeLog:1.4285 --- kaffe/ChangeLog:1.4284 Fri Jul 22 11:36:15 2005 +++ kaffe/ChangeLog Fri Jul 22 11:42:49 2005 @@ -1,3 +1,11 @@ +2005-07-22 Guilhem Lavaux <[EMAIL PROTECTED]> + + * libraries/clib/awt/X/gra.c, + libraries/clib/awt/X/imggif.c, + libraries/clib/awt/X/imgjpeg.c, + libraries/clib/awt/X/imgpng.c: Fixed the use of real raw data + inside native calls. + 2005-07-22 Kurt Miller <[EMAIL PROTECTED]> * m4/ax_create_stdint_h.m4: Define intmax_t if it is not available. Index: kaffe/libraries/clib/awt/X/gra.c diff -u kaffe/libraries/clib/awt/X/gra.c:1.24 kaffe/libraries/clib/awt/X/gra.c:1.25 --- kaffe/libraries/clib/awt/X/gra.c:1.24 Thu Jul 21 17:30:36 2005 +++ kaffe/libraries/clib/awt/X/gra.c Fri Jul 22 11:42:55 2005 @@ -798,15 +798,12 @@ } } - -void -Java_java_awt_Toolkit_graDrawImage ( JNIEnv* env UNUSED, jclass clazz UNUSED, jobject ngr, jobject nimg, - jint srcX, jint srcY, - jint dstX, jint dstY, - jint width, jint height, jint bgval ) +static void +drawImage (Graphics *gr, Image *img, + jint srcX, jint srcY, + jint dstX, jint dstY, + jint width, jint height, jint bgval ) { - Graphics *gr = UNVEIL_GR(ngr); - Image *img = UNVEIL_IMG(nimg); XGCValues values; DBG( AWT_GRA, printf("drawImage: %p %p (%p,%p,%p %d,%d) %d,%d, %d,%d, %d,%d, %x\n", @@ -880,6 +877,18 @@ void +Java_java_awt_Toolkit_graDrawImage ( JNIEnv* env UNUSED, jclass clazz UNUSED, jobject ngr, jobject nimg, + jint srcX, jint srcY, + jint dstX, jint dstY, + jint width, jint height, jint bgval ) +{ + if (nimg == NULL) + return; + + drawImage(UNVEIL_GR(ngr), UNVEIL_IMG(nimg), srcX, srcY, dstX, dstY, width, height, bgval); +} + +void Java_java_awt_Toolkit_graDrawImageScaled ( JNIEnv* env, jclass clazz, jobject ngr, jobject nimg, jint dx0, jint dy0, jint dx1, jint dy1, jint sx0, jint sy0, jint sx1, jint sy1, jint bgval ) @@ -929,8 +938,8 @@ createXImage( X, tgt); initScaledImage( X, tgt, img, dx0-x0, dy0-y0, dx1-x0, dy1-y0, sx0, sy0, sx1, sy1); - Java_java_awt_Toolkit_graDrawImage ( env, clazz, gr, tgt, 0, 0, - x0, y0, tgt->width, tgt->height, bgval); + drawImage ( gr, tgt, 0, 0, + x0, y0, tgt->width, tgt->height, bgval); if ( tgt->shmiImg ) { XSync( X->dsp, False); /* since we're going to destroy tgt, process its drawing first */ } Index: kaffe/libraries/clib/awt/X/imggif.c diff -u kaffe/libraries/clib/awt/X/imggif.c:1.17 kaffe/libraries/clib/awt/X/imggif.c:1.18 --- kaffe/libraries/clib/awt/X/imggif.c:1.17 Wed Jan 19 11:04:31 2000 +++ kaffe/libraries/clib/awt/X/imggif.c Fri Jul 22 11:42:55 2005 @@ -54,7 +54,7 @@ #define CHECK(gifOp) \ if ( gifOp == GIF_ERROR ) { \ - if ( img ) Java_java_awt_Toolkit_imgFreeImage( 0, 0, img); \ + if ( img ) imgFreeImage( img); \ if ( rowBuf ) AWT_FREE( rowBuf); \ return 0; \ } Index: kaffe/libraries/clib/awt/X/imgjpeg.c diff -u kaffe/libraries/clib/awt/X/imgjpeg.c:1.20 kaffe/libraries/clib/awt/X/imgjpeg.c:1.21 --- kaffe/libraries/clib/awt/X/imgjpeg.c:1.20 Sat Mar 27 16:07:32 2004 +++ kaffe/libraries/clib/awt/X/imgjpeg.c Fri Jul 22 11:42:55 2005 @@ -309,7 +309,7 @@ if ( setjmp(jerr.setjmp_buffer)) { if ( img ) { - Java_java_awt_Toolkit_imgFreeImage( 0, 0, img); + imgFreeImage(img); } return 0; } Index: kaffe/libraries/clib/awt/X/imgpng.c diff -u kaffe/libraries/clib/awt/X/imgpng.c:1.22 kaffe/libraries/clib/awt/X/imgpng.c:1.23 --- kaffe/libraries/clib/awt/X/imgpng.c:1.22 Mon Apr 5 05:30:16 2004 +++ kaffe/libraries/clib/awt/X/imgpng.c Fri Jul 22 11:42:55 2005 @@ -173,7 +173,7 @@ if ( setjmp(png_ptr->jmpbuf) ) { if ( img ) - Java_java_awt_Toolkit_imgFreeImage( 0, 0, img); + imgFreeImage(img); if ( rows ) AWT_FREE( rows); if ( data ) _______________________________________________ kaffe mailing list kaffe@kaffe.org http://kaffe.org/cgi-bin/mailman/listinfo/kaffe