diff options
author | Tor Lillqvist <tlillqvist@suse.com> | 2012-06-11 20:06:39 +0300 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-06-12 13:50:50 +0300 |
commit | 3ea3c6afa274ea169212101111628d883b7b3f65 (patch) | |
tree | 0ac43dd3a0dcf120652ad84308852239deb30c25 /sal | |
parent | Implement XToolkit2::createScreenCompatibleDeviceUsingBuffer for Android (diff) | |
download | core-3ea3c6afa274ea169212101111628d883b7b3f65.tar.gz core-3ea3c6afa274ea169212101111628d883b7b3f65.zip |
Use XToolkit2::createScreenCompatibleDeviceUsingBuffer
Render directly to a direct ByteBuffer allocated on the Java side.
Change-Id: I2d66e4146df77e92260918a78ef22cd9b8c95384
Diffstat (limited to 'sal')
-rw-r--r-- | sal/android/lo-bootstrap.c | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/sal/android/lo-bootstrap.c b/sal/android/lo-bootstrap.c index b6e29baf13e3..677ff1c8ba7a 100644 --- a/sal/android/lo-bootstrap.c +++ b/sal/android/lo-bootstrap.c @@ -1907,11 +1907,11 @@ Java_org_libreoffice_android_Bootstrap_twiddle_1BGR_1to_1RGBA(JNIEnv* env, __attribute__ ((visibility("default"))) void -Java_org_libreoffice_android_Bootstrap_force_1full_1alpha(JNIEnv* env, - jobject clazz, - jbyteArray array, - jint offset, - jint size) +Java_org_libreoffice_android_Bootstrap_force_1full_1alpha_1array(JNIEnv* env, + jobject clazz, + jbyteArray array, + jint offset, + jint length) { void *a = (*env)->GetPrimitiveArrayCritical(env, array, NULL); jbyte *p = ((jbyte *) a) + offset; @@ -1920,7 +1920,7 @@ Java_org_libreoffice_android_Bootstrap_force_1full_1alpha(JNIEnv* env, (void) clazz; - for (i = 0; i < size; i += 4) { + for (i = 0; i < length; i += 4) { p[3] = 0xFF; p += 4; } @@ -1929,6 +1929,34 @@ Java_org_libreoffice_android_Bootstrap_force_1full_1alpha(JNIEnv* env, } __attribute__ ((visibility("default"))) +void +Java_org_libreoffice_android_Bootstrap_force_1full_1alpha_1bb(JNIEnv* env, + jobject clazz, + jobject buffer, + jint offset, + jint length) +{ + jbyte *p = (*env)->GetDirectBufferAddress(env, buffer) + offset; + + int i; + + (void) clazz; + + for (i = 0; i < length; i += 4) { + p[3] = 0xFF; + p += 4; + } +} + +__attribute__ ((visibility("default"))) +jlong +Java_org_libreoffice_android_Bootstrap_address_1of_1direct_1byte_1buffer(JNIEnv *env, + jobject bbuffer) +{ + return (jlong) (intptr_t) (*env)->GetDirectBufferAddress(env, bbuffer); +} + +__attribute__ ((visibility("default"))) JavaVM * lo_get_javavm(void) { |