webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
queryconversions.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2014 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 //
6 
7 // queryconversions.h: Declaration of state query cast conversions
8 
9 #ifndef LIBANGLE_QUERY_CONVERSIONS_H_
10 #define LIBANGLE_QUERY_CONVERSIONS_H_
11 
12 #include "angle_gl.h"
13 #include "common/angleutils.h"
14 
15 namespace gl
16 {
17 class Context;
18 
19 // Helper class for converting a GL type to a GLenum:
20 // We can't use CastStateValueEnum generally, because of GLboolean + GLubyte overlap.
21 // We restrict our use to CastStateValue, where it eliminates duplicate parameters.
22 
23 template <typename GLType>
25 {
26  // static constexpr GLenum value;
27 };
28 
29 template <>
31 {
32  static constexpr GLenum value = GL_INT;
33 };
34 template <>
36 {
37  static constexpr GLenum value = GL_UNSIGNED_INT;
38 };
39 template <>
41 {
42  static constexpr GLenum value = GL_BOOL;
43 };
44 template <>
46 {
47  static constexpr GLenum value = GL_INT_64_ANGLEX;
48 };
49 template <>
51 {
52  static constexpr GLenum value = GL_FLOAT;
53 };
54 
55 // The GL state query API types are: bool, int, uint, float, int64
56 template <typename QueryT>
58  unsigned int numParams, QueryT *outParams);
59 
60 // The GL state query API types are: bool, int, uint, float, int64
61 template <typename QueryT>
63  GLenum nativeType,
64  GLenum pname,
65  GLuint index,
66  unsigned int numParams,
67  QueryT *outParams);
68 }
69 
70 #endif // LIBANGLE_QUERY_CONVERSIONS_H_
int GLint
Definition: gl2.h:76
#define GL_INT
Definition: gl2.h:204
#define GL_BOOL
Definition: gl2.h:318
void * Context
Definition: platform_glx.h:177
#define GL_INT_64_ANGLEX
Definition: angleutils.h:178
void CastIndexedStateValues(Context *context, GLenum nativeType, GLenum pname, GLuint index, unsigned int numParams, QueryT *outParams)
Definition: queryconversions.cpp:147
void CastStateValues(Context *context, GLenum nativeType, GLenum pname, unsigned int numParams, QueryT *outParams)
Definition: queryconversions.cpp:90
unsigned int GLenum
Definition: gl2.h:69
GLenum pname
Definition: gl2.h:440
#define GL_FLOAT
Definition: gl2.h:206
khronos_float_t GLfloat
Definition: gl2.h:72
GLuint index
Definition: gl2.h:383
EGLAttrib * value
Definition: eglext.h:120
unsigned int GLuint
Definition: gl2.h:70
khronos_int64_t GLint64
Definition: gl2.h:67
unsigned char GLboolean
Definition: gl2.h:77
Definition: Context.h:59
#define GL_UNSIGNED_INT
Definition: gl2.h:205
Definition: queryconversions.h:24
Definition: entry_points_gles_2_0.h:15
U_CDECL_BEGIN typedef void * context
Definition: ustring.h:1023