Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
d2ea378b
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
d2ea378b
编写于
10月 14, 2020
作者:
G
gaaclarke
提交者:
GitHub
10月 14, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Explicitly make the X connection for EGL. (#21831)" (#21851)
This reverts commit
516cbaee
.
上级
516cbaee
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
32 deletion
+9
-32
shell/platform/linux/BUILD.gn
shell/platform/linux/BUILD.gn
+0
-2
shell/platform/linux/config/BUILD.gn
shell/platform/linux/config/BUILD.gn
+4
-2
shell/platform/linux/fl_renderer_x11.cc
shell/platform/linux/fl_renderer_x11.cc
+5
-28
未找到文件。
shell/platform/linux/BUILD.gn
浏览文件 @
d2ea378b
...
...
@@ -129,7 +129,6 @@ source_set("flutter_linux") {
"//flutter/shell/platform/linux/config:gtk",
"//flutter/shell/platform/linux/config:egl",
"//flutter/shell/platform/linux/config:wayland-egl",
"//flutter/shell/platform/linux/config:x11",
"//third_party/khronos:khronos_headers",
]
...
...
@@ -173,7 +172,6 @@ executable("flutter_linux_unittests") {
configs += [
"//flutter/shell/platform/linux/config:gtk",
"//flutter/shell/platform/linux/config:wayland-egl",
"//flutter/shell/platform/linux/config:x11",
]
# Set flag to allow public headers to be directly included (library users should not do this)
...
...
shell/platform/linux/config/BUILD.gn
浏览文件 @
d2ea378b
...
...
@@ -5,8 +5,10 @@
import("//build/config/linux/pkg_config.gni")
import("//flutter/shell/platform/glfw/config.gni")
pkg_config("x11") {
packages = [ "x11" ]
if (build_glfw_shell) {
pkg_config("x11") {
packages = [ "x11" ]
}
}
pkg_config("gtk") {
...
...
shell/platform/linux/fl_renderer_x11.cc
浏览文件 @
d2ea378b
...
...
@@ -5,30 +5,14 @@
#include "fl_renderer_x11.h"
#ifdef GDK_WINDOWING_X11
#include <X11/X.h>
#include "flutter/shell/platform/linux/egl_utils.h"
struct
_FlRendererX11
{
FlRenderer
parent_instance
;
// Connection to the X server.
Display
*
display
;
};
G_DEFINE_TYPE
(
FlRendererX11
,
fl_renderer_x11
,
fl_renderer_get_type
())
static
void
fl_renderer_x11_dispose
(
GObject
*
object
)
{
FlRendererX11
*
self
=
FL_RENDERER_X11
(
object
);
if
(
self
->
display
!=
nullptr
)
{
XCloseDisplay
(
self
->
display
);
self
->
display
=
nullptr
;
}
G_OBJECT_CLASS
(
fl_renderer_x11_parent_class
)
->
dispose
(
object
);
}
// Implements FlRenderer::setup_window_attr.
static
gboolean
fl_renderer_x11_setup_window_attr
(
FlRenderer
*
renderer
,
...
...
@@ -66,17 +50,11 @@ static gboolean fl_renderer_x11_setup_window_attr(
// Implements FlRenderer::create_display.
static
EGLDisplay
fl_renderer_x11_create_display
(
FlRenderer
*
renderer
)
{
FlRendererX11
*
self
=
FL_RENDERER_X11
(
renderer
);
// Create a dedicated connection to the X server because the EGL calls are
// made from Flutter on a different thread to GTK. Re-using the existing
// GTK X11 connection would crash as Xlib is not thread safe.
if
(
self
->
display
==
nullptr
)
{
Display
*
display
=
gdk_x11_get_default_xdisplay
();
self
->
display
=
XOpenDisplay
(
DisplayString
(
display
));
}
return
eglGetDisplay
(
self
->
display
);
// Note the use of EGL_DEFAULT_DISPLAY rather than sharing the existing
// display connection from GTK. This is because this EGL display is going to
// be accessed by a thread from Flutter. The GTK/X11 display connection is not
// thread safe and would cause a crash.
return
eglGetDisplay
(
EGL_DEFAULT_DISPLAY
);
}
// Implements FlRenderer::create_surfaces.
...
...
@@ -121,7 +99,6 @@ static gboolean fl_renderer_x11_create_surfaces(FlRenderer* renderer,
}
static
void
fl_renderer_x11_class_init
(
FlRendererX11Class
*
klass
)
{
G_OBJECT_CLASS
(
klass
)
->
dispose
=
fl_renderer_x11_dispose
;
FL_RENDERER_CLASS
(
klass
)
->
setup_window_attr
=
fl_renderer_x11_setup_window_attr
;
FL_RENDERER_CLASS
(
klass
)
->
create_display
=
fl_renderer_x11_create_display
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录