Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
anbox
提交
b05b8bae
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,发现更多精彩内容 >>
提交
b05b8bae
编写于
11月 08, 2016
作者:
S
Simon Fels
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Implement quick&dirty approach to update window size and position
上级
f2e39fb2
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
53 addition
and
8 deletion
+53
-8
external/android-emugl/host/libs/libOpenglRender/FrameBuffer.cpp
...l/android-emugl/host/libs/libOpenglRender/FrameBuffer.cpp
+7
-0
external/android-emugl/host/libs/libOpenglRender/FrameBuffer.h
...nal/android-emugl/host/libs/libOpenglRender/FrameBuffer.h
+1
-0
external/android-emugl/host/libs/libOpenglRender/LayerManager.cpp
.../android-emugl/host/libs/libOpenglRender/LayerManager.cpp
+14
-8
external/android-emugl/host/libs/libOpenglRender/NativeSubWindow.h
...android-emugl/host/libs/libOpenglRender/NativeSubWindow.h
+3
-0
external/android-emugl/host/libs/libOpenglRender/NativeSubWindow_delegate.cpp
...gl/host/libs/libOpenglRender/NativeSubWindow_delegate.cpp
+7
-0
src/anbox/ubuntu/window.cpp
src/anbox/ubuntu/window.cpp
+8
-0
src/anbox/ubuntu/window.h
src/anbox/ubuntu/window.h
+3
-0
src/anbox/ubuntu/window_creator.cpp
src/anbox/ubuntu/window_creator.cpp
+9
-0
src/anbox/ubuntu/window_creator.h
src/anbox/ubuntu/window_creator.h
+1
-0
未找到文件。
external/android-emugl/host/libs/libOpenglRender/FrameBuffer.cpp
浏览文件 @
b05b8bae
...
@@ -497,6 +497,13 @@ FrameBufferWindow* FrameBuffer::createWindow(int x, int y, int width, int height
...
@@ -497,6 +497,13 @@ FrameBufferWindow* FrameBuffer::createWindow(int x, int y, int width, int height
return
window
;
return
window
;
}
}
void
FrameBuffer
::
updateWindow
(
FrameBufferWindow
*
window
,
int
x
,
int
y
,
int
width
,
int
height
)
{
if
(
!
window
)
return
;
updateSubWindow
(
window
->
native_window
,
x
,
y
,
width
,
height
);
}
void
FrameBuffer
::
destroyWindow
(
FrameBufferWindow
*
window
)
{
void
FrameBuffer
::
destroyWindow
(
FrameBufferWindow
*
window
)
{
if
(
!
window
)
if
(
!
window
)
return
;
return
;
...
...
external/android-emugl/host/libs/libOpenglRender/FrameBuffer.h
浏览文件 @
b05b8bae
...
@@ -79,6 +79,7 @@ public:
...
@@ -79,6 +79,7 @@ public:
static
bool
initialize
(
EGLNativeDisplayType
nativeDisplay
);
static
bool
initialize
(
EGLNativeDisplayType
nativeDisplay
);
FrameBufferWindow
*
createWindow
(
int
x
,
int
y
,
int
width
,
int
height
);
FrameBufferWindow
*
createWindow
(
int
x
,
int
y
,
int
width
,
int
height
);
void
updateWindow
(
FrameBufferWindow
*
window
,
int
x
,
int
y
,
int
width
,
int
height
);
void
destroyWindow
(
FrameBufferWindow
*
window
);
void
destroyWindow
(
FrameBufferWindow
*
window
);
// Finalize the instance.
// Finalize the instance.
...
...
external/android-emugl/host/libs/libOpenglRender/LayerManager.cpp
浏览文件 @
b05b8bae
...
@@ -82,13 +82,16 @@ void LayerManager::post_layer(const LayerInfo &layer) {
...
@@ -82,13 +82,16 @@ void LayerManager::post_layer(const LayerInfo &layer) {
l
.
second
.
updated
=
true
;
l
.
second
.
updated
=
true
;
}
}
}
}
else
{
printf
(
"New layer '%s' {%d,%d,%d,%d}
\n
"
,
layer
.
name
.
c_str
());
auto
width
=
layer
.
display_frame
.
right
-
layer
.
display_frame
.
left
;
window
=
FrameBuffer
::
getFB
()
->
createWindow
(
auto
height
=
layer
.
display_frame
.
bottom
-
layer
.
display_frame
.
top
;
layer
.
display_frame
.
left
,
layer
.
display_frame
.
top
,
if
(
!
window
)
{
layer
.
display_frame
.
right
,
auto
buffer
=
FrameBuffer
::
getFB
()
->
getColorBufferFromHandle
(
layer
.
buffer_handle
);
layer
.
display_frame
.
bottom
);
window
=
FrameBuffer
::
getFB
()
->
createWindow
(
layer
.
display_frame
.
left
,
layer
.
display_frame
.
top
,
width
,
height
);
if
(
!
window
)
{
if
(
!
window
)
{
printf
(
"Failed to create window for layer '%s'
\n
"
,
layer
.
name
.
c_str
());
printf
(
"Failed to create window for layer '%s'
\n
"
,
layer
.
name
.
c_str
());
return
;
return
;
...
@@ -97,7 +100,10 @@ void LayerManager::post_layer(const LayerInfo &layer) {
...
@@ -97,7 +100,10 @@ void LayerManager::post_layer(const LayerInfo &layer) {
}
}
printf
(
"%s: window %p buffer %d
\n
"
,
__func__
,
window
,
layer
.
buffer_handle
);
printf
(
"%s: window %p buffer %d
\n
"
,
__func__
,
window
,
layer
.
buffer_handle
);
FrameBuffer
::
getFB
()
->
updateWindow
(
window
,
layer
.
display_frame
.
left
,
layer
.
display_frame
.
top
,
width
,
height
);
FrameBuffer
::
getFB
()
->
post
(
window
,
layer
.
buffer_handle
);
FrameBuffer
::
getFB
()
->
post
(
window
,
layer
.
buffer_handle
);
}
}
...
...
external/android-emugl/host/libs/libOpenglRender/NativeSubWindow.h
浏览文件 @
b05b8bae
...
@@ -30,6 +30,7 @@ class SubWindowHandler {
...
@@ -30,6 +30,7 @@ class SubWindowHandler {
public:
public:
virtual
~
SubWindowHandler
()
{
}
virtual
~
SubWindowHandler
()
{
}
virtual
EGLNativeWindowType
create_window
(
int
x
,
int
y
,
int
width
,
int
height
)
=
0
;
virtual
EGLNativeWindowType
create_window
(
int
x
,
int
y
,
int
width
,
int
height
)
=
0
;
virtual
void
update_window
(
EGLNativeWindowType
win
,
int
x
,
int
y
,
int
width
,
int
height
)
=
0
;
virtual
void
destroy_window
(
EGLNativeWindowType
win
)
=
0
;
virtual
void
destroy_window
(
EGLNativeWindowType
win
)
=
0
;
};
};
...
@@ -55,6 +56,8 @@ EGLNativeWindowType createSubWindow(FBNativeWindowType p_window,
...
@@ -55,6 +56,8 @@ EGLNativeWindowType createSubWindow(FBNativeWindowType p_window,
int
width
,
int
width
,
int
height
);
int
height
);
void
updateSubWindow
(
EGLNativeWindowType
win
,
int
x
,
int
y
,
int
width
,
int
height
);
// Destroy a sub-window previously created through createSubWindow() above.
// Destroy a sub-window previously created through createSubWindow() above.
void
destroySubWindow
(
EGLNativeWindowType
win
);
void
destroySubWindow
(
EGLNativeWindowType
win
);
...
...
external/android-emugl/host/libs/libOpenglRender/NativeSubWindow_delegate.cpp
浏览文件 @
b05b8bae
...
@@ -44,6 +44,13 @@ EGLNativeWindowType createSubWindow(FBNativeWindowType p_window,
...
@@ -44,6 +44,13 @@ EGLNativeWindowType createSubWindow(FBNativeWindowType p_window,
return
current_handler
->
create_window
(
x
,
y
,
width
,
height
);
return
current_handler
->
create_window
(
x
,
y
,
width
,
height
);
}
}
void
updateSubWindow
(
EGLNativeWindowType
win
,
int
x
,
int
y
,
int
width
,
int
height
)
{
if
(
!
current_handler
)
return
;
return
current_handler
->
update_window
(
win
,
x
,
y
,
width
,
height
);
}
void
destroySubWindow
(
EGLNativeWindowType
win
)
{
void
destroySubWindow
(
EGLNativeWindowType
win
)
{
if
(
!
current_handler
)
if
(
!
current_handler
)
return
;
return
;
...
...
src/anbox/ubuntu/window.cpp
浏览文件 @
b05b8bae
...
@@ -62,6 +62,14 @@ Window::~Window() {
...
@@ -62,6 +62,14 @@ Window::~Window() {
SDL_DestroyWindow
(
window_
);
SDL_DestroyWindow
(
window_
);
}
}
void
Window
::
resize
(
int
width
,
int
height
)
{
SDL_SetWindowSize
(
window_
,
width
,
height
);
}
int
Window
::
update_position
(
int
x
,
int
y
)
{
SDL_SetWindowPosition
(
window_
,
x
,
y
);
}
EGLNativeWindowType
Window
::
native_window
()
const
{
EGLNativeWindowType
Window
::
native_window
()
const
{
return
native_window_
;
return
native_window_
;
}
}
...
...
src/anbox/ubuntu/window.h
浏览文件 @
b05b8bae
...
@@ -32,6 +32,9 @@ public:
...
@@ -32,6 +32,9 @@ public:
Window
(
int
x
,
int
y
,
int
width
,
int
height
);
Window
(
int
x
,
int
y
,
int
width
,
int
height
);
~
Window
();
~
Window
();
void
resize
(
int
width
,
int
height
);
int
update_position
(
int
x
,
int
y
);
EGLNativeWindowType
native_window
()
const
;
EGLNativeWindowType
native_window
()
const
;
private:
private:
...
...
src/anbox/ubuntu/window_creator.cpp
浏览文件 @
b05b8bae
...
@@ -91,6 +91,15 @@ catch (std::exception &err) {
...
@@ -91,6 +91,15 @@ catch (std::exception &err) {
return
0
;
return
0
;
}
}
void
WindowCreator
::
update_window
(
EGLNativeWindowType
win
,
int
x
,
int
y
,
int
width
,
int
height
)
{
auto
iter
=
windows_
.
find
(
win
);
if
(
iter
==
windows_
.
end
())
return
;
iter
->
second
->
resize
(
width
,
height
);
iter
->
second
->
update_position
(
x
,
y
);
}
void
WindowCreator
::
destroy_window
(
EGLNativeWindowType
win
)
{
void
WindowCreator
::
destroy_window
(
EGLNativeWindowType
win
)
{
auto
iter
=
windows_
.
find
(
win
);
auto
iter
=
windows_
.
find
(
win
);
if
(
iter
==
windows_
.
end
())
if
(
iter
==
windows_
.
end
())
...
...
src/anbox/ubuntu/window_creator.h
浏览文件 @
b05b8bae
...
@@ -39,6 +39,7 @@ public:
...
@@ -39,6 +39,7 @@ public:
~
WindowCreator
();
~
WindowCreator
();
EGLNativeWindowType
create_window
(
int
x
,
int
y
,
int
width
,
int
height
)
override
;
EGLNativeWindowType
create_window
(
int
x
,
int
y
,
int
width
,
int
height
)
override
;
void
update_window
(
EGLNativeWindowType
win
,
int
x
,
int
y
,
int
width
,
int
height
)
override
;
void
destroy_window
(
EGLNativeWindowType
win
)
override
;
void
destroy_window
(
EGLNativeWindowType
win
)
override
;
DisplayInfo
display_info
()
const
override
;
DisplayInfo
display_info
()
const
override
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录