Since we're not using bitmaps any more remove the code to parse and

convert them.
This commit is contained in:
eehouse 2010-04-22 04:56:14 +00:00
parent 7003a5cd93
commit 94d3f7483c
5 changed files with 7 additions and 19 deletions

View file

@ -20,6 +20,7 @@ local_DEFINES += \
-DKEY_SUPPORT \
-DPOINTER_SUPPORT \
-DSCROLL_DRAG_THRESHHOLD=1 \
-DDROP_BITMAPS \
-DNODE_CAN_4 \
-D__LITTLE_ENDIAN \

View file

@ -107,6 +107,9 @@ andMakeBitmap( AndDictionaryCtxt* ctxt, XP_U8** ptrp )
if ( nCols > 0 ) {
XP_U8 nRows = *ptr++;
#ifdef DROP_BITMAPS
ptr += ((nRows*nCols)+7) / 8;
#else
XP_U8 srcByte = 0;
XP_U8 nBits;
XP_U16 ii;
@ -134,6 +137,7 @@ andMakeBitmap( AndDictionaryCtxt* ctxt, XP_U8** ptrp )
(void)(*env)->NewGlobalRef( env, bitmap );
(*env)->DeleteLocalRef( env, bitmap );
XP_FREE( ctxt->super.mpool, colors );
#endif
}
*ptrp = ptr;

View file

@ -53,6 +53,7 @@ destroyJNIUtil( JNIUtilCtxt** ctxtp )
}
/* These are called from anddict.c, not via vtable */
#ifndef DROP_BITMAPS
jobject
and_util_makeJBitmap( JNIUtilCtxt* jniutil, int nCols, int nRows,
const jboolean* colors )
@ -71,6 +72,7 @@ and_util_makeJBitmap( JNIUtilCtxt* jniutil, int nCols, int nRows,
return bitmap;
}
#endif
jobject
and_util_splitFaces( JNIUtilCtxt* jniutil, const XP_U8* bytes, jsize len,

View file

@ -25,6 +25,5 @@ import android.graphics.drawable.BitmapDrawable;
public interface JNIUtils {
// Stuff I can't do in C....
BitmapDrawable makeBitmap( int width, int height, boolean[] colors );
String[] splitFaces( byte[] chars, boolean isUTF8 );
}

View file

@ -42,24 +42,6 @@ public class JNIUtilsImpl implements JNIUtils {
return s_impl;
}
public BitmapDrawable makeBitmap( int width, int height, boolean[] colors )
{
Bitmap bitmap = Bitmap.createBitmap( width, height,
Bitmap.Config.ARGB_8888 );
int indx = 0;
for ( int yy = 0; yy < height; ++yy ) {
for ( int xx = 0; xx < width; ++xx ) {
boolean pixelSet = colors[indx++];
bitmap.setPixel( xx, yy, pixelSet? 0xFF000000 : 0x00 );
}
}
// Doesn't compile if pass getResources(). Maybe the
// "deprecated" API is really the only one?
return new BitmapDrawable( /*getResources(), */bitmap );
}
/** Working around lack of utf8 support on the JNI side: given a
* utf-8 string with embedded small number vals starting with 0,
* convert into individual strings. The 0 is the problem: it's