summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'opengl')
-rw-r--r--opengl/libs/Android.mk2
-rw-r--r--opengl/libs/EGL/egl_display.h2
-rw-r--r--opengl/libs/EGL/getProcAddress.cpp4
-rw-r--r--opengl/libs/GLES2/gl2.cpp6
-rw-r--r--opengl/libs/GLES_CM/gl.cpp4
-rw-r--r--opengl/libs/GLES_trace/Android.mk7
-rw-r--r--opengl/tests/EGLTest/Android.mk12
-rw-r--r--opengl/tests/hwc/Android.mk71
-rw-r--r--opengl/tests/hwc/hwcColorEquiv.cpp3
-rw-r--r--opengl/tests/hwc/hwcCommit.cpp1
-rw-r--r--opengl/tests/hwc/hwcRects.cpp2
-rw-r--r--opengl/tests/hwc/hwcTestLib.cpp19
-rw-r--r--opengl/tests/lib/Android.mk7
-rw-r--r--opengl/tools/glgen/stubs/egl/EGL14cHeader.cpp4
-rw-r--r--opengl/tools/glgen/stubs/egl/EGLExtcHeader.cpp20
-rw-r--r--opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp4
-rw-r--r--opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp4
-rw-r--r--opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp4
-rw-r--r--opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp4
-rw-r--r--opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp4
-rw-r--r--opengl/tools/glgen/stubs/gles11/GLES30cHeader.cpp4
-rw-r--r--opengl/tools/glgen/stubs/gles11/GLES31ExtcHeader.cpp4
-rw-r--r--opengl/tools/glgen/stubs/gles11/GLES31cHeader.cpp4
-rw-r--r--opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp2
-rw-r--r--opengl/tools/glgen/stubs/gles11/glDrawElementsIndirect.cpp2
-rw-r--r--opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp4
26 files changed, 104 insertions, 100 deletions
diff --git a/opengl/libs/Android.mk b/opengl/libs/Android.mk
index cc5d544..2c66f3d 100644
--- a/opengl/libs/Android.mk
+++ b/opengl/libs/Android.mk
@@ -77,6 +77,7 @@ LOCAL_SRC_FILES:= \
GLES_CM/gl.cpp.arm \
#
+LOCAL_CLANG := false
LOCAL_SHARED_LIBRARIES += libcutils liblog libEGL
LOCAL_MODULE:= libGLESv1_CM
@@ -101,6 +102,7 @@ LOCAL_SRC_FILES:= \
GLES2/gl2.cpp.arm \
#
+LOCAL_CLANG := false
LOCAL_SHARED_LIBRARIES += libcutils libutils liblog libEGL
LOCAL_MODULE:= libGLESv2
diff --git a/opengl/libs/EGL/egl_display.h b/opengl/libs/EGL/egl_display.h
index 87f27f8..0a6e425 100644
--- a/opengl/libs/EGL/egl_display.h
+++ b/opengl/libs/EGL/egl_display.h
@@ -39,7 +39,7 @@ namespace android {
class egl_object_t;
class egl_context_t;
-class egl_connection_t;
+struct egl_connection_t;
// ----------------------------------------------------------------------------
diff --git a/opengl/libs/EGL/getProcAddress.cpp b/opengl/libs/EGL/getProcAddress.cpp
index fc61134..dcac2b2 100644
--- a/opengl/libs/EGL/getProcAddress.cpp
+++ b/opengl/libs/EGL/getProcAddress.cpp
@@ -78,7 +78,7 @@ namespace android {
#elif defined(__i386__)
- #define API_ENTRY(_api) __attribute__((noinline)) _api
+ #define API_ENTRY(_api) __attribute__((noinline,optimize("omit-frame-pointer"))) _api
#define CALL_GL_EXTENSION_API(_api) \
register void** fn; \
@@ -100,7 +100,7 @@ namespace android {
#elif defined(__x86_64__)
- #define API_ENTRY(_api) __attribute__((noinline)) _api
+ #define API_ENTRY(_api) __attribute__((noinline,optimize("omit-frame-pointer"))) _api
#define CALL_GL_EXTENSION_API(_api) \
register void** fn; \
diff --git a/opengl/libs/GLES2/gl2.cpp b/opengl/libs/GLES2/gl2.cpp
index b07228f..0fb8965 100644
--- a/opengl/libs/GLES2/gl2.cpp
+++ b/opengl/libs/GLES2/gl2.cpp
@@ -82,7 +82,7 @@ using namespace android;
#elif defined(__i386__)
- #define API_ENTRY(_api) __attribute__((noinline)) _api
+ #define API_ENTRY(_api) __attribute__((noinline,optimize("omit-frame-pointer"))) _api
#define CALL_GL_API(_api, ...) \
register void** fn; \
@@ -101,7 +101,7 @@ using namespace android;
#elif defined(__x86_64__)
- #define API_ENTRY(_api) __attribute__((noinline)) _api
+ #define API_ENTRY(_api) __attribute__((noinline,optimize("omit-frame-pointer"))) _api
#define CALL_GL_API(_api, ...) \
register void** fn; \
@@ -180,7 +180,7 @@ const GLubyte * glGetString(GLenum name)
const GLubyte * ret = egl_get_string_for_current_context(name);
if (ret == NULL) {
gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl;
- ret = _c->glGetString(name);
+ if(_c) ret = _c->glGetString(name);
}
return ret;
}
diff --git a/opengl/libs/GLES_CM/gl.cpp b/opengl/libs/GLES_CM/gl.cpp
index f05983c..7896a6f 100644
--- a/opengl/libs/GLES_CM/gl.cpp
+++ b/opengl/libs/GLES_CM/gl.cpp
@@ -138,7 +138,7 @@ GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
#elif defined(__i386__)
- #define API_ENTRY(_api) __attribute__((noinline)) _api
+ #define API_ENTRY(_api) __attribute__((noinline,optimize("omit-frame-pointer"))) _api
#define CALL_GL_API(_api, ...) \
register void* fn; \
@@ -157,7 +157,7 @@ GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
#elif defined(__x86_64__)
- #define API_ENTRY(_api) __attribute__((noinline)) _api
+ #define API_ENTRY(_api) __attribute__((noinline,optimize("omit-frame-pointer"))) _api
#define CALL_GL_API(_api, ...) \
register void** fn; \
diff --git a/opengl/libs/GLES_trace/Android.mk b/opengl/libs/GLES_trace/Android.mk
index 846932d..7af7f69 100644
--- a/opengl/libs/GLES_trace/Android.mk
+++ b/opengl/libs/GLES_trace/Android.mk
@@ -1,6 +1,7 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SRC_FILES := \
src/gltrace_api.cpp \
@@ -15,14 +16,12 @@ LOCAL_SRC_FILES := \
LOCAL_C_INCLUDES := \
$(LOCAL_PATH) \
$(LOCAL_PATH)/../ \
- external/stlport/stlport \
external/protobuf/src \
external \
- bionic
LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI
-LOCAL_STATIC_LIBRARIES := libprotobuf-cpp-2.3.0-lite liblzf
-LOCAL_SHARED_LIBRARIES := libcutils libutils liblog libstlport
+LOCAL_STATIC_LIBRARIES := liblzf
+LOCAL_SHARED_LIBRARIES := libcutils libutils liblog libprotobuf-cpp-lite
LOCAL_CFLAGS += -DLOG_TAG=\"libGLES_trace\"
diff --git a/opengl/tests/EGLTest/Android.mk b/opengl/tests/EGLTest/Android.mk
index f37efec..80e4867 100644
--- a/opengl/tests/EGLTest/Android.mk
+++ b/opengl/tests/EGLTest/Android.mk
@@ -1,6 +1,7 @@
# Build the unit tests.
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE := EGL_test
@@ -14,27 +15,18 @@ LOCAL_SHARED_LIBRARIES := \
libEGL \
libcutils \
libbinder \
- libstlport \
libutils \
libgui \
-LOCAL_STATIC_LIBRARIES := \
- libgtest \
- libgtest_main \
-
LOCAL_C_INCLUDES := \
- bionic \
bionic/libc/private \
- bionic/libstdc++/include \
- external/gtest/include \
- external/stlport/stlport \
frameworks/native/opengl/libs \
frameworks/native/opengl/libs/EGL \
# gold in binutils 2.22 will warn about the usage of mktemp
LOCAL_LDFLAGS += -Wl,--no-fatal-warnings
-include $(BUILD_EXECUTABLE)
+include $(BUILD_NATIVE_TEST)
# Include subdirectory makefiles
# ============================================================
diff --git a/opengl/tests/hwc/Android.mk b/opengl/tests/hwc/Android.mk
index 86e1d46..f83846b 100644
--- a/opengl/tests/hwc/Android.mk
+++ b/opengl/tests/hwc/Android.mk
@@ -15,24 +15,25 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
LOCAL_MODULE_TAGS := tests
LOCAL_MODULE:= libhwcTest
+LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+LOCAL_CXX_STL := libc++
LOCAL_SRC_FILES:= hwcTestLib.cpp
LOCAL_C_INCLUDES += system/extras/tests/include \
- bionic \
- bionic/libstdc++/include \
- external/stlport/stlport \
- $(call include-path-for, opengl-tests-includes)
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-
-LOCAL_SHARED_LIBRARIES += libcutils libutils libstlport
-LOCAL_STATIC_LIBRARIES += libglTest
-
+ $(call include-path-for, opengl-tests-includes) \
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
+LOCAL_MODULE:= hwcStress
+LOCAL_MODULE_TAGS := tests
+LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+LOCAL_CXX_STL := libc++
LOCAL_SRC_FILES:= hwcStress.cpp
LOCAL_SHARED_LIBRARIES := \
@@ -52,19 +53,17 @@ LOCAL_STATIC_LIBRARIES := \
LOCAL_C_INCLUDES += \
system/extras/tests/include \
hardware/libhardware/include \
- $(call include-path-for, opengl-tests-includes)
+ $(call include-path-for, opengl-tests-includes) \
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+include $(BUILD_NATIVE_TEST)
-LOCAL_MODULE:= hwcStress
+include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+LOCAL_MODULE:= hwcRects
LOCAL_MODULE_TAGS := tests
-
LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-
-include $(BUILD_NATIVE_TEST)
-
-include $(CLEAR_VARS)
+LOCAL_CXX_STL := libc++
LOCAL_SRC_FILES:= hwcRects.cpp
LOCAL_SHARED_LIBRARIES := \
@@ -84,17 +83,17 @@ LOCAL_STATIC_LIBRARIES := \
LOCAL_C_INCLUDES += \
system/extras/tests/include \
hardware/libhardware/include \
- $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= hwcRects
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+ $(call include-path-for, opengl-tests-includes) \
include $(BUILD_NATIVE_TEST)
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
+LOCAL_MODULE:= hwcColorEquiv
+LOCAL_MODULE_TAGS := tests
+LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+LOCAL_CXX_STL := libc++
LOCAL_SRC_FILES:= hwcColorEquiv.cpp
LOCAL_SHARED_LIBRARIES := \
@@ -114,17 +113,17 @@ LOCAL_STATIC_LIBRARIES := \
LOCAL_C_INCLUDES += \
system/extras/tests/include \
hardware/libhardware/include \
- $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= hwcColorEquiv
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+ $(call include-path-for, opengl-tests-includes) \
include $(BUILD_NATIVE_TEST)
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
+LOCAL_MODULE:= hwcCommit
+LOCAL_MODULE_TAGS := tests
+LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+LOCAL_CXX_STL := libc++
LOCAL_SRC_FILES:= hwcCommit.cpp
LOCAL_SHARED_LIBRARIES := \
@@ -144,12 +143,6 @@ LOCAL_STATIC_LIBRARIES := \
LOCAL_C_INCLUDES += \
system/extras/tests/include \
hardware/libhardware/include \
- $(call include-path-for, opengl-tests-includes)
-
-LOCAL_MODULE:= hwcCommit
-
-LOCAL_MODULE_TAGS := tests
-
-LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
+ $(call include-path-for, opengl-tests-includes) \
include $(BUILD_NATIVE_TEST)
diff --git a/opengl/tests/hwc/hwcColorEquiv.cpp b/opengl/tests/hwc/hwcColorEquiv.cpp
index c4624d2..06a0191 100644
--- a/opengl/tests/hwc/hwcColorEquiv.cpp
+++ b/opengl/tests/hwc/hwcColorEquiv.cpp
@@ -166,7 +166,6 @@ main(int argc, char *argv[])
int rv, opt;
bool error;
char *chptr;
- unsigned int pass;
char cmd[MAXCMD];
string str;
@@ -293,14 +292,12 @@ main(int argc, char *argv[])
// Use the upper third of the display for the reference frame and
// the middle third for the equivalence frame.
unsigned int refHeight = height / 3;
- unsigned int refPosY = 0; // Reference frame Y position
unsigned int refPosX = 0; // Reference frame X position
unsigned int refWidth = width - refPosX;
if ((refWidth & refFormat->wMod) != 0) {
refWidth += refFormat->wMod - (refWidth % refFormat->wMod);
}
unsigned int equivHeight = height / 3;
- unsigned int equivPosY = refHeight; // Equivalence frame Y position
unsigned int equivPosX = 0; // Equivalence frame X position
unsigned int equivWidth = width - equivPosX;
if ((equivWidth & equivFormat->wMod) != 0) {
diff --git a/opengl/tests/hwc/hwcCommit.cpp b/opengl/tests/hwc/hwcCommit.cpp
index 1bd5fdf..1bcb860 100644
--- a/opengl/tests/hwc/hwcCommit.cpp
+++ b/opengl/tests/hwc/hwcCommit.cpp
@@ -338,7 +338,6 @@ int
main(int argc, char *argv[])
{
int rv, opt;
- char *chptr;
bool error;
string str;
char cmd[MAXCMD];
diff --git a/opengl/tests/hwc/hwcRects.cpp b/opengl/tests/hwc/hwcRects.cpp
index 9b57623..56c1a2a 100644
--- a/opengl/tests/hwc/hwcRects.cpp
+++ b/opengl/tests/hwc/hwcRects.cpp
@@ -204,7 +204,6 @@ main(int argc, char *argv[])
{
int rv, opt;
char *chptr;
- bool error;
string str;
char cmd[MAXCMD];
@@ -367,7 +366,6 @@ static Rectangle parseRect(string rectStr)
istringstream in(rectStr);
const struct hwcTestGraphicFormat *format;
Rectangle rect;
- struct hwc_rect hwcRect;
// Graphic Format
in >> str;
diff --git a/opengl/tests/hwc/hwcTestLib.cpp b/opengl/tests/hwc/hwcTestLib.cpp
index 7fae5e5..3b0ca74 100644
--- a/opengl/tests/hwc/hwcTestLib.cpp
+++ b/opengl/tests/hwc/hwcTestLib.cpp
@@ -20,22 +20,22 @@
* Utility library functions for use by the Hardware Composer test cases
*/
+#include <arpa/inet.h> // For ntohl() and htonl()
+
+#include <cmath>
#include <sstream>
#include <string>
-#include <arpa/inet.h> // For ntohl() and htonl()
-
#include "hwcTestLib.h"
#include "EGLUtils.h"
// Defines
-#define NUMA(a) (sizeof(a) / sizeof(a [0]))
+#define NUMA(a) (sizeof(a) / sizeof((a)[0]))
// Function Prototypes
static void printGLString(const char *name, GLenum s);
static void checkEglError(const char* op, EGLBoolean returnVal = EGL_TRUE);
-static void checkGlError(const char* op);
static void printEGLConfiguration(EGLDisplay dpy, EGLConfig config);
using namespace std;
@@ -51,8 +51,6 @@ void hwcTestInitDisplay(bool verbose, EGLDisplay *dpy, EGLSurface *surface,
{
static EGLContext context;
- int rv;
-
EGLBoolean returnValue;
EGLConfig myConfig = {0};
EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
@@ -668,7 +666,6 @@ void hwcTestFillColor(GraphicBuffer *gBuf, ColorFract color, float alpha)
for (unsigned int x = 0; x < gBuf->getStride(); x++) {
for (unsigned int y = 0; y < gBuf->getHeight(); y++) {
- uint32_t val = pixel;
hwcTestSetPixel(gBuf, buf, x, y, (x < gBuf->getWidth())
? pixel : testRand());
}
@@ -965,14 +962,6 @@ static void checkEglError(const char* op, EGLBoolean returnVal)
}
}
-static void checkGlError(const char* op)
-{
- for (GLint error = glGetError(); error; error
- = glGetError()) {
- testPrintE("after %s() glError (0x%x)", op, error);
- }
-}
-
static void printEGLConfiguration(EGLDisplay dpy, EGLConfig config)
{
diff --git a/opengl/tests/lib/Android.mk b/opengl/tests/lib/Android.mk
index a2752cd..e5124ad 100644
--- a/opengl/tests/lib/Android.mk
+++ b/opengl/tests/lib/Android.mk
@@ -15,18 +15,13 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE_TAGS := tests
LOCAL_MODULE:= libglTest
LOCAL_SRC_FILES:= glTestLib.cpp WindowSurface.cpp
LOCAL_C_INCLUDES += system/extras/tests/include \
- bionic \
- bionic/libstdc++/include \
- external/stlport/stlport \
$(call include-path-for, opengl-tests-includes)
LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
-LOCAL_SHARED_LIBRARIES += libcutils libutils libstlport
-
-
include $(BUILD_STATIC_LIBRARY)
diff --git a/opengl/tools/glgen/stubs/egl/EGL14cHeader.cpp b/opengl/tools/glgen/stubs/egl/EGL14cHeader.cpp
index a372362..f6813fd 100644
--- a/opengl/tools/glgen/stubs/egl/EGL14cHeader.cpp
+++ b/opengl/tools/glgen/stubs/egl/EGL14cHeader.cpp
@@ -16,6 +16,10 @@
// This source file is automatically generated
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
#include "jni.h"
#include "JNIHelp.h"
#include <android_runtime/AndroidRuntime.h>
diff --git a/opengl/tools/glgen/stubs/egl/EGLExtcHeader.cpp b/opengl/tools/glgen/stubs/egl/EGLExtcHeader.cpp
index b5c19df..4df61d3 100644
--- a/opengl/tools/glgen/stubs/egl/EGLExtcHeader.cpp
+++ b/opengl/tools/glgen/stubs/egl/EGLExtcHeader.cpp
@@ -16,6 +16,10 @@
// This source file is automatically generated
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
#include "jni.h"
#include "JNIHelp.h"
#include <android_runtime/AndroidRuntime.h>
@@ -81,23 +85,19 @@ nativeClassInit(JNIEnv *_env, jclass glImplClass)
eglsurfaceConstructor = _env->GetMethodID(eglsurfaceClass, "<init>", "(J)V");
eglconfigConstructor = _env->GetMethodID(eglconfigClass, "<init>", "(J)V");
- jobject localeglNoContextObject = _env->NewObject(eglcontextClass, eglcontextConstructor, reinterpret_cast<jlong>(EGL_NO_CONTEXT));
- eglNoContextObject = _env->NewGlobalRef(localeglNoContextObject);
- jobject localeglNoDisplayObject = _env->NewObject(egldisplayClass, egldisplayConstructor, reinterpret_cast<jlong>(EGL_NO_DISPLAY));
- eglNoDisplayObject = _env->NewGlobalRef(localeglNoDisplayObject);
- jobject localeglNoSurfaceObject = _env->NewObject(eglsurfaceClass, eglsurfaceConstructor, reinterpret_cast<jlong>(EGL_NO_SURFACE));
- eglNoSurfaceObject = _env->NewGlobalRef(localeglNoSurfaceObject);
-
jclass eglClass = _env->FindClass("android/opengl/EGL14");
jfieldID noContextFieldID = _env->GetStaticFieldID(eglClass, "EGL_NO_CONTEXT", "Landroid/opengl/EGLContext;");
- _env->SetStaticObjectField(eglClass, noContextFieldID, eglNoContextObject);
+ jobject localeglNoContextObject = _env->GetStaticObjectField(eglClass, noContextFieldID);
+ eglNoContextObject = _env->NewGlobalRef(localeglNoContextObject);
jfieldID noDisplayFieldID = _env->GetStaticFieldID(eglClass, "EGL_NO_DISPLAY", "Landroid/opengl/EGLDisplay;");
- _env->SetStaticObjectField(eglClass, noDisplayFieldID, eglNoDisplayObject);
+ jobject localeglNoDisplayObject = _env->GetStaticObjectField(eglClass, noDisplayFieldID);
+ eglNoDisplayObject = _env->NewGlobalRef(localeglNoDisplayObject);
jfieldID noSurfaceFieldID = _env->GetStaticFieldID(eglClass, "EGL_NO_SURFACE", "Landroid/opengl/EGLSurface;");
- _env->SetStaticObjectField(eglClass, noSurfaceFieldID, eglNoSurfaceObject);
+ jobject localeglNoSurfaceObject = _env->GetStaticObjectField(eglClass, noSurfaceFieldID);
+ eglNoSurfaceObject = _env->NewGlobalRef(localeglNoSurfaceObject);
}
static void *
diff --git a/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp
index 8a1d5ed..1fa9275 100644
--- a/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp
+++ b/opengl/tools/glgen/stubs/gles11/GLES10ExtcHeader.cpp
@@ -17,6 +17,10 @@
// This source file is automatically generated
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
#include <GLES/gl.h>
#include <GLES/glext.h>
diff --git a/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp
index 8a1d5ed..1fa9275 100644
--- a/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp
+++ b/opengl/tools/glgen/stubs/gles11/GLES10cHeader.cpp
@@ -17,6 +17,10 @@
// This source file is automatically generated
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
#include <GLES/gl.h>
#include <GLES/glext.h>
diff --git a/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp
index 8a1d5ed..1fa9275 100644
--- a/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp
+++ b/opengl/tools/glgen/stubs/gles11/GLES11ExtcHeader.cpp
@@ -17,6 +17,10 @@
// This source file is automatically generated
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
#include <GLES/gl.h>
#include <GLES/glext.h>
diff --git a/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp
index 8a1d5ed..1fa9275 100644
--- a/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp
+++ b/opengl/tools/glgen/stubs/gles11/GLES11cHeader.cpp
@@ -17,6 +17,10 @@
// This source file is automatically generated
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
#include <GLES/gl.h>
#include <GLES/glext.h>
diff --git a/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp
index 2389563..4004a7d 100644
--- a/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp
+++ b/opengl/tools/glgen/stubs/gles11/GLES20cHeader.cpp
@@ -17,6 +17,10 @@
// This source file is automatically generated
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
diff --git a/opengl/tools/glgen/stubs/gles11/GLES30cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES30cHeader.cpp
index f5ec455..c5bdf32 100644
--- a/opengl/tools/glgen/stubs/gles11/GLES30cHeader.cpp
+++ b/opengl/tools/glgen/stubs/gles11/GLES30cHeader.cpp
@@ -17,6 +17,10 @@
// This source file is automatically generated
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
#include <GLES3/gl3.h>
#include <GLES3/gl3ext.h>
diff --git a/opengl/tools/glgen/stubs/gles11/GLES31ExtcHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES31ExtcHeader.cpp
index e7e3561..2260a80 100644
--- a/opengl/tools/glgen/stubs/gles11/GLES31ExtcHeader.cpp
+++ b/opengl/tools/glgen/stubs/gles11/GLES31ExtcHeader.cpp
@@ -16,6 +16,10 @@
// This source file is automatically generated
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
#include <GLES3/gl31.h>
#include <GLES2/gl2ext.h>
diff --git a/opengl/tools/glgen/stubs/gles11/GLES31cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES31cHeader.cpp
index c48ec7c..130612d 100644
--- a/opengl/tools/glgen/stubs/gles11/GLES31cHeader.cpp
+++ b/opengl/tools/glgen/stubs/gles11/GLES31cHeader.cpp
@@ -16,5 +16,9 @@
// This source file is automatically generated
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
#include <stdint.h>
#include <GLES3/gl31.h>
diff --git a/opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp b/opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp
index ce3bc8f..eda2e46 100644
--- a/opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp
+++ b/opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp
@@ -3,7 +3,7 @@ static void android_glDrawArraysIndirect(JNIEnv *_env, jobject, int mode, jlong
// In OpenGL ES, 'indirect' is a byte offset into a buffer, not a raw pointer.
// GL checks for too-large values. Here we only need to check for successful signed 64-bit
// to unsigned 32-bit conversion.
- if (sizeof(void*) != sizeof(jlong) && indirect > UINTPTR_MAX) {
+ if (sizeof(void*) != sizeof(jlong) && indirect > static_cast<jlong>(UINT32_MAX)) {
jniThrowException(_env, "java/lang/IllegalArgumentException", "indirect offset too large");
return;
}
diff --git a/opengl/tools/glgen/stubs/gles11/glDrawElementsIndirect.cpp b/opengl/tools/glgen/stubs/gles11/glDrawElementsIndirect.cpp
index 1833ee9..a091dc9 100644
--- a/opengl/tools/glgen/stubs/gles11/glDrawElementsIndirect.cpp
+++ b/opengl/tools/glgen/stubs/gles11/glDrawElementsIndirect.cpp
@@ -3,7 +3,7 @@ static void android_glDrawElementsIndirect(JNIEnv *_env, jobject, jint mode, jin
// In OpenGL ES, 'indirect' is a byte offset into a buffer, not a raw pointer.
// GL checks for too-large values. Here we only need to check for successful signed 64-bit
// to unsigned 32-bit conversion.
- if (sizeof(void*) != sizeof(jlong) && indirect > UINTPTR_MAX) {
+ if (sizeof(void*) != sizeof(jlong) && indirect > static_cast<jlong>(UINT32_MAX)) {
jniThrowException(_env, "java/lang/IllegalArgumentException", "indirect offset too large");
return;
}
diff --git a/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp b/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp
index df11c53..f5506ba 100644
--- a/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp
+++ b/opengl/tools/glgen/stubs/jsr239/GLCHeader.cpp
@@ -16,6 +16,10 @@
// This source file is automatically generated
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+
#include "jni.h"
#include "JNIHelp.h"
#include <android_runtime/AndroidRuntime.h>