Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
anbox
提交
583e1910
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,发现更多精彩内容 >>
提交
583e1910
编写于
5月 12, 2017
作者:
S
Simon Fels
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Don't register platform policy as display manager but use a singleton instead
上级
bf243a33
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
40 addition
and
44 deletion
+40
-44
src/anbox/cmds/session_manager.cpp
src/anbox/cmds/session_manager.cpp
+0
-2
src/anbox/graphics/emugl/DisplayManager.cpp
src/anbox/graphics/emugl/DisplayManager.cpp
+15
-15
src/anbox/graphics/emugl/DisplayManager.h
src/anbox/graphics/emugl/DisplayManager.h
+19
-12
src/anbox/graphics/emugl/RenderControl.cpp
src/anbox/graphics/emugl/RenderControl.cpp
+4
-4
src/anbox/ubuntu/platform_policy.cpp
src/anbox/ubuntu/platform_policy.cpp
+1
-6
src/anbox/ubuntu/platform_policy.h
src/anbox/ubuntu/platform_policy.h
+1
-5
未找到文件。
src/anbox/cmds/session_manager.cpp
浏览文件 @
583e1910
...
...
@@ -159,8 +159,6 @@ anbox::cmds::SessionManager::SessionManager(const BusFactory &bus_factory)
display_frame
=
window_size_
;
auto
policy
=
std
::
make_shared
<
ubuntu
::
PlatformPolicy
>
(
input_manager
,
display_frame
,
single_window_
);
// FIXME this needs to be removed and solved differently behind the scenes
registerDisplayManager
(
policy
);
auto
app_db
=
std
::
make_shared
<
application
::
Database
>
();
...
...
src/anbox/graphics/emugl/DisplayManager.cpp
浏览文件 @
583e1910
...
...
@@ -17,22 +17,22 @@
#include "DisplayManager.h"
namespace
{
std
::
shared_ptr
<
DisplayManager
>
display_mgr
;
class
NullDisplayManager
:
public
DisplayManager
{
public:
DisplayInfo
display_info
()
const
override
{
return
{
1280
,
720
};
}
};
namespace
anbox
{
namespace
graphics
{
namespace
emugl
{
std
::
shared_ptr
<
DisplayInfo
>
DisplayInfo
::
get
()
{
static
auto
info
=
std
::
make_shared
<
DisplayInfo
>
();
return
info
;
}
DisplayManager
::~
DisplayManager
()
{}
std
::
shared_ptr
<
DisplayManager
>
DisplayManager
::
get
()
{
if
(
!
display_mgr
)
display_mgr
=
std
::
make_shared
<
NullDisplayManager
>
();
return
display_mgr
;
void
DisplayInfo
::
set_resolution
(
const
std
::
uint32_t
&
vertical
,
const
std
::
uint32_t
horizontal
)
{
vertical_resolution_
=
vertical
;
horizontal_resolution_
=
horizontal
;
}
void
registerDisplayManager
(
const
std
::
shared_ptr
<
DisplayManager
>
&
mgr
)
{
display_mgr
=
mgr
;
}
std
::
uint32_t
DisplayInfo
::
vertical_resolution
()
const
{
return
vertical_resolution_
;
}
std
::
uint32_t
DisplayInfo
::
horizontal_resolution
()
const
{
return
horizontal_resolution_
;
}
}
// namespace emugl
}
// namespace graphics
}
// namespace anbox
src/anbox/graphics/emugl/DisplayManager.h
浏览文件 @
583e1910
...
...
@@ -15,25 +15,32 @@
*
*/
#ifndef
DISPLAY_MANAGER
_H_
#define
DISPLAY_MANAGER
_H_
#ifndef
ANBOX_GRAPHICS_EMUGL_DISPLAY_INFO
_H_
#define
ANBOX_GRAPHICS_EMUGL_DISPLAY_INFO
_H_
#include <cstdint>
#include <memory>
class
DisplayManager
{
namespace
anbox
{
namespace
graphics
{
namespace
emugl
{
class
DisplayInfo
{
public:
virtual
~
DisplayManager
()
;
DisplayInfo
()
=
default
;
struct
DisplayInfo
{
int
horizontal_resolution
;
int
vertical_resolution
;
};
static
std
::
shared_ptr
<
DisplayInfo
>
get
();
v
irtual
DisplayInfo
display_info
()
const
=
0
;
v
oid
set_resolution
(
const
std
::
uint32_t
&
vertical
,
const
std
::
uint32_t
horizontal
)
;
st
atic
std
::
shared_ptr
<
DisplayManager
>
get
()
;
}
;
st
d
::
uint32_t
vertical_resolution
()
const
;
std
::
uint32_t
horizontal_resolution
()
const
;
void
registerDisplayManager
(
const
std
::
shared_ptr
<
DisplayManager
>
&
mgr
);
private:
std
::
uint32_t
vertical_resolution_
=
1280
;
std
::
uint32_t
horizontal_resolution_
=
720
;
};
}
// namespace emugl
}
// namespace graphics
}
// namespace anbox
#endif
src/anbox/graphics/emugl/RenderControl.cpp
浏览文件 @
583e1910
...
...
@@ -169,10 +169,10 @@ static EGLint rcGetFBParam(EGLint param) {
switch
(
param
)
{
case
FB_WIDTH
:
ret
=
DisplayManager
::
get
()
->
display_info
().
horizontal_resolution
;
ret
=
static_cast
<
EGLint
>
(
anbox
::
graphics
::
emugl
::
DisplayInfo
::
get
()
->
horizontal_resolution
())
;
break
;
case
FB_HEIGHT
:
ret
=
DisplayManager
::
get
()
->
display_info
().
vertical_resolution
;
ret
=
static_cast
<
EGLint
>
(
anbox
::
graphics
::
emugl
::
DisplayInfo
::
get
()
->
vertical_resolution
())
;
break
;
case
FB_XDPI
:
ret
=
72
;
// XXX: should be implemented
...
...
@@ -360,12 +360,12 @@ int rcGetNumDisplays() {
int
rcGetDisplayWidth
(
uint32_t
display_id
)
{
(
void
)
display_id
;
return
DisplayManager
::
get
()
->
display_info
().
horizontal_resolution
;
return
static_cast
<
int
>
(
anbox
::
graphics
::
emugl
::
DisplayInfo
::
get
()
->
horizontal_resolution
())
;
}
int
rcGetDisplayHeight
(
uint32_t
display_id
)
{
(
void
)
display_id
;
return
DisplayManager
::
get
()
->
display_info
().
vertical_resolution
;
return
static_cast
<
int
>
(
anbox
::
graphics
::
emugl
::
DisplayInfo
::
get
()
->
vertical_resolution
())
;
}
int
rcGetDisplayDpiX
(
uint32_t
display_id
)
{
...
...
src/anbox/ubuntu/platform_policy.cpp
浏览文件 @
583e1910
...
...
@@ -68,8 +68,7 @@ PlatformPolicy::PlatformPolicy(
window_size_immutable_
=
true
;
}
display_info_
.
horizontal_resolution
=
display_frame
.
width
();
display_info_
.
vertical_resolution
=
display_frame
.
height
();
graphics
::
emugl
::
DisplayInfo
::
get
()
->
set_resolution
(
display_frame
.
width
(),
display_frame
.
height
());
pointer_
=
input_manager
->
create_device
();
pointer_
->
set_name
(
"anbox-pointer"
);
...
...
@@ -285,10 +284,6 @@ void PlatformPolicy::window_resized(const Window::Id &id,
}
}
DisplayManager
::
DisplayInfo
PlatformPolicy
::
display_info
()
const
{
return
display_info_
;
}
void
PlatformPolicy
::
set_clipboard_data
(
const
ClipboardData
&
data
)
{
if
(
data
.
text
.
empty
())
return
;
...
...
src/anbox/ubuntu/platform_policy.h
浏览文件 @
583e1910
...
...
@@ -41,8 +41,7 @@ class Manager;
namespace
ubuntu
{
class
PlatformPolicy
:
public
std
::
enable_shared_from_this
<
PlatformPolicy
>
,
public
platform
::
Policy
,
public
Window
::
Observer
,
public
DisplayManager
{
public
Window
::
Observer
{
public:
PlatformPolicy
(
const
std
::
shared_ptr
<
input
::
Manager
>
&
input_manager
,
const
graphics
::
Rect
&
static_display_frame
=
graphics
::
Rect
::
Invalid
,
...
...
@@ -61,8 +60,6 @@ class PlatformPolicy : public std::enable_shared_from_this<PlatformPolicy>,
void
window_resized
(
const
Window
::
Id
&
id
,
const
std
::
int32_t
&
width
,
const
std
::
int32_t
&
height
)
override
;
DisplayInfo
display_info
()
const
override
;
void
set_renderer
(
const
std
::
shared_ptr
<
Renderer
>
&
renderer
);
void
set_window_manager
(
const
std
::
shared_ptr
<
wm
::
Manager
>
&
window_manager
);
...
...
@@ -89,7 +86,6 @@ class PlatformPolicy : public std::enable_shared_from_this<PlatformPolicy>,
bool
event_thread_running_
;
std
::
shared_ptr
<
input
::
Device
>
pointer_
;
std
::
shared_ptr
<
input
::
Device
>
keyboard_
;
DisplayManager
::
DisplayInfo
display_info_
;
bool
window_size_immutable_
=
false
;
bool
single_window_
=
false
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录