Patchwork [meta-browser,3/4] Add use-egl PACKAGECONFIG to let chromium use EGL automatically

login
register
mail settings
Submitter dv
Date April 27, 2014, 11:21 a.m.
Message ID <1398597711-17825-4-git-send-email-dv@pseudoterminal.org>
Download mbox | patch
Permalink /patch/71101/
State New, archived
Headers show

Comments

dv - April 27, 2014, 11:21 a.m.
By default, Chromium will try to use GLX and regular OpenGL. On embedded
platforms, these are often not present, or unaccelerated, and using EGL
and OpenGL ES instead makes more sense. To produce builds that use EGL and
OpenGL ES by default instead, this PACKAGECONFIG option can be used.

An EGL/OpenGLES-enabled build produces a chromium version that renders
2D and WebGL with GPU acceleration (if present).

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
---
 recipes-browser/chromium/chromium_35.0.1883.0.bb | 7 +++++++
 1 file changed, 7 insertions(+)
Otavio Salvador - April 28, 2014, 3:14 p.m.
Hello Carlos,

On Sun, Apr 27, 2014 at 8:21 AM, Carlos Rafael Giani
<dv@pseudoterminal.org> wrote:
> By default, Chromium will try to use GLX and regular OpenGL. On embedded
> platforms, these are often not present, or unaccelerated, and using EGL
> and OpenGL ES instead makes more sense. To produce builds that use EGL and
> OpenGL ES by default instead, this PACKAGECONFIG option can be used.
>
> An EGL/OpenGLES-enabled build produces a chromium version that renders
> 2D and WebGL with GPU acceleration (if present).
>
> Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
> ---
>  recipes-browser/chromium/chromium_35.0.1883.0.bb | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/recipes-browser/chromium/chromium_35.0.1883.0.bb b/recipes-browser/chromium/chromium_35.0.1883.0.bb
> index 080282b..d0495d8 100644
> --- a/recipes-browser/chromium/chromium_35.0.1883.0.bb
> +++ b/recipes-browser/chromium/chromium_35.0.1883.0.bb
...
> +python __anonymous() {
> +    pkgconfig = d.getVar('PACKAGECONFIG', True)
> +    if 'use-egl' in pkgconfig.split():
> +        d.appendVar("DEPENDS", " virtual/egl virtual/libgles2")
> +}

This is not need. You can add it in the PACKAGECONFIG third param so
it includes this dependencies for build.

Patch

diff --git a/recipes-browser/chromium/chromium_35.0.1883.0.bb b/recipes-browser/chromium/chromium_35.0.1883.0.bb
index 080282b..d0495d8 100644
--- a/recipes-browser/chromium/chromium_35.0.1883.0.bb
+++ b/recipes-browser/chromium/chromium_35.0.1883.0.bb
@@ -34,8 +34,15 @@  EXTRA_OEGYP =	" \
 ARMFPABI_armv7a = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'arm_float_abi=hard', 'arm_float_abi=softfp', d)}"
 
 CHROMIUM_EXTRA_ARGS = " \
+	${@bb.utils.contains('PACKAGECONFIG', 'use-egl', '--use-gl=egl', '', d)} \
 "
 
+python __anonymous() {
+    pkgconfig = d.getVar('PACKAGECONFIG', True)
+    if 'use-egl' in pkgconfig.split():
+        d.appendVar("DEPENDS", " virtual/egl virtual/libgles2")
+}
+
 export GYP_DEFINES="${ARMFPABI} release_extra_cflags='-Wno-error=unused-local-typedefs' sysroot=''"
 do_configure() {
 	cd ${S}