Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
anbox
提交
b1edee8a
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,发现更多精彩内容 >>
提交
b1edee8a
编写于
1月 20, 2017
作者:
S
Simon Fels
提交者:
GitHub
1月 20, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #22 from vosst/fix-build
Fix build with warnings turned on.
上级
a55c3284
4d457153
变更
29
隐藏空白更改
内联
并排
Showing
29 changed file
with
90 addition
and
71 deletion
+90
-71
external/android-emugl/CMakeLists.txt
external/android-emugl/CMakeLists.txt
+4
-0
external/android-emugl/host/include/GLES/gl.h
external/android-emugl/host/include/GLES/gl.h
+4
-0
external/android-emugl/host/include/libOpenglRender/IOStream.h
...nal/android-emugl/host/include/libOpenglRender/IOStream.h
+1
-1
external/android-emugl/shared/OpenglCodecCommon/ChecksumCalculator.h
...droid-emugl/shared/OpenglCodecCommon/ChecksumCalculator.h
+2
-2
external/android-emugl/shared/OpenglCodecCommon/glUtils.h
external/android-emugl/shared/OpenglCodecCommon/glUtils.h
+1
-1
external/android-emugl/shared/emugl/common/logging.h
external/android-emugl/shared/emugl/common/logging.h
+5
-0
external/xdg/CMakeLists.txt
external/xdg/CMakeLists.txt
+1
-1
src/anbox/cmds/container_manager.cpp
src/anbox/cmds/container_manager.cpp
+1
-1
src/anbox/cmds/run.cpp
src/anbox/cmds/run.cpp
+4
-1
src/anbox/common/scope_ptr.h
src/anbox/common/scope_ptr.h
+1
-1
src/anbox/common/small_vector.h
src/anbox/common/small_vector.h
+2
-10
src/anbox/graphics/emugl/ColorBuffer.cpp
src/anbox/graphics/emugl/ColorBuffer.cpp
+5
-5
src/anbox/graphics/emugl/ReadBuffer.cpp
src/anbox/graphics/emugl/ReadBuffer.cpp
+2
-2
src/anbox/graphics/emugl/RenderControl.cpp
src/anbox/graphics/emugl/RenderControl.cpp
+11
-11
src/anbox/graphics/emugl/Renderer.cpp
src/anbox/graphics/emugl/Renderer.cpp
+10
-8
src/anbox/graphics/emugl/RendererConfig.cpp
src/anbox/graphics/emugl/RendererConfig.cpp
+2
-2
src/anbox/graphics/emugl/RendererConfig.h
src/anbox/graphics/emugl/RendererConfig.h
+1
-1
src/anbox/graphics/emugl/TextureResize.cpp
src/anbox/graphics/emugl/TextureResize.cpp
+1
-7
src/anbox/graphics/emugl/TextureResize.h
src/anbox/graphics/emugl/TextureResize.h
+5
-5
src/anbox/graphics/emugl/WindowSurface.cpp
src/anbox/graphics/emugl/WindowSurface.cpp
+1
-1
src/anbox/qemu/pipe_connection_creator.cpp
src/anbox/qemu/pipe_connection_creator.cpp
+2
-0
src/anbox/qemu/qemud_message_processor.cpp
src/anbox/qemu/qemud_message_processor.cpp
+1
-1
src/anbox/rpc/message_processor.h
src/anbox/rpc/message_processor.h
+2
-2
src/anbox/ubuntu/audio_sink.cpp
src/anbox/ubuntu/audio_sink.cpp
+1
-1
src/anbox/ubuntu/keycode_converter.cpp
src/anbox/ubuntu/keycode_converter.cpp
+3
-1
src/anbox/ubuntu/platform_policy.cpp
src/anbox/ubuntu/platform_policy.cpp
+5
-0
src/anbox/ubuntu/window.cpp
src/anbox/ubuntu/window.cpp
+5
-0
tests/anbox/graphics/buffer_queue_tests.cpp
tests/anbox/graphics/buffer_queue_tests.cpp
+3
-3
tests/anbox/graphics/buffered_io_stream_tests.cpp
tests/anbox/graphics/buffered_io_stream_tests.cpp
+4
-3
未找到文件。
external/android-emugl/CMakeLists.txt
浏览文件 @
b1edee8a
# Don't treat any warnings as error as we take the source directly from
# upstream and just compile it.
set
(
CMAKE_C_FLAGS
"-Wall"
)
set
(
CMAKE_CXX_FLAGS
"-std=c++11 -Wall"
)
# Ensure -fPIC
set
(
CMAKE_POSITION_INDEPENDENT_CODE ON
)
include_directories
(
${
CMAKE_SOURCE_DIR
}
/src
...
...
external/android-emugl/host/include/GLES/gl.h
浏览文件 @
b1edee8a
#ifndef __gl_h_
#define __gl_h_
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wredundant-decls"
/* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */
#include <GLES/glplatform.h>
...
...
@@ -766,5 +768,7 @@ GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, cons
}
#endif
#pragma GCC diagnostic pop
#endif
/* __gl_h_ */
external/android-emugl/host/include/libOpenglRender/IOStream.h
浏览文件 @
b1edee8a
...
...
@@ -44,7 +44,7 @@ public:
if
(
!
m_buf
||
len
>
m_bufsize
)
{
int
allocLen
=
m_bufsize
<
len
?
len
:
m_bufsize
;
m_buf
=
(
unsigned
char
*
)
allocBuffer
(
allocLen
);
m_buf
=
static_cast
<
unsigned
char
*>
(
allocBuffer
(
allocLen
)
);
if
(
!
m_buf
)
return
NULL
;
m_bufsize
=
m_free
=
allocLen
;
...
...
external/android-emugl/shared/OpenglCodecCommon/ChecksumCalculator.h
浏览文件 @
b1edee8a
...
...
@@ -24,9 +24,9 @@
#define TRACE_CHECKSUMHELPER 0
#if TRACE_CHECKSUMHELPER
#define LOG_CHECKSUMHELPER(
x...) fprintf(stderr, x
)
#define LOG_CHECKSUMHELPER(
...) fprintf(stderr, __VA_ARGS__
)
#else
#define LOG_CHECKSUMHELPER(
x
...)
#define LOG_CHECKSUMHELPER(...)
#endif
// ChecksumCalculator adds checksum as an array of bytes to GL pipe communication, which
...
...
external/android-emugl/shared/OpenglCodecCommon/glUtils.h
浏览文件 @
b1edee8a
...
...
@@ -37,5 +37,5 @@ void glUtilsPackPointerData(unsigned char *dst, unsigned char *str,
int
glUtilsPixelBitSize
(
GLenum
format
,
GLenum
type
);
#ifdef __cplusplus
}
;
}
#endif
external/android-emugl/shared/emugl/common/logging.h
浏览文件 @
b1edee8a
...
...
@@ -14,6 +14,9 @@
* limitations under the License.
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wredundant-decls"
typedef
void
(
*
logger_t
)(
const
char
*
fmt
,
...);
extern
logger_t
emugl_logger
;
extern
logger_t
emugl_cxt_logger
;
...
...
@@ -35,3 +38,5 @@ void set_emugl_cxt_logger(logger_t f);
#else
#define GL_LOG(...) 0
#endif
#pragma GCC diagnostic pop
external/xdg/CMakeLists.txt
浏览文件 @
b1edee8a
...
...
@@ -19,6 +19,6 @@ enable_testing()
add_definitions
(
-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN -DBOOST_TEST_MODULE=xdg
)
add_executable
(
xdg_test xdg_test.cpp
)
set_property
(
TARGET xdg_test PROPERTY CXX_STANDARD 11
)
target_link_libraries
(
xdg_test xdg
)
target_link_libraries
(
xdg_test xdg
${
Boost_LIBRARIES
}
)
add_test
(
xdg_test xdg_test
)
src/anbox/cmds/container_manager.cpp
浏览文件 @
b1edee8a
...
...
@@ -26,7 +26,7 @@ anbox::cmds::ContainerManager::ContainerManager()
:
CommandWithFlagsAndAction
{
cli
::
Name
{
"container-manager"
},
cli
::
Usage
{
"container-manager"
},
cli
::
Description
{
"Start the container manager service"
}}
{
action
([](
const
cli
::
Command
::
Context
&
ctxt
)
{
action
([](
const
cli
::
Command
::
Context
&
)
{
auto
trap
=
core
::
posix
::
trap_signals_for_process
(
{
core
::
posix
::
Signal
::
sig_term
,
core
::
posix
::
Signal
::
sig_int
});
trap
->
signal_raised
().
connect
([
trap
](
const
core
::
posix
::
Signal
&
signal
)
{
...
...
src/anbox/cmds/run.cpp
浏览文件 @
b1edee8a
...
...
@@ -15,6 +15,8 @@
*
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wswitch-default"
#include <boost/filesystem.hpp>
#include "core/posix/signal.h"
...
...
@@ -46,6 +48,7 @@
#include <core/dbus/asio/executor.h>
#include <core/dbus/bus.h>
#pragma GCC diagnostic pop
namespace
fs
=
boost
::
filesystem
;
...
...
@@ -82,7 +85,7 @@ anbox::cmds::Run::Run(const BusFactory &bus_factory)
cli
::
Description
{
"Icon of the application to run"
},
icon_
));
action
([
this
](
const
cli
::
Command
::
Context
&
ctx
)
{
action
([
this
](
const
cli
::
Command
::
Context
&
)
{
auto
trap
=
core
::
posix
::
trap_signals_for_process
(
{
core
::
posix
::
Signal
::
sig_term
,
core
::
posix
::
Signal
::
sig_int
});
trap
->
signal_raised
().
connect
([
trap
](
const
core
::
posix
::
Signal
&
signal
)
{
...
...
src/anbox/common/scope_ptr.h
浏览文件 @
b1edee8a
...
...
@@ -25,7 +25,7 @@ namespace common {
struct
FreeDelete
{
template
<
class
T
>
void
operator
()(
T
ptr
)
const
{
free
(
(
void
*
)
ptr
);
free
(
ptr
);
}
};
...
...
src/anbox/common/small_vector.h
浏览文件 @
b1edee8a
...
...
@@ -207,7 +207,7 @@ class SmallVector {
void
set_capacity
(
size_type
newCap
)
{
// Here we can only be switching to the dynamic vector, as static one
// always has its capacity on the maximum.
const
auto
newBegin
=
(
T
*
)
malloc
(
sizeof
(
T
)
*
newCap
);
const
auto
newBegin
=
static_cast
<
T
*>
(
malloc
(
sizeof
(
T
)
*
newCap
)
);
if
(
!
newBegin
)
{
abort
();
// what else can we do here?
}
...
...
@@ -235,7 +235,7 @@ class SmallVector {
// This function returns that address, and SmallFixedVector<> has a static
// assert to make sure it remains correct.
constexpr
const
void
*
smallBufferStart
()
const
{
return
(
const
void
*
)
(
&
mCapacity
+
1
);
return
static_cast
<
const
void
*>
(
&
mCapacity
+
1
);
}
// Standard set of members for a vector - begin, end and capacity.
...
...
@@ -267,14 +267,6 @@ class SmallFixedVector : public SmallVector<T> {
// Default constructor - set up an empty vector with capacity at full
// internal array size.
SmallFixedVector
()
{
// Make sure that the small array starts exactly where base class
// expects it: right after the |mCapacity|.
static_assert
(
offsetof
(
base
,
mCapacity
)
+
sizeof
(
base
::
mCapacity
)
==
offsetof
(
SmallFixedVector
,
mData
)
&&
offsetof
(
Data
,
array
)
==
0
,
"SmallFixedVector<> class layout is wrong, "
"|mData| needs to follow |mCapacity|"
);
init_inplace
();
}
...
...
src/anbox/graphics/emugl/ColorBuffer.cpp
浏览文件 @
b1edee8a
...
...
@@ -32,7 +32,7 @@ namespace {
// implemented as unsigned integers. These convenience template functions
// help casting between them safely without generating compiler warnings.
inline
void
*
SafePointerFromUInt
(
unsigned
int
handle
)
{
return
(
void
*
)(
uintptr_t
)(
handle
);
return
reinterpret_cast
<
void
*>
(
static_cast
<
uintptr_t
>
(
handle
)
);
}
inline
unsigned
int
SafeUIntFromPointer
(
const
void
*
ptr
)
{
...
...
@@ -40,7 +40,7 @@ inline unsigned int SafeUIntFromPointer(const void* ptr) {
// Ignore the assert below to avoid crashing when running older
// system images, which might have buggy encoder libraries. Print
// an error message though.
if
(
(
uintptr_t
)(
ptr
)
!=
(
unsigned
int
)(
uintptr_t
)(
ptr
))
{
if
(
reinterpret_cast
<
uintptr_t
>
(
ptr
)
!=
static_cast
<
unsigned
int
>
(
reinterpret_cast
<
uintptr_t
>
(
ptr
)
))
{
fprintf
(
stderr
,
"EmuGL:WARNING: bad generic pointer %p
\n
"
,
ptr
);
}
#else
...
...
@@ -48,7 +48,7 @@ inline unsigned int SafeUIntFromPointer(const void* ptr) {
// in an unsigned integer!
assert
((
uintptr_t
)(
ptr
)
==
(
unsigned
int
)(
uintptr_t
)(
ptr
));
#endif
return
(
unsigned
int
)(
uintptr_t
)(
ptr
);
return
static_cast
<
unsigned
int
>
(
reinterpret_cast
<
uintptr_t
>
(
ptr
)
);
}
// Lazily create and bind a framebuffer object to the current host context.
...
...
@@ -181,11 +181,11 @@ ColorBuffer* ColorBuffer::create(EGLDisplay p_display, int p_width,
if
(
has_eglimage_texture_2d
)
{
cb
->
m_eglImage
=
s_egl
.
eglCreateImageKHR
(
p_display
,
s_egl
.
eglGetCurrentContext
(),
EGL_GL_TEXTURE_2D_KHR
,
(
EGLClientBuffer
)
SafePointerFromUInt
(
cb
->
m_tex
),
NULL
);
reinterpret_cast
<
EGLClientBuffer
>
(
SafePointerFromUInt
(
cb
->
m_tex
)
),
NULL
);
cb
->
m_blitEGLImage
=
s_egl
.
eglCreateImageKHR
(
p_display
,
s_egl
.
eglGetCurrentContext
(),
EGL_GL_TEXTURE_2D_KHR
,
(
EGLClientBuffer
)
SafePointerFromUInt
(
cb
->
m_blitTex
),
NULL
);
reinterpret_cast
<
EGLClientBuffer
>
(
SafePointerFromUInt
(
cb
->
m_blitTex
)
),
NULL
);
}
cb
->
m_resizer
=
new
TextureResize
(
p_width
,
p_height
);
...
...
src/anbox/graphics/emugl/ReadBuffer.cpp
浏览文件 @
b1edee8a
...
...
@@ -21,7 +21,7 @@
ReadBuffer
::
ReadBuffer
(
size_t
bufsize
)
{
m_size
=
bufsize
;
m_buf
=
(
unsigned
char
*
)
malloc
(
m_size
*
sizeof
(
unsigned
char
));
m_buf
=
static_cast
<
unsigned
char
*>
(
malloc
(
m_size
*
sizeof
(
unsigned
char
)
));
m_validData
=
0
;
m_readPtr
=
m_buf
;
}
...
...
@@ -43,7 +43,7 @@ int ReadBuffer::getData(IOStream* stream) {
new_size
=
INT_MAX
;
}
new_buf
=
(
unsigned
char
*
)
realloc
(
m_buf
,
new_size
);
new_buf
=
static_cast
<
unsigned
char
*>
(
realloc
(
m_buf
,
new_size
)
);
if
(
!
new_buf
)
{
ERR
(
"Failed to alloc %zu bytes for ReadBuffer
\n
"
,
new_size
);
return
-
1
;
...
...
src/anbox/graphics/emugl/RenderControl.cpp
浏览文件 @
b1edee8a
...
...
@@ -49,8 +49,8 @@ static EGLint rcGetEGLVersion(EGLint *major, EGLint *minor) {
if
(
!
renderer
)
return
EGL_FALSE
;
*
major
=
(
EGLint
)
renderer
->
getCaps
().
eglMajor
;
*
minor
=
(
EGLint
)
renderer
->
getCaps
().
eglMinor
;
*
major
=
static_cast
<
EGLint
>
(
renderer
->
getCaps
().
eglMajor
)
;
*
minor
=
static_cast
<
EGLint
>
(
renderer
->
getCaps
().
eglMinor
)
;
return
EGL_TRUE
;
}
...
...
@@ -69,7 +69,7 @@ static EGLint rcQueryEGLString(EGLenum name, void *buffer, EGLint bufferSize) {
return
-
len
;
}
strcpy
(
(
char
*
)
buffer
,
str
);
strcpy
(
static_cast
<
char
*>
(
buffer
)
,
str
);
return
len
;
}
...
...
@@ -131,7 +131,7 @@ static EGLint rcGetNumConfigs(uint32_t *p_numAttribs) {
}
static
EGLint
rcGetConfigs
(
uint32_t
bufSize
,
GLuint
*
buffer
)
{
GLuint
bufferSize
=
(
GLuint
)
bufSize
;
GLuint
bufferSize
=
static_cast
<
GLuint
>
(
bufSize
)
;
return
renderer
->
getConfigs
()
->
packConfigs
(
bufferSize
,
buffer
);
}
...
...
@@ -140,8 +140,8 @@ static EGLint rcChooseConfig(EGLint *attribs, uint32_t attribs_size,
if
(
!
renderer
||
attribs_size
==
0
)
return
0
;
return
renderer
->
getConfigs
()
->
chooseConfig
(
attribs
,
(
EGLint
*
)
configs
,
(
EGLint
)
configs_size
);
return
renderer
->
getConfigs
()
->
chooseConfig
(
attribs
,
reinterpret_cast
<
EGLint
*>
(
configs
)
,
static_cast
<
EGLint
>
(
configs_size
)
);
}
static
EGLint
rcGetFBParam
(
EGLint
param
)
{
...
...
@@ -269,9 +269,9 @@ static EGLint rcMakeCurrent(uint32_t context, uint32_t drawSurf,
return
(
ret
?
EGL_TRUE
:
EGL_FALSE
);
}
static
void
rcFBPost
(
uint32_t
colorBuffer
)
{
WARNING
(
"Not implemented"
);
}
static
void
rcFBPost
(
uint32_t
)
{
WARNING
(
"Not implemented"
);
}
static
void
rcFBSetSwapInterval
(
EGLint
interval
)
{
static
void
rcFBSetSwapInterval
(
EGLint
)
{
// XXX: TBD - should be implemented
}
...
...
@@ -289,8 +289,8 @@ static void rcBindRenderbuffer(uint32_t colorBuffer) {
renderer
->
bindColorBufferToRenderbuffer
(
colorBuffer
);
}
static
EGLint
rcColorBufferCacheFlush
(
uint32_t
colorBuffer
,
EGLint
postCount
,
int
forRead
)
{
static
EGLint
rcColorBufferCacheFlush
(
uint32_t
,
EGLint
,
int
)
{
// XXX: TBD - should be implemented
return
0
;
}
...
...
@@ -329,7 +329,7 @@ static int rcDestroyClientImage(uint32_t image) {
return
renderer
->
destroyClientImage
(
image
);
}
static
void
rcSelectChecksumCalculator
(
uint32_t
protocol
,
uint32_t
reserved
)
{
static
void
rcSelectChecksumCalculator
(
uint32_t
protocol
,
uint32_t
)
{
ChecksumCalculatorThreadInfo
::
setVersion
(
protocol
);
}
...
...
src/anbox/graphics/emugl/Renderer.cpp
浏览文件 @
b1edee8a
...
...
@@ -101,7 +101,7 @@ static char *getGLES1ExtensionString(EGLDisplay p_dpy) {
return
NULL
;
}
DBG
(
"%s: Found config %p
\n
"
,
__FUNCTION__
,
(
void
*
)
config
);
DBG
(
"%s: Found config %p
\n
"
,
__FUNCTION__
,
reinterpret_cast
<
void
*>
(
config
)
);
static
const
EGLint
pbufAttribs
[]
=
{
EGL_WIDTH
,
1
,
EGL_HEIGHT
,
1
,
EGL_NONE
};
...
...
@@ -130,7 +130,7 @@ static char *getGLES1ExtensionString(EGLDisplay p_dpy) {
}
// the string pointer may become invalid when the context is destroyed
const
char
*
s
=
(
const
char
*
)
s_gles1
.
glGetString
(
GL_EXTENSIONS
);
const
char
*
s
=
reinterpret_cast
<
const
char
*>
(
s_gles1
.
glGetString
(
GL_EXTENSIONS
)
);
char
*
extString
=
strdup
(
s
?
s
:
""
);
s_egl
.
eglMakeCurrent
(
p_dpy
,
NULL
,
NULL
,
NULL
);
...
...
@@ -273,7 +273,7 @@ bool Renderer::initialize(EGLNativeDisplayType nativeDisplay) {
if
(
has_gl_oes_image
)
{
has_gl_oes_image
&=
strstr
(
gles1Extensions
,
"GL_OES_EGL_image"
)
!=
NULL
;
}
free
(
(
void
*
)
gles1Extensions
);
free
(
gles1Extensions
);
gles1Extensions
=
NULL
;
const
char
*
eglExtensions
=
...
...
@@ -351,9 +351,9 @@ bool Renderer::initialize(EGLNativeDisplayType nativeDisplay) {
// Cache the GL strings so we don't have to think about threading or
// current-context when asked for them.
//
m_glVendor
=
(
const
char
*
)
s_gles2
.
glGetString
(
GL_VENDOR
);
m_glRenderer
=
(
const
char
*
)
s_gles2
.
glGetString
(
GL_RENDERER
);
m_glVersion
=
(
const
char
*
)
s_gles2
.
glGetString
(
GL_VERSION
);
m_glVendor
=
reinterpret_cast
<
const
char
*>
(
s_gles2
.
glGetString
(
GL_VENDOR
)
);
m_glRenderer
=
reinterpret_cast
<
const
char
*>
(
s_gles2
.
glGetString
(
GL_RENDERER
)
);
m_glVersion
=
reinterpret_cast
<
const
char
*>
(
s_gles2
.
glGetString
(
GL_VERSION
)
);
m_textureDraw
=
new
TextureDraw
(
m_eglDisplay
);
if
(
!
m_textureDraw
)
{
...
...
@@ -831,7 +831,7 @@ HandleType Renderer::createClientImage(HandleType context, EGLenum target,
s_egl
.
eglCreateImageKHR
(
m_eglDisplay
,
eglContext
,
target
,
reinterpret_cast
<
EGLClientBuffer
>
(
buffer
),
NULL
);
return
(
HandleType
)
reinterpret_cast
<
uintptr_t
>
(
image
);
return
static_cast
<
HandleType
>
(
reinterpret_cast
<
uintptr_t
>
(
image
)
);
}
EGLBoolean
Renderer
::
destroyClientImage
(
HandleType
image
)
{
...
...
@@ -1022,7 +1022,9 @@ void Renderer::draw(RendererWindow *window, const Renderable &renderable,
s_gles2
.
glEnableVertexAttribArray
(
prog
.
texcoord_attr
);
m_primitives
.
clear
();
tessellate
(
m_primitives
,
{
cb
->
getWidth
(),
cb
->
getHeight
()},
renderable
);
tessellate
(
m_primitives
,
{
static_cast
<
int32_t
>
(
cb
->
getWidth
()),
static_cast
<
int32_t
>
(
cb
->
getHeight
())},
renderable
);
for
(
auto
const
&
p
:
m_primitives
)
{
cb
->
bind
();
...
...
src/anbox/graphics/emugl/RendererConfig.cpp
浏览文件 @
b1edee8a
...
...
@@ -90,7 +90,7 @@ RendererConfigList::RendererConfigList(EGLDisplay display)
:
mCount
(
0
),
mConfigs
(
NULL
),
mDisplay
(
display
)
{
if
(
display
==
EGL_NO_DISPLAY
)
{
E
(
"%s: Invalid display value %p (EGL_NO_DISPLAY)
\n
"
,
__FUNCTION__
,
(
void
*
)
display
);
reinterpret_cast
<
void
*>
(
display
)
);
return
;
}
...
...
@@ -199,7 +199,7 @@ int RendererConfigList::chooseConfig(const EGLint* attribs, EGLint* configs,
if
(
guestConfigId
==
hostConfigId
)
{
// There is a match. Write it to |configs| if it is not NULL.
if
(
configs
&&
result
<
configsSize
)
{
configs
[
result
]
=
(
uint32_t
)
k
;
configs
[
result
]
=
static_cast
<
uint32_t
>
(
k
)
;
}
result
++
;
break
;
...
...
src/anbox/graphics/emugl/RendererConfig.h
浏览文件 @
b1edee8a
...
...
@@ -54,7 +54,7 @@ class RendererConfig {
// Get the EGL_CONFIG_ID value. This is the same as the one of the
// underlying host EGLConfig handle.
GLint
getConfigId
()
const
{
return
(
GLint
)
getAttribValue
(
4
);
}
GLint
getConfigId
()
const
{
return
static_cast
<
GLint
>
(
getAttribValue
(
4
)
);
}
private:
RendererConfig
();
...
...
src/anbox/graphics/emugl/TextureResize.cpp
浏览文件 @
b1edee8a
...
...
@@ -189,13 +189,7 @@ static void attachShaders(TextureResize::Framebuffer* fb,
TextureResize
::
TextureResize
(
GLuint
width
,
GLuint
height
)
:
mWidth
(
width
),
mHeight
(
height
),
mFactor
(
1
),
mFBWidth
({
0
,
}),
mFBHeight
({
0
,
})
{
mFactor
(
1
)
{
s_gles2
.
glGenTextures
(
1
,
&
mFBWidth
.
texture
);
s_gles2
.
glBindTexture
(
GL_TEXTURE_2D
,
mFBWidth
.
texture
);
s_gles2
.
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
GL_NEAREST
);
...
...
src/anbox/graphics/emugl/TextureResize.h
浏览文件 @
b1edee8a
...
...
@@ -28,11 +28,11 @@ class TextureResize {
GLuint
update
(
GLuint
texture
);
struct
Framebuffer
{
GLuint
texture
;
GLuint
framebuffer
;
GLuint
program
;
GLuint
aPosition
;
GLuint
uTexture
;
GLuint
texture
=
0
;
GLuint
framebuffer
=
0
;
GLuint
program
=
0
;
GLuint
aPosition
=
0
;
GLuint
uTexture
=
0
;
};
private:
...
...
src/anbox/graphics/emugl/WindowSurface.cpp
浏览文件 @
b1edee8a
...
...
@@ -152,7 +152,7 @@ bool WindowSurface::resize(unsigned int p_width, unsigned int p_height) {
// Create pbuffer surface.
//
const
EGLint
pbufAttribs
[
5
]
=
{
EGL_WIDTH
,
(
EGLint
)
p_width
,
EGL_HEIGHT
,
(
EGLint
)
p_height
,
EGL_NONE
,
EGL_WIDTH
,
static_cast
<
EGLint
>
(
p_width
),
EGL_HEIGHT
,
static_cast
<
EGLint
>
(
p_height
)
,
EGL_NONE
,
};
mSurface
=
s_egl
.
eglCreatePbufferSurface
(
mDisplay
,
mConfig
,
pbufAttribs
);
...
...
src/anbox/qemu/pipe_connection_creator.cpp
浏览文件 @
b1edee8a
...
...
@@ -57,6 +57,8 @@ std::string client_type_to_string(
return
"boot-animation"
;
case
anbox
::
qemu
::
PipeConnectionCreator
::
client_type
::
invalid
:
break
;
default:
break
;
}
return
"unknown"
;
}
...
...
src/anbox/qemu/qemud_message_processor.cpp
浏览文件 @
b1edee8a
...
...
@@ -71,7 +71,7 @@ void QemudMessageProcessor::process_commands() {
void
QemudMessageProcessor
::
send_header
(
const
size_t
&
size
)
{
char
header
[
header_size
+
1
];
std
::
snprintf
(
header
,
header_size
+
1
,
"%04
x
"
,
size
);
std
::
snprintf
(
header
,
header_size
+
1
,
"%04
lu
"
,
size
);
messenger_
->
send
(
header
,
header_size
);
}
...
...
src/anbox/rpc/message_processor.h
浏览文件 @
b1edee8a
...
...
@@ -58,8 +58,8 @@ class MessageProcessor : public network::MessageProcessor {
void
send_response
(
::
google
::
protobuf
::
uint32
id
,
google
::
protobuf
::
MessageLite
*
response
);
virtual
void
dispatch
(
Invocation
const
&
invocation
)
{}
virtual
void
process_event_sequence
(
const
std
::
string
&
event
)
{}
virtual
void
dispatch
(
Invocation
const
&
)
{}
virtual
void
process_event_sequence
(
const
std
::
string
&
)
{}
private:
std
::
shared_ptr
<
network
::
MessageSender
>
sender_
;
...
...
src/anbox/ubuntu/audio_sink.cpp
浏览文件 @
b1edee8a
...
...
@@ -72,7 +72,7 @@ void AudioSink::disconnect_audio() {
void
AudioSink
::
read_data
(
std
::
uint8_t
*
buffer
,
int
size
)
{
std
::
unique_lock
<
std
::
mutex
>
l
(
lock_
);
const
auto
wanted
=
size
;
size_
t
count
=
0
;
in
t
count
=
0
;
auto
dst
=
buffer
;
while
(
count
<
wanted
)
{
...
...
src/anbox/ubuntu/keycode_converter.cpp
浏览文件 @
b1edee8a
...
...
@@ -14,8 +14,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wswitch-default"
#include "anbox/ubuntu/keycode_converter.h"
#pragma GCC diagnostic pop
#include <linux/input.h>
...
...
src/anbox/ubuntu/platform_policy.cpp
浏览文件 @
b1edee8a
...
...
@@ -15,6 +15,8 @@
*
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wswitch-default"
#include "anbox/ubuntu/platform_policy.h"
#include "anbox/bridge/android_api_stub.h"
#include "anbox/input/device.h"
...
...
@@ -28,6 +30,7 @@
#include <signal.h>
#include <sys/types.h>
#pragma GCC diagnostic pop
namespace
anbox
{
namespace
ubuntu
{
...
...
@@ -123,6 +126,8 @@ void PlatformPolicy::process_events() {
case
SDL_KEYUP
:
process_input_event
(
event
);
break
;
default:
break
;
}
}
}
...
...
src/anbox/ubuntu/window.cpp
浏览文件 @
b1edee8a
...
...
@@ -15,6 +15,8 @@
*
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wswitch-default"
#include "anbox/ubuntu/window.h"
#include "anbox/logger.h"
#include "anbox/wm/window_state.h"
...
...
@@ -22,6 +24,7 @@
#include <boost/throw_exception.hpp>
#include <SDL_syswm.h>
#pragma GCC diagnostic pop
namespace
anbox
{
namespace
ubuntu
{
...
...
@@ -93,6 +96,8 @@ void Window::process_event(const SDL_Event &event) {
case
SDL_WINDOWEVENT_CLOSE
:
if
(
observer_
)
observer_
->
window_deleted
(
id_
);
break
;
default:
break
;
}
}
...
...
tests/anbox/graphics/buffer_queue_tests.cpp
浏览文件 @
b1edee8a
...
...
@@ -124,7 +124,7 @@ class TestThread final {
// Call end_pop() to get the command's result, as well as the popped
// buffer if it is 0.
bool
start_pop
()
{
input_
.
send
(
Request
{
Cmd
::
Pop
});
input_
.
send
(
Request
{
Cmd
::
Pop
,
Buffer
{}
});
return
true
;
}
...
...
@@ -140,12 +140,12 @@ class TestThread final {
// Tell the test thread to close the queue from its side.
void
do_close
()
{
input_
.
send
(
Request
{
Cmd
::
Close
});
input_
.
send
(
Request
{
Cmd
::
Close
,
Buffer
{}
});
}
// Tell the test thread to stop after completing its current command.
void
stop
()
{
input_
.
send
(
Request
{
Cmd
::
Stop
});
input_
.
send
(
Request
{
Cmd
::
Stop
,
Buffer
{}
});
thread_
.
join
();
}
...
...
tests/anbox/graphics/buffered_io_stream_tests.cpp
浏览文件 @
b1edee8a
...
...
@@ -130,10 +130,11 @@ TEST(BufferedIOStream, ReadWithNoDataAvailable) {
}
});
size_t
size
{
10
};
constexpr
size_t
size
{
10
};
std
::
uint8_t
read_data
[
size
]
=
{
0x0
};
EXPECT_NE
(
nullptr
,
stream
.
read
(
read_data
,
&
size
));
EXPECT_EQ
(
2
,
size
);
size_t
read
=
10
;
EXPECT_NE
(
nullptr
,
stream
.
read
(
read_data
,
&
read
));
EXPECT_EQ
(
2
,
read
);
EXPECT_EQ
(
0x12
,
read_data
[
0
]);
EXPECT_EQ
(
0x34
,
read_data
[
1
]);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录