Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
9776138e
Kaydet (Commit)
9776138e
authored
May 31, 2012
tarafından
Tor Lillqvist
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add a BGR to RGBA twiddling JNI function
Change-Id: Iafa2c1805eea2f521479dc97d5668d82b1c91bef
üst
dea03edc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
Bootstrap.java
android/Bootstrap/src/org/libreoffice/android/Bootstrap.java
+8
-0
lo-bootstrap.c
sal/android/lo-bootstrap.c
+44
-0
No files found.
android/Bootstrap/src/org/libreoffice/android/Bootstrap.java
Dosyayı görüntüle @
9776138e
...
@@ -39,6 +39,7 @@ import fi.iki.tml.CommandLine;
...
@@ -39,6 +39,7 @@ import fi.iki.tml.CommandLine;
import
java.io.File
;
import
java.io.File
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.nio.ByteBuffer
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Scanner
;
import
java.util.Scanner
;
...
@@ -108,6 +109,13 @@ public class Bootstrap extends NativeActivity
...
@@ -108,6 +109,13 @@ public class Bootstrap extends NativeActivity
// the Android logging mechanism, or stops the redirection.
// the Android logging mechanism, or stops the redirection.
public
static
native
boolean
redirect_stdio
(
boolean
state
);
public
static
native
boolean
redirect_stdio
(
boolean
state
);
// The DIB returned by css.awt.XBitmap.getDIB is in BGR_888 form, at least
// for Writer documents. We need it in Android's Bitmap.Config.ARGB_888
// format, which actually is RGBA_888, whee... At least in Android 4.0.3,
// at least on my device. No idea if it is always like that or not, the
// documentation sucks.
public
static
native
void
twiddle_BGR_to_RGBA
(
byte
[]
source
,
int
offset
,
int
width
,
int
height
,
ByteBuffer
destination
);
// This setup() method is called 1) in apps that use *this* class as their activity from onCreate(),
// This setup() method is called 1) in apps that use *this* class as their activity from onCreate(),
// and 2) should be called from other kinds of LO code using apps.
// and 2) should be called from other kinds of LO code using apps.
public
static
void
setup
(
Activity
activity
)
public
static
void
setup
(
Activity
activity
)
...
...
sal/android/lo-bootstrap.c
Dosyayı görüntüle @
9776138e
...
@@ -1861,6 +1861,50 @@ Java_org_libreoffice_android_Bootstrap_redirect_1stdio(JNIEnv* env,
...
@@ -1861,6 +1861,50 @@ Java_org_libreoffice_android_Bootstrap_redirect_1stdio(JNIEnv* env,
return
current
;
return
current
;
}
}
__attribute__
((
visibility
(
"default"
)))
void
Java_org_libreoffice_android_Bootstrap_twiddle_1BGR_1to_1RGBA
(
JNIEnv
*
env
,
jobject
clazz
,
jbyteArray
source
,
jint
offset
,
jint
width
,
jint
height
,
jobject
destination
)
{
jbyte
*
dst
=
(
jbyte
*
)
(
*
env
)
->
GetDirectBufferAddress
(
env
,
destination
);
void
*
a
=
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
source
,
NULL
);
jbyte
*
src
=
((
jbyte
*
)
a
)
+
offset
;
jbyte
*
srcp
;
jbyte
*
dstp
=
dst
;
int
step
=
((((
width
*
3
)
-
1
)
/
4
)
+
1
)
*
4
;
int
i
,
j
;
(
void
)
clazz
;
if
(
height
>
0
)
{
srcp
=
src
+
step
*
(
height
-
1
);
step
=
-
step
;
}
else
{
srcp
=
src
;
}
LOGI
(
"twiddle: src=%p, srcp=%p, dstp=%p, step=%d"
,
src
,
srcp
,
dstp
,
step
);
for
(
i
=
0
;
i
<
height
;
i
++
)
{
for
(
j
=
0
;
j
<
width
;
j
++
)
{
*
dstp
++
=
srcp
[
j
*
3
+
2
];
*
dstp
++
=
srcp
[
j
*
3
+
1
];
*
dstp
++
=
srcp
[
j
*
3
+
0
];
*
dstp
++
=
0xFF
;
}
srcp
+=
step
;
}
(
*
env
)
->
ReleasePrimitiveArrayCritical
(
env
,
source
,
a
,
0
);
}
__attribute__
((
visibility
(
"default"
)))
__attribute__
((
visibility
(
"default"
)))
JavaVM
*
JavaVM
*
lo_get_javavm
(
void
)
lo_get_javavm
(
void
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment