Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
anbox
提交
aeff6e35
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,发现更多精彩内容 >>
提交
aeff6e35
编写于
12月 21, 2016
作者:
S
Simon Fels
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cleanup formatting and code style
上级
3e70f5a5
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
38 addition
and
41 deletion
+38
-41
android/service/local_socket_connection.cpp
android/service/local_socket_connection.cpp
+6
-0
android/service/local_socket_connection.h
android/service/local_socket_connection.h
+1
-0
src/anbox/graphics/emugl/RenderControl.cpp
src/anbox/graphics/emugl/RenderControl.cpp
+16
-6
src/anbox/graphics/emugl/RenderThread.cpp
src/anbox/graphics/emugl/RenderThread.cpp
+14
-32
src/anbox/graphics/emugl/RenderThreadInfo.cpp
src/anbox/graphics/emugl/RenderThreadInfo.cpp
+1
-3
未找到文件。
android/service/local_socket_connection.cpp
浏览文件 @
aeff6e35
...
@@ -75,4 +75,10 @@ void LocalSocketConnection::send(char const* data, size_t length) {
...
@@ -75,4 +75,10 @@ void LocalSocketConnection::send(char const* data, size_t length) {
bytes_written
+=
result
;
bytes_written
+=
result
;
}
}
}
}
ssize_t
LocalSocketConnection
::
send_raw
(
char
const
*
data
,
size_t
length
)
{
(
void
)
data
;
(
void
)
length
;
return
-
EIO
;
}
}
// namespace anbox
}
// namespace anbox
android/service/local_socket_connection.h
浏览文件 @
aeff6e35
...
@@ -32,6 +32,7 @@ public:
...
@@ -32,6 +32,7 @@ public:
ssize_t
read_all
(
std
::
uint8_t
*
buffer
,
const
size_t
&
size
);
ssize_t
read_all
(
std
::
uint8_t
*
buffer
,
const
size_t
&
size
);
void
send
(
char
const
*
data
,
size_t
length
)
override
;
void
send
(
char
const
*
data
,
size_t
length
)
override
;
ssize_t
send_raw
(
char
const
*
data
,
size_t
length
)
override
;
private:
private:
Fd
fd_
;
Fd
fd_
;
...
...
src/anbox/graphics/emugl/RenderControl.cpp
浏览文件 @
aeff6e35
...
@@ -363,30 +363,36 @@ static void rcSelectChecksumCalculator(uint32_t protocol, uint32_t reserved) {
...
@@ -363,30 +363,36 @@ static void rcSelectChecksumCalculator(uint32_t protocol, uint32_t reserved) {
ChecksumCalculatorThreadInfo
::
setVersion
(
protocol
);
ChecksumCalculatorThreadInfo
::
setVersion
(
protocol
);
}
}
int
rcGetNumDisplays
()
{
return
1
;
}
int
rcGetNumDisplays
()
{
// For now we only support a single display but that single display
// will contain more than one display so that we simply spawn up a big
// virtual display which should match the real display arrangement
// in most cases.
return
1
;
}
int
rcGetDisplayWidth
(
uint32_t
display_id
)
{
int
rcGetDisplayWidth
(
uint32_t
display_id
)
{
printf
(
"%s: display_id=%d
\n
"
,
__func__
,
display_id
)
;
(
void
)
display_id
;
return
DisplayManager
::
get
()
->
display_info
().
horizontal_resolution
;
return
DisplayManager
::
get
()
->
display_info
().
horizontal_resolution
;
}
}
int
rcGetDisplayHeight
(
uint32_t
display_id
)
{
int
rcGetDisplayHeight
(
uint32_t
display_id
)
{
printf
(
"%s: display_id=%d
\n
"
,
__func__
,
display_id
)
;
(
void
)
display_id
;
return
DisplayManager
::
get
()
->
display_info
().
vertical_resolution
;
return
DisplayManager
::
get
()
->
display_info
().
vertical_resolution
;
}
}
int
rcGetDisplayDpiX
(
uint32_t
display_id
)
{
int
rcGetDisplayDpiX
(
uint32_t
display_id
)
{
printf
(
"%s: display_id=%d
\n
"
,
__func__
,
display_id
)
;
(
void
)
display_id
;
return
120
;
return
120
;
}
}
int
rcGetDisplayDpiY
(
uint32_t
display_id
)
{
int
rcGetDisplayDpiY
(
uint32_t
display_id
)
{
printf
(
"%s: display_id=%d
\n
"
,
__func__
,
display_id
)
;
(
void
)
display_id
;
return
120
;
return
120
;
}
}
int
rcGetDisplayVsyncPeriod
(
uint32_t
display_id
)
{
int
rcGetDisplayVsyncPeriod
(
uint32_t
display_id
)
{
printf
(
"%s: display_id=%d
\n
"
,
__func__
,
display_id
)
;
(
void
)
display_id
;
return
1
;
return
1
;
}
}
...
@@ -394,6 +400,10 @@ static std::vector<Renderable> frame_layers;
...
@@ -394,6 +400,10 @@ static std::vector<Renderable> frame_layers;
bool
is_layer_blacklisted
(
const
std
::
string
&
name
)
{
bool
is_layer_blacklisted
(
const
std
::
string
&
name
)
{
static
std
::
vector
<
std
::
string
>
blacklist
=
{
static
std
::
vector
<
std
::
string
>
blacklist
=
{
// The 'Sprite' layer is the mouse cursor Android uses as soon
// as it has a pointer input device available. We don't want to
// display this layer at all but don't have a good way of disabling
// the cursor on the Android side yet.
"Sprite"
,
"Sprite"
,
};
};
return
std
::
find
(
blacklist
.
begin
(),
blacklist
.
end
(),
name
)
!=
blacklist
.
end
();
return
std
::
find
(
blacklist
.
begin
(),
blacklist
.
end
(),
name
)
!=
blacklist
.
end
();
...
...
src/anbox/graphics/emugl/RenderThread.cpp
浏览文件 @
aeff6e35
...
@@ -26,6 +26,8 @@
...
@@ -26,6 +26,8 @@
#include "OpenGLESDispatch/GLESv1Dispatch.h"
#include "OpenGLESDispatch/GLESv1Dispatch.h"
#include "OpenGLESDispatch/GLESv2Dispatch.h"
#include "OpenGLESDispatch/GLESv2Dispatch.h"
#include "anbox/logger.h"
#define STREAM_BUFFER_SIZE 4 * 1024 * 1024
#define STREAM_BUFFER_SIZE 4 * 1024 * 1024
RenderThread
::
RenderThread
(
IOStream
*
stream
,
emugl
::
Mutex
*
lock
)
RenderThread
::
RenderThread
(
IOStream
*
stream
,
emugl
::
Mutex
*
lock
)
...
@@ -33,7 +35,6 @@ RenderThread::RenderThread(IOStream *stream, emugl::Mutex *lock)
...
@@ -33,7 +35,6 @@ RenderThread::RenderThread(IOStream *stream, emugl::Mutex *lock)
RenderThread
::~
RenderThread
()
{}
RenderThread
::~
RenderThread
()
{}
// static
RenderThread
*
RenderThread
::
create
(
IOStream
*
stream
,
emugl
::
Mutex
*
lock
)
{
RenderThread
*
RenderThread
::
create
(
IOStream
*
stream
,
emugl
::
Mutex
*
lock
)
{
return
new
RenderThread
(
stream
,
lock
);
return
new
RenderThread
(
stream
,
lock
);
}
}
...
@@ -41,54 +42,40 @@ RenderThread *RenderThread::create(IOStream *stream, emugl::Mutex *lock) {
...
@@ -41,54 +42,40 @@ RenderThread *RenderThread::create(IOStream *stream, emugl::Mutex *lock) {
void
RenderThread
::
forceStop
()
{
m_stream
->
forceStop
();
}
void
RenderThread
::
forceStop
()
{
m_stream
->
forceStop
();
}
intptr_t
RenderThread
::
main
()
{
intptr_t
RenderThread
::
main
()
{
RenderThreadInfo
tInfo
;
RenderThreadInfo
t
hread
Info
;
ChecksumCalculatorThreadInfo
tChecksumInfo
;
ChecksumCalculatorThreadInfo
t
hread
ChecksumInfo
;
//
threadInfo
.
m_glDec
.
initGL
(
gles1_dispatch_get_proc_func
,
NULL
);
// initialize decoders
threadInfo
.
m_gl2Dec
.
initGL
(
gles2_dispatch_get_proc_func
,
NULL
);
//
initRenderControlContext
(
&
threadInfo
.
m_rcDec
);
tInfo
.
m_glDec
.
initGL
(
gles1_dispatch_get_proc_func
,
NULL
);
tInfo
.
m_gl2Dec
.
initGL
(
gles2_dispatch_get_proc_func
,
NULL
);
initRenderControlContext
(
&
tInfo
.
m_rcDec
);
ReadBuffer
readBuf
(
STREAM_BUFFER_SIZE
);
ReadBuffer
readBuf
(
STREAM_BUFFER_SIZE
);
while
(
1
)
{
while
(
true
)
{
int
stat
=
readBuf
.
getData
(
m_stream
);
int
stat
=
readBuf
.
getData
(
m_stream
);
if
(
stat
<=
0
)
{
if
(
stat
<=
0
)
break
;
break
;
}
bool
progress
;
bool
progress
;
do
{
do
{
progress
=
false
;
progress
=
false
;
m_lock
->
lock
();
m_lock
->
lock
();
//
// try to process some of the command buffer using the GLESv1 decoder
//
size_t
last
=
size_t
last
=
tInfo
.
m_glDec
.
decode
(
readBuf
.
buf
(),
readBuf
.
validData
(),
m_stream
);
t
hread
Info
.
m_glDec
.
decode
(
readBuf
.
buf
(),
readBuf
.
validData
(),
m_stream
);
if
(
last
>
0
)
{
if
(
last
>
0
)
{
progress
=
true
;
progress
=
true
;
readBuf
.
consume
(
last
);
readBuf
.
consume
(
last
);
}
}
//
// try to process some of the command buffer using the GLESv2 decoder
//
last
=
last
=
tInfo
.
m_gl2Dec
.
decode
(
readBuf
.
buf
(),
readBuf
.
validData
(),
m_stream
);
t
hread
Info
.
m_gl2Dec
.
decode
(
readBuf
.
buf
(),
readBuf
.
validData
(),
m_stream
);
if
(
last
>
0
)
{
if
(
last
>
0
)
{
progress
=
true
;
progress
=
true
;
readBuf
.
consume
(
last
);
readBuf
.
consume
(
last
);
}
}
//
last
=
threadInfo
.
m_rcDec
.
decode
(
readBuf
.
buf
(),
readBuf
.
validData
(),
m_stream
);
// try to process some of the command buffer using the
// renderControl decoder
//
last
=
tInfo
.
m_rcDec
.
decode
(
readBuf
.
buf
(),
readBuf
.
validData
(),
m_stream
);
if
(
last
>
0
)
{
if
(
last
>
0
)
{
readBuf
.
consume
(
last
);
readBuf
.
consume
(
last
);
progress
=
true
;
progress
=
true
;
...
@@ -99,17 +86,12 @@ intptr_t RenderThread::main() {
...
@@ -99,17 +86,12 @@ intptr_t RenderThread::main() {
}
while
(
progress
);
}
while
(
progress
);
}
}
//
// Release references to the current thread's context/surfaces if any
// Release references to the current thread's context/surfaces if any
//
Renderer
::
get
()
->
bindContext
(
0
,
0
,
0
);
Renderer
::
get
()
->
bindContext
(
0
,
0
,
0
);
if
(
tInfo
.
currContext
||
tInfo
.
currDrawSurf
||
tInfo
.
currReadSurf
)
{
if
(
threadInfo
.
currContext
||
threadInfo
.
currDrawSurf
||
threadInfo
.
currReadSurf
)
fprintf
(
stderr
,
ERROR
(
"RenderThread exiting with current context/surfaces"
);
"ERROR: RenderThread exiting with current context/surfaces
\n
"
);
}
Renderer
::
get
()
->
drainWindowSurface
();
Renderer
::
get
()
->
drainWindowSurface
();
Renderer
::
get
()
->
drainRenderContext
();
Renderer
::
get
()
->
drainRenderContext
();
return
0
;
return
0
;
...
...
src/anbox/graphics/emugl/RenderThreadInfo.cpp
浏览文件 @
aeff6e35
...
@@ -20,13 +20,11 @@
...
@@ -20,13 +20,11 @@
#include "emugl/common/thread_store.h"
#include "emugl/common/thread_store.h"
namespace
{
namespace
{
class
ThreadInfoStore
:
public
::
emugl
::
ThreadStore
{
class
ThreadInfoStore
:
public
::
emugl
::
ThreadStore
{
public:
public:
ThreadInfoStore
()
:
::
emugl
::
ThreadStore
(
NULL
)
{}
ThreadInfoStore
()
:
::
emugl
::
ThreadStore
(
NULL
)
{}
};
};
}
}
// namespace
static
::
emugl
::
LazyInstance
<
ThreadInfoStore
>
s_tls
=
LAZY_INSTANCE_INIT
;
static
::
emugl
::
LazyInstance
<
ThreadInfoStore
>
s_tls
=
LAZY_INSTANCE_INIT
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录