Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // |
michael@0 | 2 | // Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved. |
michael@0 | 3 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 4 | // found in the LICENSE file. |
michael@0 | 5 | // |
michael@0 | 6 | |
michael@0 | 7 | // utilities.h: Conversion functions and other utility routines. |
michael@0 | 8 | |
michael@0 | 9 | #ifndef LIBGLESV2_UTILITIES_H |
michael@0 | 10 | #define LIBGLESV2_UTILITIES_H |
michael@0 | 11 | |
michael@0 | 12 | #define GL_APICALL |
michael@0 | 13 | #include <GLES2/gl2.h> |
michael@0 | 14 | #include <GLES2/gl2ext.h> |
michael@0 | 15 | |
michael@0 | 16 | #include <string> |
michael@0 | 17 | |
michael@0 | 18 | namespace gl |
michael@0 | 19 | { |
michael@0 | 20 | |
michael@0 | 21 | struct Color; |
michael@0 | 22 | |
michael@0 | 23 | int UniformComponentCount(GLenum type); |
michael@0 | 24 | GLenum UniformComponentType(GLenum type); |
michael@0 | 25 | size_t UniformInternalSize(GLenum type); |
michael@0 | 26 | size_t UniformExternalSize(GLenum type); |
michael@0 | 27 | int VariableRowCount(GLenum type); |
michael@0 | 28 | int VariableColumnCount(GLenum type); |
michael@0 | 29 | |
michael@0 | 30 | int AllocateFirstFreeBits(unsigned int *bits, unsigned int allocationSize, unsigned int bitsSize); |
michael@0 | 31 | |
michael@0 | 32 | void MakeValidSize(bool isImage, bool isCompressed, GLsizei *requestWidth, GLsizei *requestHeight, int *levelOffset); |
michael@0 | 33 | int ComputePixelSize(GLint internalformat); |
michael@0 | 34 | GLsizei ComputePitch(GLsizei width, GLint internalformat, GLint alignment); |
michael@0 | 35 | GLsizei ComputeCompressedPitch(GLsizei width, GLenum format); |
michael@0 | 36 | GLsizei ComputeCompressedSize(GLsizei width, GLsizei height, GLenum format); |
michael@0 | 37 | GLsizei ComputeTypeSize(GLenum type); |
michael@0 | 38 | bool IsCompressed(GLenum format); |
michael@0 | 39 | bool IsDepthTexture(GLenum format); |
michael@0 | 40 | bool IsStencilTexture(GLenum format); |
michael@0 | 41 | bool IsCubemapTextureTarget(GLenum target); |
michael@0 | 42 | bool IsInternalTextureTarget(GLenum target); |
michael@0 | 43 | GLint ConvertSizedInternalFormat(GLenum format, GLenum type); |
michael@0 | 44 | GLenum ExtractFormat(GLenum internalformat); |
michael@0 | 45 | GLenum ExtractType(GLenum internalformat); |
michael@0 | 46 | |
michael@0 | 47 | bool IsColorRenderable(GLenum internalformat); |
michael@0 | 48 | bool IsDepthRenderable(GLenum internalformat); |
michael@0 | 49 | bool IsStencilRenderable(GLenum internalformat); |
michael@0 | 50 | |
michael@0 | 51 | bool IsFloat32Format(GLint internalformat); |
michael@0 | 52 | bool IsFloat16Format(GLint internalformat); |
michael@0 | 53 | |
michael@0 | 54 | GLuint GetAlphaSize(GLenum colorFormat); |
michael@0 | 55 | GLuint GetRedSize(GLenum colorFormat); |
michael@0 | 56 | GLuint GetGreenSize(GLenum colorFormat); |
michael@0 | 57 | GLuint GetBlueSize(GLenum colorFormat); |
michael@0 | 58 | GLuint GetDepthSize(GLenum depthFormat); |
michael@0 | 59 | GLuint GetStencilSize(GLenum stencilFormat); |
michael@0 | 60 | bool IsTriangleMode(GLenum drawMode); |
michael@0 | 61 | |
michael@0 | 62 | } |
michael@0 | 63 | |
michael@0 | 64 | std::string getTempPath(); |
michael@0 | 65 | void writeFile(const char* path, const void* data, size_t size); |
michael@0 | 66 | |
michael@0 | 67 | #endif // LIBGLESV2_UTILITIES_H |