| 328 | } |
| 329 | |
| 330 | void RenderPlasma(JNIEnv* env, jclass, jobject bitmap, jlong time_ms) { |
| 331 | AndroidBitmapInfo info; |
| 332 | void* pixels; |
| 333 | int ret; |
| 334 | static Stats stats; |
| 335 | static int init; |
| 336 | |
| 337 | if (!init) { |
| 338 | init_tables(); |
| 339 | stats_init(&stats); |
| 340 | init = 1; |
| 341 | } |
| 342 | |
| 343 | if ((ret = AndroidBitmap_getInfo(env, bitmap, &info)) < 0) { |
| 344 | LOGE("AndroidBitmap_getInfo() failed ! error=%d", ret); |
| 345 | return; |
| 346 | } |
| 347 | |
| 348 | if (info.format != ANDROID_BITMAP_FORMAT_RGB_565) { |
| 349 | LOGE("Bitmap format is not RGB_565 !"); |
| 350 | return; |
| 351 | } |
| 352 | |
| 353 | if ((ret = AndroidBitmap_lockPixels(env, bitmap, &pixels)) < 0) { |
| 354 | LOGE("AndroidBitmap_lockPixels() failed ! error=%d", ret); |
| 355 | } |
| 356 | |
| 357 | stats_startFrame(&stats); |
| 358 | |
| 359 | /* Now fill the values with a nice little plasma */ |
| 360 | fill_plasma(&info, pixels, time_ms); |
| 361 | |
| 362 | AndroidBitmap_unlockPixels(env, bitmap); |
| 363 | |
| 364 | stats_endFrame(&stats); |
| 365 | } |
nothing calls this directly
no test coverage detected