Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
anbox
提交
2f849059
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,发现更多精彩内容 >>
提交
2f849059
编写于
12月 19, 2016
作者:
S
Simon Fels
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Correct texture and frame size calculation to be correct in offscreen areas
上级
abb0497a
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
24 addition
and
20 deletion
+24
-20
src/anbox/graphics/emugl/Renderer.cpp
src/anbox/graphics/emugl/Renderer.cpp
+8
-6
src/anbox/graphics/layer_composer.cpp
src/anbox/graphics/layer_composer.cpp
+3
-4
src/anbox/graphics/rect.cpp
src/anbox/graphics/rect.cpp
+1
-1
src/anbox/ubuntu/platform_policy.cpp
src/anbox/ubuntu/platform_policy.cpp
+1
-1
src/anbox/ubuntu/window.cpp
src/anbox/ubuntu/window.cpp
+0
-7
src/anbox/wm/window.cpp
src/anbox/wm/window.cpp
+11
-1
未找到文件。
src/anbox/graphics/emugl/Renderer.cpp
浏览文件 @
2f849059
...
...
@@ -996,7 +996,7 @@ void Renderer::setupViewport(RendererWindow *window,
void
Renderer
::
tessellate
(
std
::
vector
<
anbox
::
graphics
::
Primitive
>
&
primitives
,
const
anbox
::
graphics
::
Rect
&
buf_size
,
const
Renderable
&
renderable
)
{
auto
rect
=
renderable
.
screen_position
();
auto
rect
=
renderable
.
crop
();
GLfloat
left
=
rect
.
left
();
GLfloat
right
=
rect
.
right
();
GLfloat
top
=
rect
.
top
();
...
...
@@ -1006,13 +1006,15 @@ void Renderer::tessellate(std::vector<anbox::graphics::Primitive> &primitives,
rectangle
.
tex_id
=
0
;
rectangle
.
type
=
GL_TRIANGLE_STRIP
;
GLfloat
tex_right
=
static_cast
<
GLfloat
>
(
rect
.
width
())
/
buf_size
.
width
();
GLfloat
tex_bottom
=
static_cast
<
GLfloat
>
(
rect
.
height
())
/
buf_size
.
height
();
GLfloat
tex_left
=
static_cast
<
GLfloat
>
(
left
)
/
buf_size
.
width
();
GLfloat
tex_top
=
static_cast
<
GLfloat
>
(
top
)
/
buf_size
.
height
();
GLfloat
tex_right
=
static_cast
<
GLfloat
>
(
right
)
/
buf_size
.
width
();
GLfloat
tex_bottom
=
static_cast
<
GLfloat
>
(
bottom
)
/
buf_size
.
height
();
auto
&
vertices
=
rectangle
.
vertices
;
vertices
[
0
]
=
{{
left
,
top
,
0.0
f
},
{
0.0
f
,
0.0
f
}};
vertices
[
1
]
=
{{
left
,
bottom
,
0.0
f
},
{
0.0
f
,
tex_bottom
}};
vertices
[
2
]
=
{{
right
,
top
,
0.0
f
},
{
tex_right
,
0.0
f
}};
vertices
[
0
]
=
{{
left
,
top
,
0.0
f
},
{
tex_left
,
tex_top
}};
vertices
[
1
]
=
{{
left
,
bottom
,
0.0
f
},
{
tex_left
,
tex_bottom
}};
vertices
[
2
]
=
{{
right
,
top
,
0.0
f
},
{
tex_right
,
tex_top
}};
vertices
[
3
]
=
{{
right
,
bottom
,
0.0
f
},
{
tex_right
,
tex_bottom
}};
primitives
.
resize
(
1
);
...
...
src/anbox/graphics/layer_composer.cpp
浏览文件 @
2f849059
...
...
@@ -72,9 +72,9 @@ void LayerComposer::submit_layers(const RenderableList &renderables) {
auto
top
=
r
.
screen_position
().
top
()
-
new_window_frame
.
top
();
auto
rect
=
Rect
{
left
-
r
.
crop
().
left
(),
top
-
r
.
crop
().
top
(),
r
.
screen_position
().
width
()
+
left
,
r
.
screen_position
().
height
()
+
top
,
left
+
r
.
crop
().
left
(),
top
+
r
.
crop
().
top
(),
r
.
crop
().
right
()
,
r
.
crop
().
bottom
()
,
};
auto
new_renderable
=
r
;
...
...
@@ -82,7 +82,6 @@ void LayerComposer::submit_layers(const RenderableList &renderables) {
final_renderables
.
push_back
(
new_renderable
);
}
w
.
first
->
update_frame
(
new_window_frame
);
Renderer
::
get
()
->
draw
(
window
->
native_handle
(),
...
...
src/anbox/graphics/rect.cpp
浏览文件 @
2f849059
...
...
@@ -48,7 +48,7 @@ void Rect::resize(const std::int32_t &width, const std::int32_t &height) {
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
Rect
&
rect
)
{
return
out
<<
"{"
<<
rect
.
left
()
<<
","
<<
rect
.
top
()
<<
","
<<
rect
.
right
()
<<
","
<<
rect
.
bottom
()
<<
"}"
;
<<
","
<<
rect
.
bottom
()
<<
"}
{"
<<
rect
.
width
()
<<
","
<<
rect
.
height
()
<<
"}
"
;
}
}
// namespace graphics
}
// namespace anbox
src/anbox/ubuntu/platform_policy.cpp
浏览文件 @
2f849059
...
...
@@ -232,7 +232,7 @@ void PlatformPolicy::window_resized(const Window::Id &id,
// representing this window and then we're back to the original size of
// the task.
window
->
update_frame
(
new_frame
);
android_api_
->
resize_task
(
window
->
task
(),
new_frame
,
1
);
android_api_
->
resize_task
(
window
->
task
(),
new_frame
,
3
);
}
}
...
...
src/anbox/ubuntu/window.cpp
浏览文件 @
2f849059
...
...
@@ -65,17 +65,10 @@ Window::Window(const Id &id, const wm::Task::Id &task,
ERROR
(
"Unknown subsystem (%d)"
,
info
.
subsystem
);
BOOST_THROW_EXCEPTION
(
std
::
runtime_error
(
"SDL subsystem not suported"
));
}
int
actual_width
=
0
,
actual_height
=
0
;
int
actual_x
=
0
,
actual_y
=
0
;
SDL_GetWindowSize
(
window_
,
&
actual_width
,
&
actual_height
);
SDL_GetWindowPosition
(
window_
,
&
actual_x
,
&
actual_y
);
}
Window
::~
Window
()
{
if
(
window_
)
SDL_DestroyWindow
(
window_
);
// if (observer_) observer_->window_deleted(id_);
}
void
Window
::
process_event
(
const
SDL_Event
&
event
)
{
...
...
src/anbox/wm/window.cpp
浏览文件 @
2f849059
...
...
@@ -26,7 +26,17 @@ Window::Window(const Task::Id &task, const graphics::Rect &frame)
Window
::~
Window
()
{}
void
Window
::
update_state
(
const
WindowState
::
List
&
states
)
{}
void
Window
::
update_state
(
const
WindowState
::
List
&
states
)
{
graphics
::
Rect
new_frame
=
graphics
::
Rect
::
Invalid
;
for
(
const
auto
&
s
:
states
)
{
if
(
new_frame
==
graphics
::
Rect
::
Invalid
)
new_frame
=
s
.
frame
();
else
new_frame
.
merge
(
s
.
frame
());
}
update_frame
(
new_frame
);
}
void
Window
::
update_frame
(
const
graphics
::
Rect
&
frame
)
{
if
(
frame
==
frame_
)
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录