diff --git a/xwords4/android/XWords4/jni/Android.mk b/xwords4/android/XWords4/jni/Android.mk index f0a5f8d07..05062f5db 100644 --- a/xwords4/android/XWords4/jni/Android.mk +++ b/xwords4/android/XWords4/jni/Android.mk @@ -20,6 +20,7 @@ local_DEFINES += \ -DKEY_SUPPORT \ -DPOINTER_SUPPORT \ -DSCROLL_DRAG_THRESHHOLD=1 \ + -DDROP_BITMAPS \ -DNODE_CAN_4 \ -D__LITTLE_ENDIAN \ diff --git a/xwords4/android/XWords4/jni/anddict.c b/xwords4/android/XWords4/jni/anddict.c index 76112f152..25d394cf4 100644 --- a/xwords4/android/XWords4/jni/anddict.c +++ b/xwords4/android/XWords4/jni/anddict.c @@ -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; diff --git a/xwords4/android/XWords4/jni/jniutlswrapper.c b/xwords4/android/XWords4/jni/jniutlswrapper.c index fa2770a31..0c681b369 100644 --- a/xwords4/android/XWords4/jni/jniutlswrapper.c +++ b/xwords4/android/XWords4/jni/jniutlswrapper.c @@ -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, diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIUtils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIUtils.java index 9df9c5cc9..42fef3cb2 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIUtils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIUtils.java @@ -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 ); } \ No newline at end of file diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIUtilsImpl.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIUtilsImpl.java index 588a5dd22..349fbb8fe 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIUtilsImpl.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIUtilsImpl.java @@ -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