egl: refactor to use DETECT_OS_ANDROID instead of ANDROID
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27374>
This commit is contained in:
@@ -93,6 +93,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "c11/threads.h"
|
#include "c11/threads.h"
|
||||||
#include "mapi/glapi/glapi.h"
|
#include "mapi/glapi/glapi.h"
|
||||||
|
#include "util/detect_os.h"
|
||||||
#include "util/macros.h"
|
#include "util/macros.h"
|
||||||
#include "util/perf/cpu_trace.h"
|
#include "util/perf/cpu_trace.h"
|
||||||
#include "util/u_debug.h"
|
#include "util/u_debug.h"
|
||||||
@@ -652,7 +653,7 @@ _eglComputeVersion(_EGLDisplay *disp)
|
|||||||
disp->Version = 15;
|
disp->Version = 15;
|
||||||
|
|
||||||
/* For Android P and below limit the EGL version to 1.4 */
|
/* For Android P and below limit the EGL version to 1.4 */
|
||||||
#if defined(ANDROID) && ANDROID_API_LEVEL <= 28
|
#if DETECT_OS_ANDROID && ANDROID_API_LEVEL <= 28
|
||||||
disp->Version = 14;
|
disp->Version = 14;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@@ -30,6 +30,8 @@
|
|||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#include "util/detect_os.h"
|
||||||
|
|
||||||
#include "egltypedefs.h"
|
#include "egltypedefs.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@@ -64,7 +66,7 @@ struct _egl_thread_info {
|
|||||||
static inline EGLBoolean
|
static inline EGLBoolean
|
||||||
_eglIsApiValid(EGLenum api)
|
_eglIsApiValid(EGLenum api)
|
||||||
{
|
{
|
||||||
#if HAVE_OPENGL && !defined(ANDROID)
|
#if HAVE_OPENGL && !DETECT_OS_ANDROID
|
||||||
/* OpenGL is not a valid/supported API on Android */
|
/* OpenGL is not a valid/supported API on Android */
|
||||||
if (api == EGL_OPENGL_API)
|
if (api == EGL_OPENGL_API)
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user