#include "bitmap_factory.hpp" namespace mbgl { namespace android { void BitmapFactory::registerNative(jni::JNIEnv& env) { _class = *jni::Class::Find(env).NewGlobalRef(env).release(); } jni::Class BitmapFactory::_class; jni::Object BitmapFactory::DecodeByteArray(jni::JNIEnv& env, jni::Array data, jni::jint offset, jni::jint length) { // Images are loaded with ARGB_8888 config, and premultiplied by default, which is exactly // what we want, so we're not providing a BitmapFactory.Options object. using Signature = jni::Object(jni::Array, jni::jint, jni::jint); auto method = _class.GetStaticMethod(env, "decodeByteArray"); return _class.Call(env, method, data, offset, length); } } // namespace android } // namespace mbgl