WebGL test fix for MacOS

On MacOS, the BGRA format is used for framebuffers. Because of that,
copying from the BGRA format must be allowed in the same places the
RGBA format is allowed.

This fixes the following WebGL test on MacOS:
conformance/textures/misc/copy-tex-image-2d-formats.html

Change-Id: I45c6b81a894dd8d55c4ab5cff0cf9ad1a08c8303
Reviewed-on: https://swiftshader-review.googlesource.com/18348
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/OpenGL/libGLESv2/utilities.cpp b/src/OpenGL/libGLESv2/utilities.cpp
index 76b5b12..109cb8e 100644
--- a/src/OpenGL/libGLESv2/utilities.cpp
+++ b/src/OpenGL/libGLESv2/utilities.cpp
@@ -571,7 +571,8 @@
 		{
 		case GL_ALPHA:
 			if(baseColorbufferFormat != GL_ALPHA &&
-			   baseColorbufferFormat != GL_RGBA)
+			   baseColorbufferFormat != GL_RGBA &&
+			   baseColorbufferFormat != GL_BGRA_EXT)   // GL_EXT_texture_format_BGRA8888 / GL_APPLE_texture_format_BGRA8888
 			{
 				return error(GL_INVALID_OPERATION, false);
 			}
@@ -589,7 +590,8 @@
 			if(baseColorbufferFormat != GL_RED &&
 			   baseColorbufferFormat != GL_RG &&
 			   baseColorbufferFormat != GL_RGB &&
-			   baseColorbufferFormat != GL_RGBA)
+			   baseColorbufferFormat != GL_RGBA &&
+			   baseColorbufferFormat != GL_BGRA_EXT)   // GL_EXT_texture_format_BGRA8888 / GL_APPLE_texture_format_BGRA8888
 			{
 				return error(GL_INVALID_OPERATION, false);
 			}
@@ -597,14 +599,16 @@
 		case GL_RG:
 			if(baseColorbufferFormat != GL_RG &&
 			   baseColorbufferFormat != GL_RGB &&
-			   baseColorbufferFormat != GL_RGBA)
+			   baseColorbufferFormat != GL_RGBA &&
+			   baseColorbufferFormat != GL_BGRA_EXT)   // GL_EXT_texture_format_BGRA8888 / GL_APPLE_texture_format_BGRA8888
 			{
 				return error(GL_INVALID_OPERATION, false);
 			}
 			break;
 		case GL_RGB:
 			if(baseColorbufferFormat != GL_RGB &&
-			   baseColorbufferFormat != GL_RGBA)
+			   baseColorbufferFormat != GL_RGBA &&
+			   baseColorbufferFormat != GL_BGRA_EXT)   // GL_EXT_texture_format_BGRA8888 / GL_APPLE_texture_format_BGRA8888
 			{
 				return error(GL_INVALID_OPERATION, false);
 			}