Apply the Apache 2.0 license.

Change-Id: I4a7aeefedcd2d891093520d5a10ebefadcddb5be
Reviewed-on: https://swiftshader-review.googlesource.com/5320
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/libGLES_CM/utilities.h b/src/OpenGL/libGLES_CM/utilities.h
index ef1d6ff..ec2a257 100644
--- a/src/OpenGL/libGLES_CM/utilities.h
+++ b/src/OpenGL/libGLES_CM/utilities.h
@@ -1,82 +1,85 @@
-// SwiftShader Software Renderer

-//

-// Copyright(c) 2005-2013 TransGaming Inc.

-//

-// All rights reserved. No part of this software may be copied, distributed, transmitted,

-// transcribed, stored in a retrieval system, translated into any human or computer

-// language by any means, or disclosed to third parties without the explicit written

-// agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express

-// or implied, including but not limited to any patent rights, are granted to you.

-//

-

-// utilities.h: Conversion functions and other utility routines.

-

-#ifndef LIBGLES_CM_UTILITIES_H

-#define LIBGLES_CM_UTILITIES_H

-

-#include "Device.hpp"

-#include "common/Image.hpp"

-#include "Texture.h"

-

-#include <GLES/gl.h>

-#include <GLES/glext.h>

-

-#include <string>

-

-namespace es1

-{

-	struct Color;

-

-	bool IsCompressed(GLenum format);

-	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);

-

-	bool IsColorRenderable(GLenum internalformat);

-	bool IsDepthRenderable(GLenum internalformat);

-	bool IsStencilRenderable(GLenum internalformat);

-

-	bool IsAlpha(GLenum texFormat);

-	bool IsRGB(GLenum texFormat);

-	bool IsRGBA(GLenum texFormat);

-}

-

-namespace es2sw

-{

-	sw::DepthCompareMode ConvertDepthComparison(GLenum comparison);

-	sw::StencilCompareMode ConvertStencilComparison(GLenum comparison);

-	sw::AlphaCompareMode ConvertAlphaComparison(GLenum comparison);

-	sw::Color<float> ConvertColor(es1::Color color);

-	sw::BlendFactor ConvertBlendFunc(GLenum blend);

-	sw::BlendOperation ConvertBlendOp(GLenum blendOp);

-	sw::LogicalOperation ConvertLogicalOperation(GLenum logicalOperation);

-	sw::StencilOperation ConvertStencilOp(GLenum stencilOp);

-	sw::AddressingMode ConvertTextureWrap(GLenum wrap);

-	sw::CullMode ConvertCullMode(GLenum cullFace, GLenum frontFace);

-	unsigned int ConvertColorMask(bool red, bool green, bool blue, bool alpha);

-	sw::MipmapType ConvertMipMapFilter(GLenum minFilter);

-	sw::FilterType ConvertTextureFilter(GLenum minFilter, GLenum magFilter, float maxAnisotropy);

-	bool ConvertPrimitiveType(GLenum primitiveType, GLsizei elementCount,  GLenum elementType, sw::DrawType &swPrimitiveType, int &primitiveCount);

-	sw::Format ConvertRenderbufferFormat(GLenum format);

-	sw::TextureStage::StageOperation ConvertCombineOperation(GLenum operation);

-	sw::TextureStage::SourceArgument ConvertSourceArgument(GLenum argument);

-	sw::TextureStage::ArgumentModifier ConvertSourceOperand(GLenum operand);

-}

-

-namespace sw2es

-{

-	GLuint GetAlphaSize(sw::Format colorFormat);

-	GLuint GetRedSize(sw::Format colorFormat);

-	GLuint GetGreenSize(sw::Format colorFormat);

-	GLuint GetBlueSize(sw::Format colorFormat);

-	GLuint GetDepthSize(sw::Format depthFormat);

-	GLuint GetStencilSize(sw::Format stencilFormat);

-

-	GLenum ConvertBackBufferFormat(sw::Format format);

-	GLenum ConvertDepthStencilFormat(sw::Format format);

-}

-

-#endif  // LIBGLES_CM_UTILITIES_H

+// Copyright 2016 The SwiftShader Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// utilities.h: Conversion functions and other utility routines.
+
+#ifndef LIBGLES_CM_UTILITIES_H
+#define LIBGLES_CM_UTILITIES_H
+
+#include "Device.hpp"
+#include "common/Image.hpp"
+#include "Texture.h"
+
+#include <GLES/gl.h>
+#include <GLES/glext.h>
+
+#include <string>
+
+namespace es1
+{
+	struct Color;
+
+	bool IsCompressed(GLenum format);
+	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);
+
+	bool IsColorRenderable(GLenum internalformat);
+	bool IsDepthRenderable(GLenum internalformat);
+	bool IsStencilRenderable(GLenum internalformat);
+
+	bool IsAlpha(GLenum texFormat);
+	bool IsRGB(GLenum texFormat);
+	bool IsRGBA(GLenum texFormat);
+}
+
+namespace es2sw
+{
+	sw::DepthCompareMode ConvertDepthComparison(GLenum comparison);
+	sw::StencilCompareMode ConvertStencilComparison(GLenum comparison);
+	sw::AlphaCompareMode ConvertAlphaComparison(GLenum comparison);
+	sw::Color<float> ConvertColor(es1::Color color);
+	sw::BlendFactor ConvertBlendFunc(GLenum blend);
+	sw::BlendOperation ConvertBlendOp(GLenum blendOp);
+	sw::LogicalOperation ConvertLogicalOperation(GLenum logicalOperation);
+	sw::StencilOperation ConvertStencilOp(GLenum stencilOp);
+	sw::AddressingMode ConvertTextureWrap(GLenum wrap);
+	sw::CullMode ConvertCullMode(GLenum cullFace, GLenum frontFace);
+	unsigned int ConvertColorMask(bool red, bool green, bool blue, bool alpha);
+	sw::MipmapType ConvertMipMapFilter(GLenum minFilter);
+	sw::FilterType ConvertTextureFilter(GLenum minFilter, GLenum magFilter, float maxAnisotropy);
+	bool ConvertPrimitiveType(GLenum primitiveType, GLsizei elementCount,  GLenum elementType, sw::DrawType &swPrimitiveType, int &primitiveCount);
+	sw::Format ConvertRenderbufferFormat(GLenum format);
+	sw::TextureStage::StageOperation ConvertCombineOperation(GLenum operation);
+	sw::TextureStage::SourceArgument ConvertSourceArgument(GLenum argument);
+	sw::TextureStage::ArgumentModifier ConvertSourceOperand(GLenum operand);
+}
+
+namespace sw2es
+{
+	GLuint GetAlphaSize(sw::Format colorFormat);
+	GLuint GetRedSize(sw::Format colorFormat);
+	GLuint GetGreenSize(sw::Format colorFormat);
+	GLuint GetBlueSize(sw::Format colorFormat);
+	GLuint GetDepthSize(sw::Format depthFormat);
+	GLuint GetStencilSize(sw::Format stencilFormat);
+
+	GLenum ConvertBackBufferFormat(sw::Format format);
+	GLenum ConvertDepthStencilFormat(sw::Format format);
+}
+
+#endif  // LIBGLES_CM_UTILITIES_H