Skip to content

Commit

Permalink
Merge branch 'master' into container-network-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
morphis authored Apr 22, 2019
2 parents 8538647 + 6097cb2 commit 99b17ad
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 31 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMESA_EGL_NO_X11_HEADERS")

if(Protobuf_VERSION GREATER_EQUAL "3.7")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_PROTOBUF_CALLBACK_HEADER")
endif()

#####################################################################
# Enable code coverage calculation with gcov/gcovr/lcov
# Usage:
Expand Down
2 changes: 1 addition & 1 deletion android/opengl/system/gralloc/gralloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ static int gralloc_lock(gralloc_module_t const* module,
if (sw_read) {
D("gralloc_lock read back color buffer %d %d\n", cb->width, cb->height);
rcEnc->rcReadColorBuffer(rcEnc, cb->hostHandle,
0, 0, cb->width, cb->height, GL_RGBA, GL_UNSIGNED_BYTE, cpu_addr);
0, 0, cb->width, cb->height, cb->glFormat, cb->glType, cpu_addr);
}
}

Expand Down
35 changes: 26 additions & 9 deletions external/android-emugl/host/libs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
set(GENERATED_SOURCES
FUNCTION(PREPEND var prefix)
SET(listVar "")
FOREACH(f ${ARGN})
LIST(APPEND listVar "${prefix}/${f}")
ENDFOREACH(f)
SET(${var} "${listVar}" PARENT_SCOPE)
ENDFUNCTION(PREPEND)

PREPEND(GLHEADERS_SOURCES libOpenGLESDispatch/
render_egl_extensions.entries
render_egl.entries
gles_common.entries
gles_extensions.entries
gles1_only.entries
gles1_extensions.entries
gles2_only.entries
gles2_extensions.entries
gles3_only.entries)

PREPEND(GLHEADERS_GENERATED_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/../include/OpenGLESDispatch/
gles1_extensions_functions.h
gles1_only_functions.h
gles2_extensions_functions.h
gles2_only_functions.h
gles3_only_functions.h
gles_common_functions.h
gles_extensions_functions.h
gles_functions.h
RenderEGL_extensions_functions.h
RenderEGL_functions.h)

add_custom_target(GLHeaders)
add_custom_command(
TARGET GLHeaders
POST_BUILD
OUTPUT ${GLHEADERS_GENERATED_SOURCES}
COMMAND ${CMAKE_SOURCE_DIR}/scripts/gen-emugl-headers.sh ${CMAKE_BINARY_DIR}
DEPENDS ${GLHEADERS_SOURCES}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})

add_subdirectory(GLESv1_dec)
add_subdirectory(GLESv2_dec)
add_subdirectory(libOpenGLESDispatch)
add_subdirectory(renderControl_dec)
include(GLESv1_dec/CMakeLists.txt)
include(GLESv2_dec/CMakeLists.txt)
include(libOpenGLESDispatch/CMakeLists.txt)
include(renderControl_dec/CMakeLists.txt)
15 changes: 8 additions & 7 deletions external/android-emugl/host/libs/GLESv1_dec/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
set(GENERATED_SOURCES
set(CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/GLESv1_dec)

PREPEND(GENERATED_SOURCES ${CURRENT_BINARY_DIR}/
gles1_dec.cpp
gles1_opcodes.h
gles1_server_context.cpp)

add_custom_command(
OUTPUT ${GENERATED_SOURCES}
POST_BUILD
COMMAND ${CMAKE_BINARY_DIR}/external/android-emugl/host/tools/emugen/emugen
-D ${CMAKE_CURRENT_BINARY_DIR} gles1
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND mkdir -p ${CURRENT_BINARY_DIR} && ${CMAKE_BINARY_DIR}/external/android-emugl/host/tools/emugen/emugen
-D ${CURRENT_BINARY_DIR} gles1
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
DEPENDS emugen)

set(SOURCES
PREPEND(SOURCES ${CMAKE_CURRENT_LIST_DIR}/
GLESv1Decoder.cpp)

if ("${cmake_build_type_lower}" STREQUAL "trace")
Expand All @@ -20,6 +22,5 @@ if ("${cmake_build_type_lower}" STREQUAL "trace")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPENGL_DEBUG}")
endif()

add_library(GLESv1_dec STATIC ${SOURCES} ${GENERATED_SOURCES})
add_dependencies(GLESv1_dec GLHeaders)
add_library(GLESv1_dec STATIC ${SOURCES} ${GENERATED_SOURCES} ${GLHEADERS_GENERATED_SOURCES})
target_link_libraries(GLESv1_dec OpenglCodecCommon)
15 changes: 8 additions & 7 deletions external/android-emugl/host/libs/GLESv2_dec/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
set(GENERATED_SOURCES
set(CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/GLESv2_dec)

PREPEND(GENERATED_SOURCES ${CURRENT_BINARY_DIR}/
gles2_dec.cpp
gles2_opcodes.h
gles2_server_context.cpp)

add_custom_command(
OUTPUT ${GENERATED_SOURCES}
POST_BUILD
COMMAND ${CMAKE_BINARY_DIR}/external/android-emugl/host/tools/emugen/emugen
-D ${CMAKE_CURRENT_BINARY_DIR} gles2
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND mkdir -p ${CURRENT_BINARY_DIR} && ${CMAKE_BINARY_DIR}/external/android-emugl/host/tools/emugen/emugen
-D ${CURRENT_BINARY_DIR} gles2
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
DEPENDS emugen)

set(SOURCES
PREPEND(SOURCES ${CMAKE_CURRENT_LIST_DIR}/
GLESv2Decoder.cpp)

if ("${cmake_build_type_lower}" STREQUAL "trace")
Expand All @@ -20,6 +22,5 @@ if ("${cmake_build_type_lower}" STREQUAL "trace")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPENGL_DEBUG}")
endif()

add_library(GLESv2_dec STATIC ${SOURCES} ${GENERATED_SOURCES})
add_dependencies(GLESv2_dec GLHeaders)
add_library(GLESv2_dec STATIC ${SOURCES} ${GENERATED_SOURCES} ${GLHEADERS_GENERATED_SOURCES})
target_link_libraries(GLESv2_dec OpenglCodecCommon)
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
set(SOURCES
PREPEND(SOURCES ${CMAKE_CURRENT_LIST_DIR}/
EGLDispatch.cpp
GLESv2Dispatch.cpp
GLESv1Dispatch.cpp)

add_library(OpenGLESDispatch STATIC ${SOURCES})
add_dependencies(OpenGLESDispatch GLHeaders)
add_library(OpenGLESDispatch STATIC ${SOURCES} ${GLHEADERS_GENERATED_SOURCES})
target_link_libraries(OpenGLESDispatch
emugl_common
GLESv2_dec
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
set(GENERATED_SOURCES
set(CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/GLESv1_dec)

PREPEND(GENERATED_SOURCES ${CURRENT_BINARY_DIR}/
renderControl_dec.cpp
renderControl_server_context.cpp)

add_custom_command(
OUTPUT ${GENERATED_SOURCES}
POST_BUILD
COMMAND ${CMAKE_BINARY_DIR}/external/android-emugl/host/tools/emugen/emugen
-D ${CMAKE_CURRENT_BINARY_DIR} renderControl
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND mkdir -p ${CURRENT_BINARY_DIR} && ${CMAKE_BINARY_DIR}/external/android-emugl/host/tools/emugen/emugen
-D ${CURRENT_BINARY_DIR} renderControl
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
DEPENDS emugen)

if ("${cmake_build_type_lower}" STREQUAL "trace")
Expand Down
4 changes: 4 additions & 0 deletions src/anbox/bridge/android_api_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#include "anbox_rpc.pb.h"

#include <boost/filesystem.hpp>
#ifdef USE_PROTOBUF_CALLBACK_HEADER
#include <google/protobuf/stubs/callback.h>
#endif


namespace fs = boost::filesystem;

Expand Down
4 changes: 4 additions & 0 deletions src/anbox/bridge/platform_api_skeleton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

#include "anbox_bridge.pb.h"

#ifdef USE_PROTOBUF_CALLBACK_HEADER
#include <google/protobuf/stubs/callback.h>
#endif

namespace anbox {
namespace bridge {
PlatformApiSkeleton::PlatformApiSkeleton(
Expand Down
4 changes: 4 additions & 0 deletions src/anbox/container/management_api_skeleton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#include "anbox_container.pb.h"
#include "anbox_rpc.pb.h"

#ifdef USE_PROTOBUF_CALLBACK_HEADER
#include <google/protobuf/stubs/callback.h>
#endif

namespace anbox {
namespace container {
ManagementApiSkeleton::ManagementApiSkeleton(
Expand Down
4 changes: 4 additions & 0 deletions src/anbox/container/management_api_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
#include "anbox_container.pb.h"
#include "anbox_rpc.pb.h"

#ifdef USE_PROTOBUF_CALLBACK_HEADER
#include <google/protobuf/stubs/callback.h>
#endif

namespace anbox {
namespace container {

Expand Down
4 changes: 4 additions & 0 deletions src/anbox/rpc/pending_call_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

#include "anbox_rpc.pb.h"

#ifdef USE_PROTOBUF_CALLBACK_HEADER
#include <google/protobuf/stubs/callback.h>
#endif

namespace anbox {
namespace rpc {
PendingCallCache::PendingCallCache() {}
Expand Down
3 changes: 3 additions & 0 deletions src/anbox/rpc/template_message_processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
#define ANBOX_RPC_TEMPLATE_MESSAGE_PROCESSOR_H_

#include <google/protobuf/stubs/common.h>
#ifdef USE_PROTOBUF_CALLBACK_HEADER
#include <google/protobuf/stubs/callback.h>
#endif

#include "anbox/rpc/message_processor.h"

Expand Down

0 comments on commit 99b17ad

Please sign in to comment.