简体   繁体   English

在Android WebView中启用WebGL

[英]Enable WebGL in Android WebView

How to enable WebGL in WebView widget for Android 5.1.1 emulator? 如何在Android 5.1.1模拟器的WebView小部件中启用WebGL? I checked WebGL status through Webglreport and the result was "This browser supports WebGL, but it is disabled or unavailable. Sometimes this is the result of older video drivers being rejected by the browser. Try updating your video drivers if possible". 我通过Webglreport检查了WebGL状态,结果是“此浏览器支持WebGL,但它被禁用或不可用。有时这是因为浏览器拒绝旧视频驱动程序。如果可能,请尝试更新您的视频驱动程序”。

I also tried to use Crosswalk webview on Android 4.4.4 emulator and there were same problems, but I fixed it by adding xwalk-command-line xwalk --ignore-gpu-blacklist . 我也尝试在Android 4.4.4模拟器上使用Crosswalk webview并且存在同样的问题,但我通过添加xwalk-command-line xwalk --ignore-gpu-blacklist修复它。 Is it possible to make something similar for standard WebView widget? 是否可以为标准WebView小部件制作类似的东西?

UPDATE: The WebView team says WebView does not allow gpu blacklist override, now or in future plans, due to security/stability risks: more details . 更新:WebView团队表示,由于安全性/稳定性风险,WebView现在或未来计划中不允许gpu黑名单覆盖: 更多详细信息

// //

Chrome for Android 47 and Chromium/WebView 47 use different gpu blacklists and/or bug workarounds. 适用于Android 47和Chromium / WebView 47的Chrome使用不同的gpu黑名单和/或错误解决方法。 What is allowed to successfully render in one may not be allowed to successfully render in the other even on the same hardware. 即使在相同的硬件上,也可能不允许在一个中成功呈现的内容成功呈现。 Both browsers are scheduled to release updates to the Play Store every 6 weeks. 这两款浏览器都计划每6周发布一次Play商店的更新。

For example: I have a Nexus 10, Mali T-604 tablet (Lollipop 5.1.1. Also, Android Studio 1.5.1 with SDK 6.0 Marshmallow API 23 or 22). 例如:我有一台Nexus 10,Mali T-604平板电脑(Lollipop 5.1.1。另外,Android Studio 1.5.1配有SDK 6.0 Marshmallow API 23或22)。

In Chrome for Android -- 在适用于Android的Chrome中 -

  • chrome://flags, #ignore-gpu-blacklist NOT enabled, and all reset defaults chrome:// flags,#ignore-gpu-blacklist NOT enabled,以及所有重置默认值
  • chrome://gpu, "graphics feature status-WebGL: Hardware accelerated" and Reset notification strategy 0x0000 surprisingly (see this last Crosswalk related ) answer chrome:// gpu,“图形功能状态-WebGL:硬件加速”和重置通知策略0x0000令人惊讶(参见最后一次Crosswalk相关 )答案
  • webglreport, "This browser supports WebGL 1" webglreport,“此浏览器支持WebGL 1”
  • get.webgl.org, cube spins get.webgl.org,立方体旋转

In WebView -- 在WebView中 -

  • webglreport, "This browser supports WebGL 1, but it is disabled or unavailable. Sometimes this is the result of older video drivers being rejected by the browser. Try updating your video drivers if possible." webglreport,“此浏览器支持WebGL 1,但它已被禁用或不可用。有时这是因为旧版视频驱动程序被浏览器拒绝。如果可能,请尝试更新您的视频驱动程序。”
  • get.webgl.org, "Hmm. While your browser seems to support WebGL, it is disabled or unavailable. If possible, please ensure that you are running the latest drivers for your video card." get.webgl.org,“嗯。虽然您的浏览器似乎支持WebGL,但它已被禁用或不可用。如果可能,请确保您运行的是最新的视频卡驱动程序。”

chromium blacklist (link from Khronos WebGL blacklist wiki): "GPU rasterization and canvas is blacklisted on Nexus 10". 铬黑名单(链接来自Khronos WebGL黑名单wiki):“GPU光栅化和画布在Nexus 10上列入黑名单”。

chromium bug list (link from Khronos WebGL blacklist wiki): "The Mali-Txxx driver does not guarantee flush ordering" and "The Mali-Txxx driver hangs when reading from currently displayed buffer". 铬虫列表(来自Khronos WebGL黑名单wiki的链接):“Mali-Txxx驱动程序不保证刷新排序”和“从当前显示的缓冲区读取时Mali-Txxx驱动程序挂起”。

The Pixel C tablet has a Nvidia Tegra X1 which does not appear on the chromium lists, and I've confirmed that it does support WebGL in WebView . Pixel C平板电脑有一个Nvidia Tegra X1,它没有出现在铬列表中,我已经确认它确实支持WebView中的WebGL

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM