Clean up GL header includes.

Change-Id: I6dcaac900eaae54d2ec0265d656fdc9c38371b8a
Reviewed-on: https://swiftshader-review.googlesource.com/4449
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/common/Image.cpp b/src/OpenGL/common/Image.cpp
index 9799f98..748c262 100644
--- a/src/OpenGL/common/Image.cpp
+++ b/src/OpenGL/common/Image.cpp
@@ -17,7 +17,6 @@
 #include "Common/Math.hpp"
 #include "Common/Thread.hpp"
 
-#include <GLES/glext.h>
 #include <GLES2/gl2ext.h>
 #include <GLES3/gl3.h>
 
diff --git a/src/OpenGL/common/Image.hpp b/src/OpenGL/common/Image.hpp
index e2402ac..abd2d5f 100644
--- a/src/OpenGL/common/Image.hpp
+++ b/src/OpenGL/common/Image.hpp
@@ -4,7 +4,6 @@
 #include "libEGL/Texture.hpp"

 #include "Renderer/Surface.hpp"

 

-#include <GLES/gl.h>

 #include <GLES2/gl2.h>

 

 #if defined(__ANDROID__)

@@ -26,11 +25,6 @@
 

 namespace egl

 {

-// Types common between gl.h and gl2.h

-// We can't include either header in EGL

-typedef unsigned int GLenum;

-typedef int GLint;

-typedef int GLsizei;

 

 sw::Format SelectInternalFormat(GLenum format, GLenum type);

 GLsizei ComputePitch(GLsizei width, GLenum format, GLenum type, GLint alignment);

diff --git a/src/OpenGL/libGLESv2/libGLESv2.cpp b/src/OpenGL/libGLESv2/libGLESv2.cpp
index b5364b9..cd8875b 100644
--- a/src/OpenGL/libGLESv2/libGLESv2.cpp
+++ b/src/OpenGL/libGLESv2/libGLESv2.cpp
@@ -341,7 +341,7 @@
 

 	if(context)

 	{

-		egl::GLint clientVersion = egl::getClientVersion();

+		GLint clientVersion = egl::getClientVersion();

 

 		switch(target)

 		{

@@ -460,7 +460,7 @@
 			return error(GL_INVALID_OPERATION);

 		}

 

-		egl::GLint clientVersion = context->getClientVersion();

+		GLint clientVersion = context->getClientVersion();

 

 		switch(target)

 		{

@@ -553,7 +553,7 @@
 	TRACE("(GLenum srcRGB = 0x%X, GLenum dstRGB = 0x%X, GLenum srcAlpha = 0x%X, GLenum dstAlpha = 0x%X)",

 	      srcRGB, dstRGB, srcAlpha, dstAlpha);

 

-	egl::GLint clientVersion = egl::getClientVersion();

+	GLint clientVersion = egl::getClientVersion();

 

 	switch(srcRGB)

 	{

@@ -673,7 +673,7 @@
 		return error(GL_INVALID_VALUE);

 	}

 

-	egl::GLint clientVersion = egl::getClientVersion();

+	GLint clientVersion = egl::getClientVersion();

 

 	switch(usage)

 	{

@@ -2082,7 +2082,7 @@
 			}

 		}

 

-		egl::GLint clientVersion = context->getClientVersion();

+		GLint clientVersion = context->getClientVersion();

 

 		switch(attachment)

 		{

@@ -2233,7 +2233,7 @@
 			return error(GL_INVALID_OPERATION);

 		}

 

-		egl::GLint clientVersion = context->getClientVersion();

+		GLint clientVersion = context->getClientVersion();

 

 		switch(attachment)

 		{

@@ -2340,7 +2340,7 @@
 	{

 		es2::Texture *texture = nullptr;

 

-		egl::GLint clientVersion = context->getClientVersion();

+		GLint clientVersion = context->getClientVersion();

 

 		switch(target)

 		{

@@ -2694,7 +2694,7 @@
 			return error(GL_INVALID_OPERATION);

 		}

 

-		egl::GLint clientVersion = context->getClientVersion();

+		GLint clientVersion = context->getClientVersion();

 

 		switch(pname)

 		{

@@ -2838,7 +2838,7 @@
 			return error(GL_INVALID_ENUM);

 		}

 

-		egl::GLint clientVersion = context->getClientVersion();

+		GLint clientVersion = context->getClientVersion();

 

 		es2::Framebuffer *framebuffer = NULL;

 		if(target == GL_READ_FRAMEBUFFER_ANGLE)

@@ -3257,7 +3257,7 @@
 			return error(GL_INVALID_VALUE);

 		}

 

-		egl::GLint clientVersion = egl::getClientVersion();

+		GLint clientVersion = egl::getClientVersion();

 

 		switch(pname)

 		{

@@ -3638,7 +3638,7 @@
 	{

 		es2::Texture *texture;

 

-		egl::GLint clientVersion = context->getClientVersion();

+		GLint clientVersion = context->getClientVersion();

 

 		switch(target)

 		{

@@ -3784,7 +3784,7 @@
 	{

 		es2::Texture *texture;

 

-		egl::GLint clientVersion = context->getClientVersion();

+		GLint clientVersion = context->getClientVersion();

 

 		switch(target)

 		{

@@ -4103,7 +4103,7 @@
 

 		const es2::VertexAttribute &attribState = context->getVertexAttribState(index);

 

-		egl::GLint clientVersion = context->getClientVersion();

+		GLint clientVersion = context->getClientVersion();

 

 		switch(pname)

 		{

@@ -4176,7 +4176,7 @@
 

 		const es2::VertexAttribute &attribState = context->getVertexAttribState(index);

 

-		egl::GLint clientVersion = context->getClientVersion();

+		GLint clientVersion = context->getClientVersion();

 

 		switch(pname)

 		{

@@ -4312,7 +4312,7 @@
 

 	if(context)

 	{

-		egl::GLint clientVersion = context->getClientVersion();

+		GLint clientVersion = context->getClientVersion();

 

 		switch(cap)

 		{

@@ -4536,7 +4536,7 @@
 

 	if(context)

 	{

-		egl::GLint clientVersion = context->getClientVersion();

+		GLint clientVersion = context->getClientVersion();

 

 		switch(pname)

 		{

@@ -4740,7 +4740,7 @@
 			return error(GL_INVALID_OPERATION);

 		}

 

-		egl::GLint clientVersion = context->getClientVersion();

+		GLint clientVersion = context->getClientVersion();

 		switch(internalformat)

 		{

 		case GL_DEPTH_COMPONENT32F:

@@ -5118,7 +5118,7 @@
 

 	if(context)

 	{

-		egl::GLint clientVersion = context->getClientVersion();

+		GLint clientVersion = context->getClientVersion();

 		if(clientVersion < 3)

 		{

 			if(internalformat != format)

@@ -5884,7 +5884,7 @@
 	{

 		es2::Texture *texture;

 

-		egl::GLint clientVersion = context->getClientVersion();

+		GLint clientVersion = context->getClientVersion();

 

 		switch(target)

 		{

@@ -6039,7 +6039,7 @@
 	{

 		es2::Texture *texture;

 

-		egl::GLint clientVersion = context->getClientVersion();

+		GLint clientVersion = context->getClientVersion();

 

 		switch(target)

 		{

@@ -6900,7 +6900,7 @@
 		return error(GL_INVALID_VALUE);

 	}

 

-	egl::GLint clientVersion = egl::getClientVersion();

+	GLint clientVersion = egl::getClientVersion();

 

 	switch(type)

 	{

@@ -7352,7 +7352,7 @@
 			return error(GL_INVALID_OPERATION);

 		}

 

-		egl::GLint clientVersion = context->getClientVersion();

+		GLint clientVersion = context->getClientVersion();

 

 		switch(attachment)

 		{

diff --git a/src/OpenGL/libGLESv2/utilities.cpp b/src/OpenGL/libGLESv2/utilities.cpp
index 68a0950..15180eb 100644
--- a/src/OpenGL/libGLESv2/utilities.cpp
+++ b/src/OpenGL/libGLESv2/utilities.cpp
@@ -465,59 +465,59 @@
 		return static_cast<GLint>((static_cast<GLfloat>(0xFFFFFFFF) * value - 1.0f) * 0.5f);

 	}

 

-	bool IsCompressed(GLenum format, egl::GLint clientVersion)

+	bool IsCompressed(GLenum format, GLint clientVersion)

 	{

 		return ValidateCompressedFormat(format, clientVersion, true) == GL_NONE;

 	}

 

-	GLenum ValidateCompressedFormat(GLenum format, egl::GLint clientVersion, bool expectCompressedFormats)

+	GLenum ValidateCompressedFormat(GLenum format, GLint clientVersion, bool expectCompressedFormats)

 	{

 		switch(format)

 		{

-		case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
-		case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
-		case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
-		case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
-			return S3TC_SUPPORT ? (expectCompressedFormats ? GL_NONE : GL_INVALID_OPERATION) : GL_INVALID_ENUM;
-		case GL_ETC1_RGB8_OES:
-			return expectCompressedFormats ? GL_NONE : GL_INVALID_OPERATION;
-		case GL_COMPRESSED_R11_EAC:
-		case GL_COMPRESSED_SIGNED_R11_EAC:
-		case GL_COMPRESSED_RG11_EAC:
-		case GL_COMPRESSED_SIGNED_RG11_EAC:
-		case GL_COMPRESSED_RGB8_ETC2:
-		case GL_COMPRESSED_SRGB8_ETC2:
-		case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
-		case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
-		case GL_COMPRESSED_RGBA8_ETC2_EAC:
-		case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
-		case GL_COMPRESSED_RGBA_ASTC_4x4_KHR:
-		case GL_COMPRESSED_RGBA_ASTC_5x4_KHR:
-		case GL_COMPRESSED_RGBA_ASTC_5x5_KHR:
-		case GL_COMPRESSED_RGBA_ASTC_6x5_KHR:
-		case GL_COMPRESSED_RGBA_ASTC_6x6_KHR:
-		case GL_COMPRESSED_RGBA_ASTC_8x5_KHR:
-		case GL_COMPRESSED_RGBA_ASTC_8x6_KHR:
-		case GL_COMPRESSED_RGBA_ASTC_8x8_KHR:
-		case GL_COMPRESSED_RGBA_ASTC_10x5_KHR:
-		case GL_COMPRESSED_RGBA_ASTC_10x6_KHR:
-		case GL_COMPRESSED_RGBA_ASTC_10x8_KHR:
-		case GL_COMPRESSED_RGBA_ASTC_10x10_KHR:
-		case GL_COMPRESSED_RGBA_ASTC_12x10_KHR:
-		case GL_COMPRESSED_RGBA_ASTC_12x12_KHR:
-		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:
-		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:
-		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:
-		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:
-		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:
-		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:
-		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:
-		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:
-		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:
-		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:
-		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:
-		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:
-		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
+		case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:

+		case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:

+		case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:

+		case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:

+			return S3TC_SUPPORT ? (expectCompressedFormats ? GL_NONE : GL_INVALID_OPERATION) : GL_INVALID_ENUM;

+		case GL_ETC1_RGB8_OES:

+			return expectCompressedFormats ? GL_NONE : GL_INVALID_OPERATION;

+		case GL_COMPRESSED_R11_EAC:

+		case GL_COMPRESSED_SIGNED_R11_EAC:

+		case GL_COMPRESSED_RG11_EAC:

+		case GL_COMPRESSED_SIGNED_RG11_EAC:

+		case GL_COMPRESSED_RGB8_ETC2:

+		case GL_COMPRESSED_SRGB8_ETC2:

+		case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:

+		case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:

+		case GL_COMPRESSED_RGBA8_ETC2_EAC:

+		case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:

+		case GL_COMPRESSED_RGBA_ASTC_4x4_KHR:

+		case GL_COMPRESSED_RGBA_ASTC_5x4_KHR:

+		case GL_COMPRESSED_RGBA_ASTC_5x5_KHR:

+		case GL_COMPRESSED_RGBA_ASTC_6x5_KHR:

+		case GL_COMPRESSED_RGBA_ASTC_6x6_KHR:

+		case GL_COMPRESSED_RGBA_ASTC_8x5_KHR:

+		case GL_COMPRESSED_RGBA_ASTC_8x6_KHR:

+		case GL_COMPRESSED_RGBA_ASTC_8x8_KHR:

+		case GL_COMPRESSED_RGBA_ASTC_10x5_KHR:

+		case GL_COMPRESSED_RGBA_ASTC_10x6_KHR:

+		case GL_COMPRESSED_RGBA_ASTC_10x8_KHR:

+		case GL_COMPRESSED_RGBA_ASTC_10x10_KHR:

+		case GL_COMPRESSED_RGBA_ASTC_12x10_KHR:

+		case GL_COMPRESSED_RGBA_ASTC_12x12_KHR:

+		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:

+		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:

+		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:

+		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:

+		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:

+		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:

+		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:

+		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:

+		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:

+		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:

+		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:

+		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:

+		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:

 		case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:

 			return (clientVersion >= 3) ? (expectCompressedFormats ? GL_NONE : GL_INVALID_OPERATION) : GL_INVALID_ENUM;

 		default:

@@ -597,7 +597,7 @@
 		return GL_NONE;

 	}

 

-	bool ValidReadPixelsFormatType(GLenum internalFormat, GLenum internalType, GLenum format, GLenum type, egl::GLint clientVersion)

+	bool ValidReadPixelsFormatType(GLenum internalFormat, GLenum internalType, GLenum format, GLenum type, GLint clientVersion)

 	{

 		switch(format)

 		{

@@ -703,7 +703,7 @@
 	}

 

 	// Verify that format/type are one of the combinations from table 3.4.

-	bool CheckTextureFormatType(GLenum format, GLenum type, egl::GLint clientVersion)

+	bool CheckTextureFormatType(GLenum format, GLenum type, GLint clientVersion)

 	{

 		switch(type)

 		{

@@ -823,7 +823,7 @@
 		}

 	}

 

-	bool IsColorRenderable(GLenum internalformat, egl::GLint clientVersion)

+	bool IsColorRenderable(GLenum internalformat, GLint clientVersion)

 	{

 		switch(internalformat)

 		{

diff --git a/src/OpenGL/libGLESv2/utilities.h b/src/OpenGL/libGLESv2/utilities.h
index 01b75a6..c7ff12a 100644
--- a/src/OpenGL/libGLESv2/utilities.h
+++ b/src/OpenGL/libGLESv2/utilities.h
@@ -40,20 +40,20 @@
 

 	GLint floatToInt(GLfloat value);

 

-	bool IsCompressed(GLenum format, egl::GLint clientVersion);

+	bool IsCompressed(GLenum format, GLint clientVersion);

 	GLenum GetSizedInternalFormat(GLenum internalFormat, GLenum type);

-	GLenum ValidateCompressedFormat(GLenum format, egl::GLint clientVersion, bool expectCompressedFormats);

+	GLenum ValidateCompressedFormat(GLenum format, GLint clientVersion, bool expectCompressedFormats);

 	GLenum ValidateSubImageParams(bool compressed, GLsizei width, GLsizei height, GLint xoffset, GLint yoffset, GLenum target, GLint level, GLenum sizedInternalFormat, Texture *texture);

 	GLenum ValidateSubImageParams(bool compressed, GLsizei width, GLsizei height, GLsizei depth, GLint xoffset, GLint yoffset, GLint zoffset, GLenum target, GLint level, GLenum sizedInternalFormat, Texture *texture);

-	bool ValidReadPixelsFormatType(GLenum internalFormat, GLenum internalType, GLenum format, GLenum type, egl::GLint clientVersion);

+	bool ValidReadPixelsFormatType(GLenum internalFormat, GLenum internalType, GLenum format, GLenum type, GLint clientVersion);

 	bool IsDepthTexture(GLenum format);

 	bool IsStencilTexture(GLenum format);

 	bool IsCubemapTextureTarget(GLenum target);

 	int CubeFaceIndex(GLenum cubeTarget);

 	bool IsTextureTarget(GLenum target);

-	bool CheckTextureFormatType(GLenum format, GLenum type, egl::GLint clientVersion);

+	bool CheckTextureFormatType(GLenum format, GLenum type, GLint clientVersion);

 

-	bool IsColorRenderable(GLenum internalformat, egl::GLint clientVersion);

+	bool IsColorRenderable(GLenum internalformat, GLint clientVersion);

 	bool IsDepthRenderable(GLenum internalformat);

 	bool IsStencilRenderable(GLenum internalformat);