Commit ca05a081 by Yuly Novikov Committed by Commit Bot

Compile deqp_gles2 on Android

Add some missing functions, modify preprocessor conditions and build files to include some other missing functions when building for Android. BUG=angleproject:1471 Change-Id: Iadc0a0b9fed2444b8bc9a894ee65c8b66ea7f3c9 Reviewed-on: https://chromium-review.googlesource.com/368982 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 91e71ed9
...@@ -172,13 +172,17 @@ if (build_angle_deqp_tests) { ...@@ -172,13 +172,17 @@ if (build_angle_deqp_tests) {
defines = deqp_gypi.deqp_defines defines = deqp_gypi.deqp_defines
defines += [ "_MBCS" ] defines += [ "_MBCS" ]
# Ask the system headers to expose all the regular function otherwise
# dEQP doesn't compile and produces warnings about implicitly defined
# functions.
if (is_linux) { if (is_linux) {
# Ask the system headers to expose all the regular function otherwise
# dEQP doesn't compile and produces warnings about implicitly defined
# functions.
# This has to be GNU_SOURCE as on Linux dEQP uses syscall() # This has to be GNU_SOURCE as on Linux dEQP uses syscall()
defines += [ "_GNU_SOURCE" ] defines += [ "_GNU_SOURCE" ]
} }
if (is_android) {
# _XOPEN_SOURCE=600 is what is used in deqp/src/Android.mk
defines += [ "_XOPEN_SOURCE=600" ]
}
} }
deqp_undefine_configs = [ deqp_undefine_configs = [
...@@ -194,7 +198,7 @@ if (build_angle_deqp_tests) { ...@@ -194,7 +198,7 @@ if (build_angle_deqp_tests) {
] ]
} }
if (is_linux) { if (is_linux || is_android) {
deqp_undefine_configs += [ "//build/config/gcc:no_exceptions" ] deqp_undefine_configs += [ "//build/config/gcc:no_exceptions" ]
} }
...@@ -230,10 +234,13 @@ if (build_angle_deqp_tests) { ...@@ -230,10 +234,13 @@ if (build_angle_deqp_tests) {
if (is_win) { if (is_win) {
sources += rebase_path(deqp_gypi.deqp_libtester_sources_win, ".", "../..") sources += rebase_path(deqp_gypi.deqp_libtester_sources_win, ".", "../..")
} }
if (is_linux) { if (is_linux || is_android) {
sources += sources +=
rebase_path(deqp_gypi.deqp_libtester_sources_unix, ".", "../..") rebase_path(deqp_gypi.deqp_libtester_sources_unix, ".", "../..")
} }
if (is_android) {
libs = [ "log" ]
}
} }
config("angle_deqp_gtest_support_config") { config("angle_deqp_gtest_support_config") {
...@@ -331,6 +338,10 @@ if (build_angle_deqp_tests) { ...@@ -331,6 +338,10 @@ if (build_angle_deqp_tests) {
# Set rpath to find *.so files even in a non-component build. # Set rpath to find *.so files even in a non-component build.
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
} }
if (is_android) {
use_native_activity = true
}
} }
} }
} }
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include <sys/unistd.h> #include <sys/unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#elif (DE_OS == DE_OS_ANDROID)
#include <sys/stat.h>
#endif #endif
tcu::Platform *createPlatform(); tcu::Platform *createPlatform();
...@@ -68,7 +70,7 @@ deBool deIsDir(const char *filename) ...@@ -68,7 +70,7 @@ deBool deIsDir(const char *filename)
return false; return false;
} }
#elif (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_OSX) #elif (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_OSX) || (DE_OS == DE_OS_ANDROID)
deBool deIsDir(const char *filename) deBool deIsDir(const char *filename)
{ {
struct stat st; struct stat st;
......
...@@ -32,15 +32,17 @@ ...@@ -32,15 +32,17 @@
#include "OSWindow.h" #include "OSWindow.h"
#include "tcuTexture.hpp" #include "tcuTexture.hpp"
// clang-format off
#if (DE_OS == DE_OS_WIN32) #if (DE_OS == DE_OS_WIN32)
#define ANGLE_EGL_LIBRARY_NAME "libEGL.dll" #define ANGLE_EGL_LIBRARY_NAME "libEGL.dll"
#elif (DE_OS == DE_OS_UNIX) #elif (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_ANDROID)
#define ANGLE_EGL_LIBRARY_NAME "libEGL.so" #define ANGLE_EGL_LIBRARY_NAME "libEGL.so"
#elif (DE_OS == DE_OS_OSX) #elif (DE_OS == DE_OS_OSX)
#define ANGLE_EGL_LIBRARY_NAME "libEGL.dylib" #define ANGLE_EGL_LIBRARY_NAME "libEGL.dylib"
#else #else
#error "Unsupported platform" #error "Unsupported platform"
#endif #endif
// clang-format on
namespace tcu namespace tcu
{ {
......
...@@ -49,8 +49,11 @@ namespace base ...@@ -49,8 +49,11 @@ namespace base
} }
// TODO(jmadill): other platforms // TODO(jmadill): other platforms
// clang-format off
#if defined(_WIN32) || defined(_WIN64) #if defined(_WIN32) || defined(_WIN64)
# define OS_WIN # define OS_WIN
#elif defined(ANDROID)
# define OS_ANDROID
#elif defined(__linux__) #elif defined(__linux__)
# define OS_LINUX # define OS_LINUX
#elif defined(__APPLE__) #elif defined(__APPLE__)
...@@ -58,5 +61,6 @@ namespace base ...@@ -58,5 +61,6 @@ namespace base
#else #else
# error "Unsupported platform" # error "Unsupported platform"
#endif #endif
// clang-format on
#endif #endif
...@@ -191,6 +191,16 @@ CollectInfoResult CollectGpuID(uint32* vendor_id, uint32* device_id) { ...@@ -191,6 +191,16 @@ CollectInfoResult CollectGpuID(uint32* vendor_id, uint32* device_id) {
#endif #endif
#if defined(OS_ANDROID)
CollectInfoResult CollectGpuID(uint32 *vendor_id, uint32 *device_id)
{
DCHECK(vendor_id && device_id);
*vendor_id = 0;
*device_id = 0;
return kCollectInfoNonFatalFailure;
}
#endif // defined(OS_ANDROID)
namespace gpu { namespace gpu {
namespace { namespace {
......
//
// Copyright (c) 2016 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// AndroidPixmap.cpp: Implementation of OSPixmap for Android
#include "OSPixmap.h"
OSPixmap *CreateOSPixmap()
{
return nullptr;
}
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
], ],
'util_android_sources': 'util_android_sources':
[ [
'android/AndroidPixmap.cpp',
'android/AndroidWindow.cpp', 'android/AndroidWindow.cpp',
'android/AndroidWindow.h', 'android/AndroidWindow.h',
'android/third_party/android_native_app_glue.c', 'android/third_party/android_native_app_glue.c',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment