<div dir="ltr"><div><div>Hi Henry,<br><br></div>How to set EGL_SAMPLES and EGL_SAMPLE_BUFFERS?<br>Is it OK to set CAIRO_GL_COMPOSITOR like this?<br>putenv("CAIRO_GL_COMPOSITOR=msaa");<br><br></div><div>Attached is the error log.<br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 25, 2013 at 11:22 PM, Henry (Yu) Song - SISA <span dir="ltr"><<a href="mailto:henry.song@samsung.com" target="_blank">henry.song@samsung.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi, Ngoc<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">CAIRO_GL_COMPOSITOR=msaa is not a compile time setting. At runtime, cairo checks this setting.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Regarding to crash, can you send log?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Henry<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Ngoc Dao [mailto:<a href="mailto:ngocdaothanh@gmail.com" target="_blank">ngocdaothanh@gmail.com</a>]
<br>
<b>Sent:</b> Tuesday, June 25, 2013 2:18 AM<br>
<b>To:</b> Henry (Yu) Song - SISA<br>
<b>Cc:</b> <a href="mailto:cairo@cairographics.org" target="_blank">cairo@cairographics.org</a><br>
<b>Subject:</b> Re: [cairo] Run Cairo with OpenGL ES 2 backend on Android<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi Henry,<u></u><u></u></p>
</div>
<p class="MsoNormal">Thanks for the info.<br>
<br>
I use Samsung Galaxy S3 (Android 4.0.2) and S3 alpha (Android 4.1.1).<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><br>
I updated my code as you instructed:<br>
<br>
CAIRO_GL_COMPOSITOR=msaa:<br>
<a href="https://github.com/ngocdaothanh/jsg/blob/cairogles/android/jni/cairo.mk#L149" target="_blank">https://github.com/ngocdaothanh/jsg/blob/cairogles/android/jni/cairo.mk#L149</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
EGL init:<br>
<a href="https://github.com/ngocdaothanh/jsg/blob/cairogles/android/jni/jsg/jsg.cpp#L373" target="_blank">https://github.com/ngocdaothanh/jsg/blob/cairogles/android/jni/jsg/jsg.cpp#L373</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Could you please check the code above to see if there's anything wrong?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">It still crashes on S3 and slow (and nothing is shown on the screen) on S3 alpha.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">Regards,<br>
Ngoc<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Tue, Jun 25, 2013 at 1:29 AM, Henry (Yu) Song - SISA <<a href="mailto:henry.song@samsung.com" target="_blank">henry.song@samsung.com</a>> wrote:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi, Ngoc</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Which cairo git did you get cairogles from? At this moment, there are three gl compositors in cairo.
</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I don’t have android to test. If you give me some more info, I might be able to help you.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">1.</span><span style="font-size:7.0pt;color:#1f497d">
</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">What is the GL driver on your android phone?
</span><u></u><u></u></p>
<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">2.</span><span style="font-size:7.0pt;color:#1f497d">
</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Does it support GL_IMG_multisampled_render_to_texture or GL_EXT_multisampled_render_to_texture extensions?</span><u></u><u></u></p>
<p><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">3.</span><span style="font-size:7.0pt;color:#1f497d">
</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">When you initialize EGL, do you use EGL_SAMPLES and EGL_SAMPLE_BUFFERS in configuration?</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">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.
</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">If you want to test with msaa compositor, please visit our branch in github -
</span><a href="https://github.com/SRA-SiliconValley/cairogles" target="_blank">https://github.com/SRA-SiliconValley/cairogles</a>, please pull release branch, it is synced with cairo-1.12.14.
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">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.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">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.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Henry<u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> cairo-bounces+hsong=<a href="mailto:sisa.samsung.com@cairographics.org" target="_blank">sisa.samsung.com@cairographics.org</a>
[mailto:<a href="mailto:cairo-bounces%2Bhsong" target="_blank">cairo-bounces+hsong</a>=<a href="mailto:sisa.samsung.com@cairographics.org" target="_blank">sisa.samsung.com@cairographics.org</a>]
<b>On Behalf Of </b>Ngoc Dao<br>
<b>Sent:</b> Wednesday, June 19, 2013 11:23 PM<br>
<b>To:</b> <a href="mailto:cairo@cairographics.org" target="_blank">cairo@cairographics.org</a><br>
<b>Subject:</b> [cairo] Run Cairo with OpenGL ES 2 backend on Android</span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Hi.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<p class="MsoNormal">Have anyone tried to run Cairo with OpenGL ES 2 backend on Android? Is there any crash? How's the speed?<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
I've created a project here (branch master: image backend, cairogles branch: OpenGL ES 2 backend):<br>
<a href="https://github.com/ngocdaothanh/jsg" target="_blank">https://github.com/ngocdaothanh/jsg</a><u></u><u></u></p>
</div>
<p class="MsoNormal">Some basic results from the project above:<br>
<br>
OpenGL ES 2 backend:<u></u><u></u></p>
</div>
<p class="MsoNormal">* Crashes on Android 2.3, 4.0.2 etc. with shader compilation problem<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">* Doesn't crash on Android 4.1.1, but very very slow, 0.5 FPS/s<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Image backend is stable but slow, 12 FPS/s.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Ngoc<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>
</blockquote></div><br></div>