[oe] [meta-browser][PATCH v3 4/4] chromium: Add ignore-lost-context PACKAGECONFIG option

Carlos Rafael Giani dv at pseudoterminal.org
Thu May 1 20:36:10 UTC 2014


Accelerating the HTML5 canvas element rendering with OpenGL ES is tricky,
because an EGL context can get lost with some drivers. Since pages using
canvas assume they can paint into the canvas and the pixels inside will
never vanish, this is a problem. Workarounds like periodic snapshots are
being considered. The WHATWG discussion about this problem can be found at:
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-September/206450.html

Until then, one has to choose: either no acceleration and full standards
compliance, or acceleration and potentially lost pixels.

Using this PACKAGECONFIG chooses the second option.

Signed-off-by: Carlos Rafael Giani <dv at pseudoterminal.org>
---
 .../remove-linux-accel-canvas-from-blacklist.patch | 32 ++++++++++++++++++++++
 recipes-browser/chromium/chromium_35.0.1883.0.bb   |  2 ++
 2 files changed, 34 insertions(+)
 create mode 100644 recipes-browser/chromium/chromium/remove-linux-accel-canvas-from-blacklist.patch

diff --git a/recipes-browser/chromium/chromium/remove-linux-accel-canvas-from-blacklist.patch b/recipes-browser/chromium/chromium/remove-linux-accel-canvas-from-blacklist.patch
new file mode 100644
index 0000000..635e563
--- /dev/null
+++ b/recipes-browser/chromium/chromium/remove-linux-accel-canvas-from-blacklist.patch
@@ -0,0 +1,32 @@
+Together with the --gpu-no-context-lost command line switch, this patch is
+necessary to enable hardware accelerated 2D canvas rendering when using
+EGL.
+
+Note the implications on the behavior of Canvas, in particular with lost
+contexts, as discussed here:
+
+http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-September/206450.html
+
+Upstream-Status: Inappropiate [see link above]
+
+diff --git a/gpu/config/software_rendering_list_json.cc b/gpu/config/software_rendering_list_json.cc
+index 35060a9..4bd6ef5 100644
+--- a/gpu/config/software_rendering_list_json.cc
++++ b/gpu/config/software_rendering_list_json.cc
+@@ -232,16 +232,6 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
+       ]
+     },
+     {
+-      "id": 24,
+-      "description": "Accelerated 2d canvas is unstable in Linux at the moment",
+-      "os": {
+-        "type": "linux"
+-      },
+-      "features": [
+-        "accelerated_2d_canvas"
+-      ]
+-    },
+-    {
+       "id": 27,
+       "description": "ATI/AMD cards with older drivers in Linux are crash-prone",
+       "cr_bugs": [95934, 94973, 136240],
diff --git a/recipes-browser/chromium/chromium_35.0.1883.0.bb b/recipes-browser/chromium/chromium_35.0.1883.0.bb
index dcc990f..a9071e7 100644
--- a/recipes-browser/chromium/chromium_35.0.1883.0.bb
+++ b/recipes-browser/chromium/chromium_35.0.1883.0.bb
@@ -7,6 +7,7 @@ SRC_URI = "\
         file://include.gypi \
         file://oe-defaults.gypi \
         ${@bb.utils.contains('PACKAGECONFIG', 'component-build', 'file://component-build.gypi', '', d)} \
+        ${@bb.utils.contains('PACKAGECONFIG', 'ignore-lost-context', 'file://remove-linux-accel-canvas-from-blacklist.patch', '', d)} \
         file://unistd-2.patch \
         file://google-chrome \
         file://google-chrome.desktop \
@@ -39,6 +40,7 @@ ARMFPABI_armv7a = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard',
 
 CHROMIUM_EXTRA_ARGS ?= " \
 	${@bb.utils.contains('PACKAGECONFIG', 'use-egl', '--use-gl=egl', '', d)} \
+	${@bb.utils.contains('PACKAGECONFIG', 'ignore-lost-context', '--gpu-no-context-lost', '', d)} \
 "
 
 export GYP_DEFINES="${ARMFPABI} release_extra_cflags='-Wno-error=unused-local-typedefs' sysroot=''"
-- 
1.8.3.2




More information about the Openembedded-devel mailing list