Temporarily use indirect

This commit is contained in:
Victor Shcherb 2012-04-20 22:55:35 +02:00
parent faa247f4cd
commit 30cf4ee953
3 changed files with 19 additions and 15 deletions

View file

@ -341,8 +341,6 @@ SkBitmap* getCachedBitmap(RenderingContext* rc, const std::string& bitmapResourc
jbyte* bitmapBuffer = getGlobalJniEnv()->GetByteArrayElements(javaIconRawData, NULL);
size_t bufferLen = getGlobalJniEnv()->GetArrayLength(javaIconRawData);
__android_log_print(ANDROID_LOG_INFO, LOG_TAG, "getCachedBitmap : bitmap buffer len %d at %p", bufferLen, bitmapBuffer);
// Decode bitmap
SkBitmap* iconBitmap = new SkBitmap();
//TODO: JPEG is badly supported! At the moment it needs sdcard to be present (sic). Patch that

View file

@ -730,7 +730,10 @@ extern "C" JNIEXPORT jobject JNICALL Java_net_osmand_plus_render_NativeOsmandLib
if(!module_libjnigraphics)
{
module_libjnigraphics = dlopen("jnigraphics", RTLD_LAZY);
// module_libjnigraphics = dlopen("jnigraphics", RTLD_NOW | RTLD_NOLOAD);
// if(!module_libjnigraphics) {
module_libjnigraphics = dlopen("jnigraphics", RTLD_NOW);
// }
if(!module_libjnigraphics)
{
__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, "Failed to load jnigraphics via dlopen, will going to crash");
@ -741,6 +744,7 @@ extern "C" JNIEXPORT jobject JNICALL Java_net_osmand_plus_render_NativeOsmandLib
dl_AndroidBitmap_unlockPixels = (PTR_AndroidBitmap_unlockPixels)dlsym(module_libjnigraphics, "AndroidBitmap_unlockPixels");
}
// Gain information about bitmap
AndroidBitmapInfo bitmapInfo;
if(dl_AndroidBitmap_getInfo(getGlobalJniEnv(), targetBitmap, &bitmapInfo) != ANDROID_BITMAP_RESUT_SUCCESS)

View file

@ -77,11 +77,13 @@ public class NativeOsmandLibrary {
return new RenderingGenerationResult(null);
}
if(android.os.Build.VERSION.SDK_INT >= 8) // Android 2.2+
// Android 2.2+
if(android.os.Build.VERSION.SDK_INT >= 8 && false) {
return generateRendering_Direct(rc, searchResultHandler.nativeHandler, bitmap, useEnglishNames, render, defaultColor);
else
} else {
return generateRendering_Indirect(rc, searchResultHandler.nativeHandler, requestedBitmapWidth, requestedBitmapHeight, rowBytes, isTransparent, useEnglishNames, render, defaultColor);
}
}
/**
* @param searchResultHandle