gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/gfx jni/GzzGL-jni.cxx libimagecache/ImageCa...


From: Tero Mäyränen
Subject: [Gzz-commits] gzz/gfx jni/GzzGL-jni.cxx libimagecache/ImageCa...
Date: Wed, 18 Sep 2002 07:40:09 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tero Mäyränen <address@hidden>  02/09/18 07:40:09

Modified files:
        gfx/jni        : GzzGL-jni.cxx 
        gfx/libimagecache: ImageCache.cxx 
        gfx/librenderables: renderables.py 

Log message:
        Fixing the JNI part of ImageCache mostly.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/jni/GzzGL-jni.cxx.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libimagecache/ImageCache.cxx.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.46&tr2=1.47&r1=text&r2=text

Patches:
Index: gzz/gfx/jni/GzzGL-jni.cxx
diff -c gzz/gfx/jni/GzzGL-jni.cxx:1.22 gzz/gfx/jni/GzzGL-jni.cxx:1.23
*** gzz/gfx/jni/GzzGL-jni.cxx:1.22      Wed Sep 18 06:01:26 2002
--- gzz/gfx/jni/GzzGL-jni.cxx   Wed Sep 18 07:40:09 2002
***************
*** 12,17 ****
--- 12,19 ----
  
  #include "libos/Os.hxx"
  
+ #include "libimagecache/ImageCache.hxx"
+ 
  using namespace Vec23;
  
  using Text::DenseGlyphs;
***************
*** 273,286 ****
  
  // ImageCache
  
! /*
! JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_getImage
!   (JNIEnv *env, jclass, jstring juri, jint lod) {
!     string uri = new string((*env)->GetStringUTFChars(env, jstr, 0));
!     (*env)->ReleaseStringUTFChars(env, jstr, str);
!     imageCache->getPixbuf();
    }
!   */
  
  // Image
  
--- 275,305 ----
  
  // ImageCache
  
! JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_writeToImageCache
!   (JNIEnv *env, jclass cls, jstring juri, jcharArray jbuf, jint len) {
! 
!     char uri[] = (char *)((*env)->GetStringUTFChars(env, juri, 0));
!     char buf[] = (char *)((*env)->GetCharArrayElements(env, jbuf, 0));
! //    imageCache->write(new string(uri), buf, len);
!     (*env)->ReleaseStringUTFChars(env, juri, uri);
!     (*env)->ReleaseCharArrayElements(env, jbuf, buf, 0);
    }
! 
! JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_getFromImageCache
!   (JNIEnv *env, jclass cls, jstring juri, jint lod) {
! 
!     char uri[] = (char *)((env *)->GetStringUTFChars(env, juri, 0));
!     string suri = new string(uri);
! //    GdkPixbuf *pb = imageCache->getPixbuf(suri, lod);
!     if (pb == START_PIXBUF_BACKGROUND_LOADER) {
!       methodID mid = (*env)->GetStaticMethodID(env, cls,
!           "startBackgroundImageLoader", "(Ljava/lang/String;)V");
!         if (mid != 0) {
!           (*env)->CallStaticVoidMethod(env, cls, mid, juri);
!       }
! //    pb = imageCache->getPixbuf(suri, lod);
!     }
!     (*env)->ReleaseStringUTFChars(env, juri, uri);
  
  // Image
  
***************
*** 389,395 ****
  
      glBindTexture(GL_TEXTURE_2D, id);
      // Null = just set size and texture format. 
!     glTexImage2D(GL_TEXTURE_2D, 
                level, internalFormat, w, h, border, format, type, NULL);
      glBindTexture(GL_TEXTURE_2D, 0);
      GLERR
--- 408,414 ----
  
      glBindTexture(GL_TEXTURE_2D, id);
      // Null = just set size and texture format. 
!     glTexImage2D(GL_TEXTURE_2D,
                level, internalFormat, w, h, border, format, type, NULL);
      glBindTexture(GL_TEXTURE_2D, 0);
      GLERR
Index: gzz/gfx/libimagecache/ImageCache.cxx
diff -c gzz/gfx/libimagecache/ImageCache.cxx:1.3 
gzz/gfx/libimagecache/ImageCache.cxx:1.4
*** gzz/gfx/libimagecache/ImageCache.cxx:1.3    Wed Sep 18 04:04:05 2002
--- gzz/gfx/libimagecache/ImageCache.cxx        Wed Sep 18 07:40:09 2002
***************
*** 180,191 ****
        size += ci->getSizeChange();
  
        GdkPixbuf *pb = ci->getPixbuf(lod);
!       if (pb == START_PIXBUF_BACKGROUND_LOADER) {
  
-           //backgroundLoader->startLoading(uri);
- 
-           pb = ci->getPixbuf(lod);
-       }
        return (pb == NULL ? loading : pb);
      }
  
--- 180,187 ----
        size += ci->getSizeChange();
  
        GdkPixbuf *pb = ci->getPixbuf(lod);
!       if (pb == START_PIXBUF_BACKGROUND_LOADER) return pb;
  
        return (pb == NULL ? loading : pb);
      }
  
Index: gzz/gfx/librenderables/renderables.py
diff -c gzz/gfx/librenderables/renderables.py:1.46 
gzz/gfx/librenderables/renderables.py:1.47
*** gzz/gfx/librenderables/renderables.py:1.46  Wed Sep 18 06:01:26 2002
--- gzz/gfx/librenderables/renderables.py       Wed Sep 18 07:40:09 2002
***************
*** 1290,1297 ****
  
      //--------- ImageCache
        static public class ImageCache {
!           public static TexRect getTexRect(String uri, int lod) {
!               return getFromImageCache(uri, lod);
            }
  
            public static void write(String uri, char buf[], int len) {
--- 1290,1297 ----
  
      //--------- ImageCache
        static public class ImageCache {
!           public static void get(String uri, int lod) {
!               getFromImageCache(uri, lod);
            }
  
            public static void write(String uri, char buf[], int len) {
***************
*** 1299,1308 ****
            }
        }
  
!       static private native TexRect getFromImageCache(String uri, int lod);
        static private native void writeToImageCache(String uri, char buf[], 
int len);
  
!       static public void startLoader(String uri) {
            gzz.gfx.gl.GLBackgroundImageLoader.startLoading(uri);
        }
  
--- 1299,1308 ----
            }
        }
  
!       static private native void getFromImageCache(String uri, int lod);
        static private native void writeToImageCache(String uri, char buf[], 
int len);
  
!       static public void startBackgroundImageLoader(String uri) {
            gzz.gfx.gl.GLBackgroundImageLoader.startLoading(uri);
        }
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]