赞
踩
平台:ARM64
SoC型号:RK3568
搭建CEF3开发环境,解决了CEF3启动的网页启用GPU渲染的问题
GitHub开源网址
CEF WiKi
chromiumembedded / cef / wiki / BranchesAndBuilding — Bitbucket
CEF3文档中文翻译
cefutil/doc/CEF General Usage.md at master · fanfeilong/cefutil · GitHub
Linux搭建环境要求
What's Required
- Linux Build Requirements as listed on the BranchesAndBuilding Wiki page.
- Building with other versions or distros has not been tested and may experience issues.
- At least 16GB of RAM (32GB+ recommended) and 120GB of free disk space (for a Debug build).
- Approximately 4 hours with a fast internet connection (100Mbps) and fast build machine (2.4Ghz, 16 logical cores, SSD).
搭建要求参考
chromiumembedded / cef / wiki / MasterBuildQuickStart — Bitbucket
测试官网的编译流程,因为网络原因无法正常下载源码
尝试别的方法获取cef3工程
参考文章
cef3 Binary Distributions下载及示例编译_cef_binary-CSDN博客
cef工程获取链接
先下载测试了cef Linux_x86版本(Ubuntu环境下)
在sample_app.cc中修改url,改为自己的链接
- // Check if a "--url=" value was provided via the command-line. If so, use
- // that instead of the default URL.
- url = command_line->GetSwitchValue("url");
- if (url.empty()) {
- url = "https://stellarium-web.org/";
- }
- // Create the browser using the Views framework if "--use-views" is specified
- // via the command-line. Otherwise, create the browser using the native
- // platform framework.
- if (command_line->HasSwitch("use-views")) {
- // Create the BrowserView.
- CefRefPtr<CefBrowserView> browser_view = CefBrowserView::CreateBrowserView(
- handler, url, browser_settings, nullptr, nullptr,
- new SimpleBrowserViewDelegate());
在工程目录创建编译文件夹,cmake编译,由于cmake版本太低,所以要手动编译高版本的cmake
在arm上编译时要修改cef下的cmake/cef_variables.cmake,将文件内的“-m64”删除
- mkdir build
- cd build
- sudo apt install doxygen
- cmake ..
- make
在build/tests/cefclient/Release/下运行
./cefclient
可以成功打开网页
测试在LinuxARM64运行工程
在链接里下载client版本,这个是编译完可以直接运行的
在开发板上运行是没有GPU支持的
尝试手动编译cef源码,看看是否有打开gpu的选项设置
RK3568的GPU不是OpenGL,而是egl,在启动cef3时,直接将进程后的参数给带上
./cefsimple --use-gl=egl --no-sandbox
测试实际情况,效果与原生浏览器一致,查看GPU的使用率也上来了
- cat /sys/devices/platform/fde60000.gpu/utilisation
- 57
如果还是不行就把cef3下的libEGL.so库拷贝到/usr/lib下重新测试,建议备份一下系统的EGL库
如果要实现无边框启动的网页,则要参考自身的Linux系统界面,修改启动边框时的参数
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。