Is it possible to enable hardware rendering for android webview shell?

468 views
Skip to first unread message

류인상

unread,
Jun 25, 2014, 10:54:11 PM6/25/14
to chromi...@chromium.org
https://code.google.com/p/chromium/wiki/AndroidBuildInstructions page saids

"The WebView shell is a view with a URL bar at the top (seecode) and is independent of the WebView implementation in the Android system (the WebView shell is essentially a standalone unbundled app). As drawback, the shell runs in software rendering mode only."


Is it possible to enable hardware rendering with reasonable effort?

Thank you for reading.

Bo Liu

unread,
Jun 26, 2014, 12:02:25 AM6/26/14
to ryu.i...@gmail.com, chromium-dev
I've seen some external project got it working on older chromium code, so it's not impossible. But I don't know the exact details, and the code has changed significantly since.

Android webview hardware acceleration requires two private APIs not available to regular apps, draw functor and gpu buffers (gralloc). You can start with this header file and see where it's used: https://code.google.com/p/chromium/codesearch#chromium/src/android_webview/public/browser/draw_gl.h

You can turn off gpu buffers by removing kEnableZeroCopy flag. It should work but it's an untested/unmaintained path.

You'll have to fake your own implementation of draw functor though. No way around that.


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

류인상

unread,
Jun 26, 2014, 3:14:38 AM6/26/14
to chromi...@chromium.org, ryu.i...@gmail.com, bo...@chromium.org

Thank you for your help.

Anyway, I believe Content Shell uses hardware rendering. Can someone tell me what  is the difference?


2014년 6월 26일 목요일 오후 1시 2분 25초 UTC+9, Bo Liu 님의 말:

Bo Liu

unread,
Jun 26, 2014, 11:51:57 AM6/26/14
to 류인상, chromium-dev
Webview has a different graphics architecture from content shell/chrome on android, due to webviews-specific requirements. Chrome and content shell has the architecture which uses SurfaceViews.

There is the original webview design doc which has background (it's linked from here). I'm also starting a doc of a list of differences between webview and chrome graphics, but it's only ~10% done.

류인상

unread,
Jun 27, 2014, 5:19:15 AM6/27/14
to chromi...@chromium.org, ryu.i...@gmail.com, bo...@chromium.org
Thank you again.

2014년 6월 27일 금요일 오전 12시 51분 57초 UTC+9, Bo Liu 님의 말:
Reply all
Reply to author
Forward
0 new messages