Temporarily use indirect
This commit is contained in:
parent
faa247f4cd
commit
30cf4ee953
3 changed files with 19 additions and 15 deletions
|
@ -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
|
||||
|
|
|
@ -728,19 +728,23 @@ extern "C" JNIEXPORT jobject JNICALL Java_net_osmand_plus_render_NativeOsmandLib
|
|||
static PTR_AndroidBitmap_unlockPixels dl_AndroidBitmap_unlockPixels = 0;
|
||||
static void* module_libjnigraphics = 0;
|
||||
|
||||
if(!module_libjnigraphics)
|
||||
{
|
||||
module_libjnigraphics = dlopen("jnigraphics", RTLD_LAZY);
|
||||
if(!module_libjnigraphics)
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, "Failed to load jnigraphics via dlopen, will going to crash");
|
||||
return NULL;
|
||||
}
|
||||
dl_AndroidBitmap_getInfo = (PTR_AndroidBitmap_getInfo)dlsym(module_libjnigraphics, "AndroidBitmap_getInfo");
|
||||
dl_AndroidBitmap_lockPixels = (PTR_AndroidBitmap_lockPixels)dlsym(module_libjnigraphics, "AndroidBitmap_lockPixels");
|
||||
dl_AndroidBitmap_unlockPixels = (PTR_AndroidBitmap_unlockPixels)dlsym(module_libjnigraphics, "AndroidBitmap_unlockPixels");
|
||||
if(!module_libjnigraphics)
|
||||
{
|
||||
// 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");
|
||||
return NULL;
|
||||
}
|
||||
dl_AndroidBitmap_getInfo = (PTR_AndroidBitmap_getInfo)dlsym(module_libjnigraphics, "AndroidBitmap_getInfo");
|
||||
dl_AndroidBitmap_lockPixels = (PTR_AndroidBitmap_lockPixels)dlsym(module_libjnigraphics, "AndroidBitmap_lockPixels");
|
||||
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)
|
||||
|
|
|
@ -77,10 +77,12 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue