gfx/angle/src/libGLESv2/utilities.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial