当前位置:   article > 正文

ARM64搭建CEF3记录_arm编译cef

arm编译cef

平台: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,改为自己的链接

  1. // Check if a "--url=" value was provided via the command-line. If so, use
  2. // that instead of the default URL.
  3. url = command_line->GetSwitchValue("url");
  4. if (url.empty()) {
  5. url = "https://stellarium-web.org/";
  6. }
  7. // Create the browser using the Views framework if "--use-views" is specified
  8. // via the command-line. Otherwise, create the browser using the native
  9. // platform framework.
  10. if (command_line->HasSwitch("use-views")) {
  11. // Create the BrowserView.
  12. CefRefPtr<CefBrowserView> browser_view = CefBrowserView::CreateBrowserView(
  13. handler, url, browser_settings, nullptr, nullptr,
  14. new SimpleBrowserViewDelegate());

在工程目录创建编译文件夹,cmake编译,由于cmake版本太低,所以要手动编译高版本的cmake

在arm上编译时要修改cef下的cmake/cef_variables.cmake,将文件内的“-m64”删除

  1. mkdir build
  2. cd build
  3. sudo apt install doxygen
  4. cmake ..
  5. 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的使用率也上来了

  1. cat /sys/devices/platform/fde60000.gpu/utilisation
  2. 57

如果还是不行就把cef3下的libEGL.so库拷贝到/usr/lib下重新测试,建议备份一下系统的EGL库

如果要实现无边框启动的网页,则要参考自身的Linux系统界面,修改启动边框时的参数

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/黑客灵魂/article/detail/912417
推荐阅读
相关标签
  

闽ICP备14008679号