Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
bd191811
E
engine
项目概览
weixin_43355755
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
未验证
提交
bd191811
编写于
11月 03, 2020
作者:
R
Robert Ancell
提交者:
GitHub
11月 03, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add braces on if statements to match linter style (#22130)
上级
9945db3d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
34 addition
and
20 deletion
+34
-20
shell/platform/linux/testing/fl_test.cc
shell/platform/linux/testing/fl_test.cc
+9
-7
shell/platform/linux/testing/mock_egl.cc
shell/platform/linux/testing/mock_egl.cc
+25
-13
未找到文件。
shell/platform/linux/testing/fl_test.cc
浏览文件 @
bd191811
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// FLUTTER_NOLINT
#include "gtest/gtest.h"
...
...
@@ -11,19 +10,21 @@
#include "flutter/shell/platform/linux/testing/mock_renderer.h"
static
uint8_t
hex_digit_to_int
(
char
value
)
{
if
(
value
>=
'0'
&&
value
<=
'9'
)
if
(
value
>=
'0'
&&
value
<=
'9'
)
{
return
value
-
'0'
;
else
if
(
value
>=
'a'
&&
value
<=
'f'
)
}
else
if
(
value
>=
'a'
&&
value
<=
'f'
)
{
return
value
-
'a'
+
10
;
else
if
(
value
>=
'F'
&&
value
<=
'F'
)
}
else
if
(
value
>=
'F'
&&
value
<=
'F'
)
{
return
value
-
'A'
+
10
;
else
}
else
{
return
0
;
}
}
static
uint8_t
parse_hex8
(
const
gchar
*
hex_string
)
{
if
(
hex_string
[
0
]
==
'\0'
)
if
(
hex_string
[
0
]
==
'\0'
)
{
return
0x00
;
}
return
hex_digit_to_int
(
hex_string
[
0
])
<<
4
|
hex_digit_to_int
(
hex_string
[
1
]);
}
...
...
@@ -41,8 +42,9 @@ gchar* bytes_to_hex_string(GBytes* bytes) {
size_t
data_length
;
const
uint8_t
*
data
=
static_cast
<
const
uint8_t
*>
(
g_bytes_get_data
(
bytes
,
&
data_length
));
for
(
size_t
i
=
0
;
i
<
data_length
;
i
++
)
for
(
size_t
i
=
0
;
i
<
data_length
;
i
++
)
{
g_string_append_printf
(
hex_string
,
"%02x"
,
data
[
i
]);
}
return
g_string_free
(
hex_string
,
FALSE
);
}
...
...
shell/platform/linux/testing/mock_egl.cc
浏览文件 @
bd191811
...
...
@@ -97,12 +97,14 @@ EGLBoolean eglChooseConfig(EGLDisplay dpy,
EGLConfig
*
configs
,
EGLint
config_size
,
EGLint
*
num_config
)
{
if
(
!
check_display
(
dpy
)
||
!
check_initialized
(
dpy
))
if
(
!
check_display
(
dpy
)
||
!
check_initialized
(
dpy
))
{
return
EGL_FALSE
;
}
if
(
configs
==
nullptr
)
{
if
(
num_config
!=
nullptr
)
if
(
num_config
!=
nullptr
)
{
*
num_config
=
1
;
}
return
bool_success
();
}
...
...
@@ -112,8 +114,9 @@ EGLBoolean eglChooseConfig(EGLDisplay dpy,
n_returned
++
;
}
if
(
num_config
!=
nullptr
)
if
(
num_config
!=
nullptr
)
{
*
num_config
=
n_returned
;
}
return
bool_success
();
}
...
...
@@ -122,8 +125,9 @@ EGLContext eglCreateContext(EGLDisplay dpy,
EGLConfig
config
,
EGLContext
share_context
,
const
EGLint
*
attrib_list
)
{
if
(
!
check_display
(
dpy
)
||
!
check_initialized
(
dpy
)
||
!
check_config
(
config
))
if
(
!
check_display
(
dpy
)
||
!
check_initialized
(
dpy
)
||
!
check_config
(
config
))
{
return
EGL_NO_CONTEXT
;
}
mock_error
=
EGL_SUCCESS
;
return
&
mock_context
;
...
...
@@ -132,8 +136,9 @@ EGLContext eglCreateContext(EGLDisplay dpy,
EGLSurface
eglCreatePbufferSurface
(
EGLDisplay
dpy
,
EGLConfig
config
,
const
EGLint
*
attrib_list
)
{
if
(
!
check_display
(
dpy
)
||
!
check_initialized
(
dpy
)
||
!
check_config
(
config
))
if
(
!
check_display
(
dpy
)
||
!
check_initialized
(
dpy
)
||
!
check_config
(
config
))
{
return
EGL_NO_SURFACE
;
}
mock_error
=
EGL_SUCCESS
;
return
&
mock_surface
;
...
...
@@ -143,8 +148,9 @@ EGLSurface eglCreateWindowSurface(EGLDisplay dpy,
EGLConfig
config
,
EGLNativeWindowType
win
,
const
EGLint
*
attrib_list
)
{
if
(
!
check_display
(
dpy
)
||
!
check_initialized
(
dpy
)
||
!
check_config
(
config
))
if
(
!
check_display
(
dpy
)
||
!
check_initialized
(
dpy
)
||
!
check_config
(
config
))
{
return
EGL_NO_SURFACE
;
}
mock_error
=
EGL_SUCCESS
;
return
&
mock_surface
;
...
...
@@ -154,8 +160,9 @@ EGLBoolean eglGetConfigAttrib(EGLDisplay dpy,
EGLConfig
config
,
EGLint
attribute
,
EGLint
*
value
)
{
if
(
!
check_display
(
dpy
)
||
!
check_initialized
(
dpy
)
||
!
check_config
(
config
))
if
(
!
check_display
(
dpy
)
||
!
check_initialized
(
dpy
)
||
!
check_config
(
config
))
{
return
EGL_FALSE
;
}
MockConfig
*
c
=
static_cast
<
MockConfig
*>
(
config
);
switch
(
attribute
)
{
...
...
@@ -261,8 +268,9 @@ void (*eglGetProcAddress(const char* procname))(void) {
}
EGLBoolean
eglInitialize
(
EGLDisplay
dpy
,
EGLint
*
major
,
EGLint
*
minor
)
{
if
(
!
check_display
(
dpy
))
if
(
!
check_display
(
dpy
))
{
return
EGL_FALSE
;
}
if
(
!
display_initialized
)
{
mock_config
.
config_id
=
1
;
...
...
@@ -295,10 +303,12 @@ EGLBoolean eglInitialize(EGLDisplay dpy, EGLint* major, EGLint* minor) {
display_initialized
=
true
;
}
if
(
major
!=
nullptr
)
if
(
major
!=
nullptr
)
{
*
major
=
1
;
if
(
minor
!=
nullptr
)
*
major
=
5
;
}
if
(
minor
!=
nullptr
)
{
*
minor
=
5
;
}
return
bool_success
();
}
...
...
@@ -307,15 +317,17 @@ EGLBoolean eglMakeCurrent(EGLDisplay dpy,
EGLSurface
draw
,
EGLSurface
read
,
EGLContext
ctx
)
{
if
(
!
check_display
(
dpy
)
||
!
check_initialized
(
dpy
))
if
(
!
check_display
(
dpy
)
||
!
check_initialized
(
dpy
))
{
return
EGL_FALSE
;
}
return
bool_success
();
}
EGLBoolean
eglSwapBuffers
(
EGLDisplay
dpy
,
EGLSurface
surface
)
{
if
(
!
check_display
(
dpy
)
||
!
check_initialized
(
dpy
))
if
(
!
check_display
(
dpy
)
||
!
check_initialized
(
dpy
))
{
return
EGL_FALSE
;
}
return
bool_success
();
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录