Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
anbox
提交
dd481367
A
anbox
项目概览
openeuler
/
anbox
通知
24
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
anbox
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
dd481367
编写于
9月 29, 2016
作者:
S
Simon Fels
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve eglGetString processing to exclude certain not support extensions
上级
5daf631b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
40 addition
and
42 deletion
+40
-42
external/android-emugl/host/libs/libOpenglRender/RenderControl.cpp
...android-emugl/host/libs/libOpenglRender/RenderControl.cpp
+40
-42
未找到文件。
external/android-emugl/host/libs/libOpenglRender/RenderControl.cpp
浏览文件 @
dd481367
...
...
@@ -66,54 +66,52 @@ static EGLint rcQueryEGLString(EGLenum name, void* buffer, EGLint bufferSize)
static
EGLint
rcGetGLString
(
EGLenum
name
,
void
*
buffer
,
EGLint
bufferSize
)
{
RenderThreadInfo
*
tInfo
=
RenderThreadInfo
::
get
();
const
char
*
str
=
NULL
;
int
len
=
0
;
if
(
tInfo
&&
tInfo
->
currContext
.
Ptr
())
{
if
(
tInfo
->
currContext
->
isGL2
())
{
str
=
(
const
char
*
)
s_gles2
.
glGetString
(
name
);
}
else
{
str
=
(
const
char
*
)
s_gles1
.
glGetString
(
name
);
}
if
(
str
)
{
len
=
strlen
(
str
)
+
1
;
}
}
std
::
string
result
;
// We add the maximum supported GL protocol number into GL_EXTENSIONS
const
char
*
glProtocolStr
=
NULL
;
if
(
name
==
GL_EXTENSIONS
)
{
glProtocolStr
=
ChecksumCalculatorThreadInfo
::
getMaxVersionString
();
if
(
len
==
0
)
len
=
1
;
// the last byte
len
+=
strlen
(
glProtocolStr
)
+
1
;
}
if
(
tInfo
&&
tInfo
->
currContext
)
{
const
char
*
str
=
nullptr
;
if
(
tInfo
->
currContext
->
isGL2
())
str
=
reinterpret_cast
<
const
char
*>
(
s_gles2
.
glGetString
(
name
));
else
str
=
reinterpret_cast
<
const
char
*>
(
s_gles1
.
glGetString
(
name
));
if
(
name
==
GL_VERSION
)
{
// We're forcing version 2.0 no matter what the host provides as
// our emulation layer isn't prepared for anything newer (yet).
// This goes in parallel with filtering the extension set for
// any unwanted extensions. If we don't force the right version
// here certain parts of the system will assume API conditions
// which aren't met.
static
const
char
*
version
=
"OpenGL ES 2.0"
;
str
=
version
;
len
=
strlen
(
str
)
+
1
;
}
if
(
!
buffer
||
len
>
bufferSize
)
{
return
-
len
;
if
(
str
)
result
+=
str
;
}
if
(
name
==
GL_EXTENSIONS
)
{
snprintf
((
char
*
)
buffer
,
bufferSize
,
"%s%s "
,
str
?
str
:
""
,
glProtocolStr
);
}
else
if
(
str
)
{
strcpy
((
char
*
)
buffer
,
str
);
}
else
{
if
(
bufferSize
>=
1
)
{
((
char
*
)
buffer
)[
0
]
=
'\0'
;
// We're forcing version 2.0 no matter what the host provides as
// our emulation layer isn't prepared for anything newer (yet).
// This goes in parallel with filtering the extension set for
// any unwanted extensions. If we don't force the right version
// here certain parts of the system will assume API conditions
// which aren't met.
if
(
name
==
GL_VERSION
)
result
=
"OpenGL ES 2.0"
;
else
if
(
name
==
GL_EXTENSIONS
)
{
std
::
string
approved_extensions
=
result
;
std
::
vector
<
std
::
string
>
unsupported_extensions
=
{
// Leaving this enabled gives crippeled text rendering when
// using the host mesa GLES drivers.
"GL_EXT_unpack_subimage"
,
};
for
(
const
auto
&
extension
:
unsupported_extensions
)
{
size_t
start_pos
=
approved_extensions
.
find
(
extension
);
if
(
start_pos
==
std
::
string
::
npos
)
continue
;
approved_extensions
.
replace
(
start_pos
,
extension
.
length
(),
""
);
}
len
=
0
;
result
=
approved_extensions
;
}
return
len
;
int
nextBufferSize
=
result
.
size
()
+
1
;
if
(
!
buffer
||
nextBufferSize
>
bufferSize
)
return
-
nextBufferSize
;
snprintf
(
static_cast
<
char
*>
(
buffer
),
nextBufferSize
,
"%s"
,
result
.
c_str
());
return
nextBufferSize
;
}
static
EGLint
rcGetNumConfigs
(
uint32_t
*
p_numAttribs
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录