ARM64搭建CEF3记录

平台:ARM64

SoC型号:RK3568

搭建CEF3开发环境,解决了CEF3启动的网页启用GPU渲染的问题

GitHub开源网址

GitHub - chromiumembedded/cef: Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.

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 Automated Builds

先下载测试了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版本,这个是编译完可以直接运行的

CEF Automated Builds

在开发板上运行是没有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系统界面,修改启动边框时的参数

  • 6
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值