auto import from //branches/cupcake/...@130745
diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp
index 3e8dca9..1446fb2 100644
--- a/opengl/libagl/egl.cpp
+++ b/opengl/libagl/egl.cpp
@@ -33,7 +33,10 @@
#include <utils/threads.h>
-#include <GLES/egl.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+#include <GLES/gl.h>
+#include <GLES/glext.h>
#include <pixelflinger/format.h>
#include <pixelflinger/pixelflinger.h>
@@ -149,7 +152,6 @@
virtual EGLint getRefreshRate() const;
virtual EGLint getSwapBehavior() const;
virtual EGLBoolean swapBuffers();
- virtual EGLBoolean swapRectangle(EGLint l, EGLint t, EGLint w, EGLint h);
protected:
GGLSurface depth;
};
@@ -171,10 +173,6 @@
EGLBoolean egl_surface_t::swapBuffers() {
return EGL_FALSE;
}
-EGLBoolean egl_surface_t::swapRectangle(
- EGLint l, EGLint t, EGLint w, EGLint h) {
- return EGL_FALSE;
-}
EGLint egl_surface_t::getHorizontalResolution() const {
return (0 * EGL_DISPLAY_SCALING) * (1.0f / 25.4f);
}
@@ -201,7 +199,6 @@
virtual bool isValid() const { return nativeWindow->magic == 0x600913; }
virtual EGLBoolean swapBuffers();
- virtual EGLBoolean swapRectangle(EGLint l, EGLint t, EGLint w, EGLint h);
virtual EGLBoolean bindDrawSurface(ogles_context_t* gl);
virtual EGLBoolean bindReadSurface(ogles_context_t* gl);
virtual EGLint getWidth() const { return nativeWindow->width; }
@@ -243,7 +240,6 @@
if (flags & EGL_NATIVES_FLAG_SIZE_CHANGED) {
// TODO: we probably should reset the swap rect here
// if the window size has changed
- // window->setSwapRectangle(Rect(info.w, info.h));
if (depth.data) {
free(depth.data);
depth.width = nativeWindow->width;
@@ -259,12 +255,6 @@
return EGL_TRUE;
}
-EGLBoolean egl_window_surface_t::swapRectangle(
- EGLint l, EGLint t, EGLint w, EGLint h)
-{
- nativeWindow->setSwapRectangle(nativeWindow, l, t, w, h);
- return EGL_TRUE;
-}
EGLBoolean egl_window_surface_t::bindDrawSurface(ogles_context_t* gl)
{
GGLSurface buffer;
@@ -476,21 +466,16 @@
static char const * const gVendorString = "Google Inc.";
static char const * const gVersionString = "1.2 Android Driver";
static char const * const gClientApiString = "OpenGL ES";
-static char const * const gExtensionsString =
- "EGL_ANDROID_swap_rectangle" " "
- "EGL_ANDROID_copy_front_to_back" " "
- "EGL_ANDROID_get_render_buffer_address"
- ;
+static char const * const gExtensionsString = "";
// ----------------------------------------------------------------------------
struct extention_map_t {
const char * const name;
- void (*address)(void);
+ __eglMustCastToProperFunctionPointerType address;
};
static const extention_map_t gExtentionMap[] = {
- { "eglSwapRectangleANDROID", (void(*)())&eglSwapRectangleANDROID },
{ "glDrawTexsOES", (void(*)())&glDrawTexsOES },
{ "glDrawTexiOES", (void(*)())&glDrawTexiOES },
{ "glDrawTexfOES", (void(*)())&glDrawTexfOES },
@@ -1554,15 +1539,3 @@
}
return NULL;
}
-
-EGLBoolean eglSwapRectangleANDROID(
- EGLDisplay dpy, EGLSurface draw,
- EGLint l, EGLint t, EGLint w, EGLint h)
-{
- if (egl_display_t::is_valid(dpy) == EGL_FALSE)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
- egl_surface_t* surface = (egl_surface_t*)draw;
- if (surface->dpy != dpy)
- return setError(EGL_BAD_DISPLAY, EGL_FALSE);
- return surface->swapRectangle(l, t, w, h);
-}
diff --git a/opengl/libagl/state.cpp b/opengl/libagl/state.cpp
index c2f9f12..5cbabea 100644
--- a/opengl/libagl/state.cpp
+++ b/opengl/libagl/state.cpp
@@ -403,12 +403,6 @@
case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
params[0] = GL_UNSIGNED_SHORT_5_6_5;
break;
- case GL_MAX_ELEMENTS_INDICES:
- params[0] = 65536;
- break;
- case GL_MAX_ELEMENTS_VERTICES:
- params[0] = 0x7FFFFFFF;
- break;
case GL_MAX_LIGHTS:
params[0] = OGLES_MAX_LIGHTS;
break;
diff --git a/opengl/libagl/texture.cpp b/opengl/libagl/texture.cpp
index 6b2640a..b6f534b 100644
--- a/opengl/libagl/texture.cpp
+++ b/opengl/libagl/texture.cpp
@@ -526,7 +526,7 @@
static void texParameterx(
GLenum target, GLenum pname, GLfixed param, ogles_context_t* c)
{
- if (target != GGL_TEXTURE_2D) {
+ if (target != GL_TEXTURE_2D) {
ogles_error(c, GL_INVALID_ENUM);
return;
}
@@ -534,8 +534,7 @@
EGLTextureObject* textureObject = c->textures.tmu[c->textures.active].texture;
switch (pname) {
case GL_TEXTURE_WRAP_S:
- if ((param == GL_CLAMP) ||
- (param == GL_REPEAT) ||
+ if ((param == GL_REPEAT) ||
(param == GL_CLAMP_TO_EDGE)) {
textureObject->wraps = param;
} else {
@@ -543,9 +542,8 @@
}
break;
case GL_TEXTURE_WRAP_T:
- if ((param == GGL_CLAMP) ||
- (param == GGL_REPEAT) ||
- (param == GGL_CLAMP_TO_EDGE)) {
+ if ((param == GL_REPEAT) ||
+ (param == GL_CLAMP_TO_EDGE)) {
textureObject->wrapt = param;
} else {
goto invalid_enum;
@@ -1006,7 +1004,7 @@
void glTexImage2D(
- GLenum target, GLint level, GLenum internalformat,
+ GLenum target, GLint level, GLint internalformat,
GLsizei width, GLsizei height, GLint border,
GLenum format, GLenum type, const GLvoid *pixels)
{