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

Ngoc Dao ngocdaothanh at gmail.com
Tue Jun 25 02:17:30 PDT 2013


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/20130625/22e00ac9/attachment-0001.html>


More information about the cairo mailing list