[cairo] Run Cairo with OpenGL ES 2 backend on Android

Ngoc Dao ngocdaothanh at gmail.com
Wed Jul 3 04:43:49 PDT 2013


Hi Henry,

How to set EGL_SAMPLES and EGL_SAMPLE_BUFFERS?
Is it OK to set CAIRO_GL_COMPOSITOR like this?
putenv("CAIRO_GL_COMPOSITOR=msaa");

Attached is the error log.


On Tue, Jun 25, 2013 at 11:22 PM, Henry (Yu) Song - SISA <
henry.song at samsung.com> wrote:

>  Hi, Ngoc****
>
> ** **
>
> CAIRO_GL_COMPOSITOR=msaa is not a compile time setting.  At runtime, cairo
> checks this setting.****
>
> ** **
>
> Regarding to crash, can you send log?****
>
> ** **
>
> Henry****
>
> ** **
>
> *From:* Ngoc Dao [mailto:ngocdaothanh at gmail.com]
> *Sent:* Tuesday, June 25, 2013 2:18 AM
> *To:* Henry (Yu) Song - SISA
> *Cc:* cairo at cairographics.org
> *Subject:* Re: [cairo] Run Cairo with OpenGL ES 2 backend on Android****
>
> ** **
>
> Hi Henry,****
>
> Thanks for the info.
>
> I use Samsung Galaxy S3 (Android 4.0.2) and S3 alpha (Android 4.1.1).****
>
>
> I updated my code as you instructed:
>
> CAIRO_GL_COMPOSITOR=msaa:
>
> https://github.com/ngocdaothanh/jsg/blob/cairogles/android/jni/cairo.mk#L149
> ****
>
>
> EGL init:
>
> https://github.com/ngocdaothanh/jsg/blob/cairogles/android/jni/jsg/jsg.cpp#L373
> ****
>
> Could you please check the code above to see if there's anything wrong?***
> *
>
> It still crashes on S3 and slow (and nothing is shown on the screen) on S3
> alpha.****
>
> ** **
>
> Regards,
> Ngoc****
>
> ** **
>
> On Tue, Jun 25, 2013 at 1:29 AM, Henry (Yu) Song - SISA <
> henry.song at samsung.com> wrote:****
>
> Hi, Ngoc****
>
>  ****
>
> Which cairo git did you get cairogles from?  At this moment, there are
> three gl compositors in cairo. ****
>
>  ****
>
> I don’t have android to test.  If you give me some more info, I might be
> able to help you.****
>
>  ****
>
> 1.       What is the GL driver on your android phone?  ****
>
> 2.       Does it support GL_IMG_multisampled_render_to_texture or
> GL_EXT_multisampled_render_to_texture extensions?****
>
> 3.       When you initialize EGL, do you use EGL_SAMPLES and
> EGL_SAMPLE_BUFFERS in configuration?****
>
>  ****
>
> The reason I ask is that if you enable/or your driver supports MSAA, there
> is a faster GL compositor in cairo, called msaa compositor.  The msaa
> compositor is being upstreamed at this moment, but not all of it has been
> upstreamed, about 20 patches left.   ****
>
>  ****
>
> If you want to test with msaa compositor, please visit our branch in
> github - https://github.com/SRA-SiliconValley/cairogles, please pull
> release branch, it is synced with cairo-1.12.14. ****
>
>  ****
>
> When you run cairo, set env CAIRO_GL_COMPOSITOR=msaa, in addition, if your
> app is single-threaded or you have dedicated thread for GL rendering,
> please use cairo_gl_device_set_thread_aware (device, FALSE) to avoid
> unnecessary context switch.****
>
>  ****
>
> If you want to try shadow/blur in cairo, please pull filters-wip branch.
> We have implemented Gaussian filter and drop shadow in that branch for both
> image and gl backends as well.  Tests show our GL backend blur/shadow
> performance is very good, beat skia’s drawBlurLooper hands-down.
> Image-backend performance is not near as good as skia, due to slow
> performance on pixman bilinear sampling, at least on PC.  If you have idea
> to improve, please feel free comment or send patches.****
>
>  ****
>
> Henry****
>
>  ****
>
> *From:* cairo-bounces+hsong=sisa.samsung.com at cairographics.org [mailto:
> cairo-bounces+hsong=sisa.samsung.com at cairographics.org] *On Behalf Of *Ngoc
> Dao
> *Sent:* Wednesday, June 19, 2013 11:23 PM
> *To:* cairo at cairographics.org
> *Subject:* [cairo] Run Cairo with OpenGL ES 2 backend on Android****
>
>  ****
>
> Hi.****
>
>  ****
>
> Have anyone tried to run Cairo with OpenGL ES 2 backend on Android? Is
> there any crash? How's the speed?****
>
>
> I've created a project here (branch master: image backend, cairogles
> branch: OpenGL ES 2 backend):
> https://github.com/ngocdaothanh/jsg****
>
> Some basic results from the project above:
>
> OpenGL ES 2 backend:****
>
> * Crashes on Android 2.3, 4.0.2 etc. with shader compilation problem****
>
> * Doesn't crash on Android 4.1.1, but very very slow, 0.5 FPS/s****
>
> Image backend is stable but slow, 12 FPS/s.****
>
> Ngoc****
>
> ** **
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20130703/40e697b1/attachment-0001.html>
-------------- next part --------------
07-03 20:40:11.970: A/libc(25953): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)
07-03 20:40:12.098: D/dalvikvm(722): GC_CONCURRENT freed 1467K, 16% free 13592K/16099K, paused 2ms+3ms
07-03 20:40:12.492: I/DEBUG(21988): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-03 20:40:12.492: I/DEBUG(21988): Build fingerprint: 'DOCOMO/F10D/F10D:4.0.3/V20R47F/F10D.20121022.165258:user/release-keys'
07-03 20:40:12.492: I/DEBUG(21988): pid: 25953, tid: 25970  >>> com.example.native_activity <<<
07-03 20:40:12.492: I/DEBUG(21988): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
07-03 20:40:12.493: I/DEBUG(21988):  r0 00008b31  r1 00bd6868  r2 00008b31  r3 00000000
07-03 20:40:12.493: I/DEBUG(21988):  r4 00bdb2dc  r5 00bd6868  r6 5bc1d8f4  r7 00000000
07-03 20:40:12.493: I/DEBUG(21988):  r8 00000000  r9 00000014  10 00000000  fp 00000000
07-03 20:40:12.493: I/DEBUG(21988):  ip 00000000  sp 5bc1d8f0  lr 5b5c73c1  pc 00000000  cpsr 00000010
07-03 20:40:12.493: I/DEBUG(21988):  d0  497ffff8000fffff  d1  447a0000497ffff0
07-03 20:40:12.493: I/DEBUG(21988):  d2  40dfae143f800000  d3  3f00000000000000
07-03 20:40:12.493: I/DEBUG(21988):  d4  3f80000000000000  d5  0000000000000000
07-03 20:40:12.494: I/DEBUG(21988):  d6  3f00000000000000  d7  3efffff03efffff0
07-03 20:40:12.494: I/DEBUG(21988):  d8  0000000000000000  d9  0000000000000000
07-03 20:40:12.494: I/DEBUG(21988):  d10 0000000000000000  d11 0000000000000000
07-03 20:40:12.494: I/DEBUG(21988):  d12 0000000000000000  d13 0000000000000000
07-03 20:40:12.494: I/DEBUG(21988):  d14 0000000000000000  d15 0000000000000000
07-03 20:40:12.494: I/DEBUG(21988):  d16 00000000002ee55c  d17 bff0000000000000
07-03 20:40:12.494: I/DEBUG(21988):  d18 3ff0000000000000  d19 0000000000000000
07-03 20:40:12.494: I/DEBUG(21988):  d20 0000000000000000  d21 0000000000000000
07-03 20:40:12.495: I/DEBUG(21988):  d22 3ff0000000000000  d23 0000000000000000
07-03 20:40:12.495: I/DEBUG(21988):  d24 3ff0000000000000  d25 0000000000000000
07-03 20:40:12.495: I/DEBUG(21988):  d26 0000000000000000  d27 0000000000000000
07-03 20:40:12.495: I/DEBUG(21988):  d28 0003000000030000  d29 0003000000030000
07-03 20:40:12.495: I/DEBUG(21988):  d30 0001000000010000  d31 0001000000010000
07-03 20:40:12.496: I/DEBUG(21988):  scr 80000013
07-03 20:40:12.682: I/DEBUG(21988):          #00  pc 00000000  
07-03 20:40:12.683: I/DEBUG(21988):          #01  pc 000a53be  /data/data/com.example.native_activity/lib/libjsg.so
07-03 20:40:12.683: I/DEBUG(21988):          #02  pc 000a55d6  /data/data/com.example.native_activity/lib/libjsg.so
07-03 20:40:12.684: I/DEBUG(21988):          #03  pc 000a586c  /data/data/com.example.native_activity/lib/libjsg.so
07-03 20:40:12.685: I/DEBUG(21988):          #04  pc 00058600  /data/data/com.example.native_activity/lib/libjsg.so
07-03 20:40:12.685: I/DEBUG(21988):          #05  pc 00056658  /data/data/com.example.native_activity/lib/libjsg.so (cairo_egl_device_create)
07-03 20:40:12.686: I/DEBUG(21988):          #06  pc 0004d7e4  /data/data/com.example.native_activity/lib/libjsg.so
07-03 20:40:12.687: I/DEBUG(21988):          #07  pc 00012f7c  /system/lib/libc.so (__thread_entry)
07-03 20:40:12.687: I/DEBUG(21988):          #08  pc 00012ad0  /system/lib/libc.so (pthread_create)
07-03 20:40:12.688: I/DEBUG(21988): mem near R0:
07-03 20:40:12.688: I/DEBUG(21988): 00008b10 e28fc600 e28cca01 e5bcf658 e28fc600  ........X.......
07-03 20:40:12.688: I/DEBUG(21988): 00008b20 e28cca01 e5bcf650 e28fc600 e28cca01  ....P...........
07-03 20:40:12.689: I/DEBUG(21988): 00008b30 e5bcf648 e28fc600 e28cca01 e5bcf640  H........... at ...
07-03 20:40:12.689: I/DEBUG(21988): 00008b40 e28fc600 e28cca01 e5bcf638 e28fc600  ........8.......
07-03 20:40:12.689: I/DEBUG(21988): 00008b50 e28cca01 e5bcf630 e28fc600 e28cca01  ....0...........
07-03 20:40:12.689: I/DEBUG(21988): mem near R1:
07-03 20:40:12.690: I/DEBUG(21988): 00bd6848 00000000 00000000 00000000 00000de1  ................
07-03 20:40:12.690: I/DEBUG(21988): 00bd6858 00000001 00000000 00000000 00000001  ................
07-03 20:40:12.691: I/DEBUG(21988): 00bd6868 00000000 00000000 00000000 00000000  ................
07-03 20:40:12.691: I/DEBUG(21988): 00bd6878 00000000 00000000 00000000 00000000  ................
07-03 20:40:12.691: I/DEBUG(21988): 00bd6888 00000000 00000000 00000000 00000000  ................
07-03 20:40:12.691: I/DEBUG(21988): mem near R2:
07-03 20:40:12.692: I/DEBUG(21988): 00008b10 e28fc600 e28cca01 e5bcf658 e28fc600  ........X.......
07-03 20:40:12.692: I/DEBUG(21988): 00008b20 e28cca01 e5bcf650 e28fc600 e28cca01  ....P...........
07-03 20:40:12.692: I/DEBUG(21988): 00008b30 e5bcf648 e28fc600 e28cca01 e5bcf640  H........... at ...
07-03 20:40:12.693: I/DEBUG(21988): 00008b40 e28fc600 e28cca01 e5bcf638 e28fc600  ........8.......
07-03 20:40:12.693: I/DEBUG(21988): 00008b50 e28cca01 e5bcf630 e28fc600 e28cca01  ....0...........
07-03 20:40:12.694: I/DEBUG(21988): mem near R4:
07-03 20:40:12.694: I/DEBUG(21988): 00bdb2bc 00000000 00000000 00000000 00000000  ................
07-03 20:40:12.694: I/DEBUG(21988): 00bdb2cc 00000000 00000000 00000000 00000000  ................
07-03 20:40:12.694: I/DEBUG(21988): 00bdb2dc 00000000 00000000 00000000 5c4d302c  ............,0M\
07-03 20:40:12.694: I/DEBUG(21988): 00bdb2ec 5c4d41e4 00000000 00000000 00000000  .AM\............
07-03 20:40:12.695: I/DEBUG(21988): 00bdb2fc 00000000 00000000 00000000 00000000  ................
07-03 20:40:12.695: I/DEBUG(21988): mem near R5:
07-03 20:40:12.695: I/DEBUG(21988): 00bd6848 00000000 00000000 00000000 00000de1  ................
07-03 20:40:12.695: I/DEBUG(21988): 00bd6858 00000001 00000000 00000000 00000001  ................
07-03 20:40:12.695: I/DEBUG(21988): 00bd6868 00000000 00000000 00000000 00000000  ................
07-03 20:40:12.696: I/DEBUG(21988): 00bd6878 00000000 00000000 00000000 00000000  ................
07-03 20:40:12.696: I/DEBUG(21988): 00bd6888 00000000 00000000 00000000 00000000  ................
07-03 20:40:12.696: I/DEBUG(21988): mem near R6:
07-03 20:40:12.696: I/DEBUG(21988): 5bc1d8d4 4004c554 00a8e920 00000014 00000000  T..@ ...........
07-03 20:40:12.696: I/DEBUG(21988): 5bc1d8e4 40019bd9 df0027ad 00000000 00a8e920  ... at .'...... ...
07-03 20:40:12.697: I/DEBUG(21988): 5bc1d8f4 00af4488 00000000 00000014 00000000  .D..............
07-03 20:40:12.697: I/DEBUG(21988): 5bc1d904 4001a23b 00a8e920 00bda868 00bd6818  ;..@ ...h....h..
07-03 20:40:12.697: I/DEBUG(21988): 5bc1d914 00af4488 00000000 5b5c75db 00a8e7d0  .D.......u\[....
07-03 20:40:12.697: I/DEBUG(21988): mem near SP:
07-03 20:40:12.697: I/DEBUG(21988): 5bc1d8d0 00000250 4004c554 00a8e920 00000014  P...T..@ .......
07-03 20:40:12.698: I/DEBUG(21988): 5bc1d8e0 00000000 40019bd9 df0027ad 00000000  ....... at .'......
07-03 20:40:12.698: I/DEBUG(21988): 5bc1d8f0 00a8e920 00af4488 00000000 00000014   ....D..........
07-03 20:40:12.698: I/DEBUG(21988): 5bc1d900 00000000 4001a23b 00a8e920 00bda868  ....;..@ ...h...
07-03 20:40:12.698: I/DEBUG(21988): 5bc1d910 00bd6818 00af4488 00000000 5b5c75db  .h...D.......u\[
07-03 20:40:12.698: I/DEBUG(21988): mem near LR:
07-03 20:40:12.699: I/DEBUG(21988): 5b5c73a0 003aec68 003aeedc f500b5f0 b0874494  h.:...:......D..
07-03 20:40:12.699: I/DEBUG(21988): 5b5c73b0 ae0634c4 460d4610 3d14f846 47986963  .4...F.FF..=ci.G
07-03 20:40:12.699: I/DEBUG(21988): 5b5c73c0 21014632 60282300 47b069a6 69e36828  2F.!.#(`.i.G(h.i
07-03 20:40:12.699: I/DEBUG(21988): 5b5c73d0 68284798 f6486a23 aa033181 9e034798  .G(h#jH..1...G..
07-03 20:40:12.700: I/DEBUG(21988): 5b5c73e0 b007b10e 6828bdf0 3184f648 aa046a23  ......(hH..1#j..
07-03 20:40:12.700: I/DEBUG(21988): stack:
07-03 20:40:12.700: I/DEBUG(21988):     5bc1d8b0  00000000  
07-03 20:40:12.700: I/DEBUG(21988):     5bc1d8b4  40018d75  /system/lib/libc.so
07-03 20:40:12.700: I/DEBUG(21988):     5bc1d8b8  00a8e948  [heap]
07-03 20:40:12.701: I/DEBUG(21988):     5bc1d8bc  00a8eb50  [heap]
07-03 20:40:12.701: I/DEBUG(21988):     5bc1d8c0  00000220  
07-03 20:40:12.701: I/DEBUG(21988):     5bc1d8c4  4004c554  
07-03 20:40:12.701: I/DEBUG(21988):     5bc1d8c8  00a8e918  [heap]
07-03 20:40:12.701: I/DEBUG(21988):     5bc1d8cc  00a8e948  [heap]
07-03 20:40:12.702: I/DEBUG(21988):     5bc1d8d0  00000250  
07-03 20:40:12.702: I/DEBUG(21988):     5bc1d8d4  4004c554  
07-03 20:40:12.702: I/DEBUG(21988):     5bc1d8d8  00a8e920  [heap]
07-03 20:40:12.702: I/DEBUG(21988):     5bc1d8dc  00000014  
07-03 20:40:12.702: I/DEBUG(21988):     5bc1d8e0  00000000  
07-03 20:40:12.702: I/DEBUG(21988):     5bc1d8e4  40019bd9  /system/lib/libc.so
07-03 20:40:12.703: I/DEBUG(21988):     5bc1d8e8  df0027ad  
07-03 20:40:12.703: I/DEBUG(21988):     5bc1d8ec  00000000  
07-03 20:40:12.703: I/DEBUG(21988): #01 5bc1d8f0  00a8e920  [heap]
07-03 20:40:12.703: I/DEBUG(21988):     5bc1d8f4  00af4488  [heap]
07-03 20:40:12.703: I/DEBUG(21988):     5bc1d8f8  00000000  
07-03 20:40:12.704: I/DEBUG(21988):     5bc1d8fc  00000014  
07-03 20:40:12.704: I/DEBUG(21988):     5bc1d900  00000000  
07-03 20:40:12.704: I/DEBUG(21988):     5bc1d904  4001a23b  /system/lib/libc.so
07-03 20:40:12.704: I/DEBUG(21988):     5bc1d908  00a8e920  [heap]
07-03 20:40:12.704: I/DEBUG(21988):     5bc1d90c  00bda868  [heap]
07-03 20:40:12.705: I/DEBUG(21988):     5bc1d910  00bd6818  [heap]
07-03 20:40:12.705: I/DEBUG(21988):     5bc1d914  00af4488  [heap]
07-03 20:40:12.705: I/DEBUG(21988):     5bc1d918  00000000  
07-03 20:40:12.705: I/DEBUG(21988):     5bc1d91c  5b5c75db  /data/data/com.example.native_activity/lib/libjsg.so


More information about the cairo mailing list