Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
michael@0 | 1 | <!DOCTYPE html> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <meta charset="utf-8"> |
michael@0 | 5 | <!-- |
michael@0 | 6 | Copyright (c) 2011 Ilmari Heikkinen. All rights reserved. |
michael@0 | 7 | Use of this source code is governed by a BSD-style license that can be |
michael@0 | 8 | found in the LICENSE file. |
michael@0 | 9 | --> |
michael@0 | 10 | <title>WebGL Constants Test</title> |
michael@0 | 11 | <link rel="stylesheet" href="../../resources/js-test-style.css"/> |
michael@0 | 12 | <script src="../../resources/desktop-gl-constants.js" type="text/javascript"></script> |
michael@0 | 13 | <script src="../../resources/js-test-pre.js"></script> |
michael@0 | 14 | <script src="../resources/webgl-test.js"></script> |
michael@0 | 15 | </head> |
michael@0 | 16 | <body> |
michael@0 | 17 | <div id="description"></div> |
michael@0 | 18 | <div id="console"></div> |
michael@0 | 19 | <canvas id="canvas" style="width: 50px; height: 50px;"> </canvas> |
michael@0 | 20 | <script> |
michael@0 | 21 | description("This test ensures that the WebGL context has all the constants in the specification."); |
michael@0 | 22 | |
michael@0 | 23 | var constants = { |
michael@0 | 24 | /* ClearBufferMask */ |
michael@0 | 25 | DEPTH_BUFFER_BIT : 0x00000100, |
michael@0 | 26 | STENCIL_BUFFER_BIT : 0x00000400, |
michael@0 | 27 | COLOR_BUFFER_BIT : 0x00004000, |
michael@0 | 28 | |
michael@0 | 29 | /* BeginMode */ |
michael@0 | 30 | POINTS : 0x0000, |
michael@0 | 31 | LINES : 0x0001, |
michael@0 | 32 | LINE_LOOP : 0x0002, |
michael@0 | 33 | LINE_STRIP : 0x0003, |
michael@0 | 34 | TRIANGLES : 0x0004, |
michael@0 | 35 | TRIANGLE_STRIP : 0x0005, |
michael@0 | 36 | TRIANGLE_FAN : 0x0006, |
michael@0 | 37 | |
michael@0 | 38 | /* AlphaFunction (not supported in ES20) */ |
michael@0 | 39 | /* NEVER */ |
michael@0 | 40 | /* LESS */ |
michael@0 | 41 | /* EQUAL */ |
michael@0 | 42 | /* LEQUAL */ |
michael@0 | 43 | /* GREATER */ |
michael@0 | 44 | /* NOTEQUAL */ |
michael@0 | 45 | /* GEQUAL */ |
michael@0 | 46 | /* ALWAYS */ |
michael@0 | 47 | |
michael@0 | 48 | /* BlendingFactorDest */ |
michael@0 | 49 | ZERO : 0, |
michael@0 | 50 | ONE : 1, |
michael@0 | 51 | SRC_COLOR : 0x0300, |
michael@0 | 52 | ONE_MINUS_SRC_COLOR : 0x0301, |
michael@0 | 53 | SRC_ALPHA : 0x0302, |
michael@0 | 54 | ONE_MINUS_SRC_ALPHA : 0x0303, |
michael@0 | 55 | DST_ALPHA : 0x0304, |
michael@0 | 56 | ONE_MINUS_DST_ALPHA : 0x0305, |
michael@0 | 57 | |
michael@0 | 58 | /* BlendingFactorSrc */ |
michael@0 | 59 | /* ZERO */ |
michael@0 | 60 | /* ONE */ |
michael@0 | 61 | DST_COLOR : 0x0306, |
michael@0 | 62 | ONE_MINUS_DST_COLOR : 0x0307, |
michael@0 | 63 | SRC_ALPHA_SATURATE : 0x0308, |
michael@0 | 64 | /* SRC_ALPHA */ |
michael@0 | 65 | /* ONE_MINUS_SRC_ALPHA */ |
michael@0 | 66 | /* DST_ALPHA */ |
michael@0 | 67 | /* ONE_MINUS_DST_ALPHA */ |
michael@0 | 68 | |
michael@0 | 69 | /* BlendEquationSeparate */ |
michael@0 | 70 | FUNC_ADD : 0x8006, |
michael@0 | 71 | BLEND_EQUATION : 0x8009, |
michael@0 | 72 | BLEND_EQUATION_RGB : 0x8009, /* same as BLEND_EQUATION */ |
michael@0 | 73 | BLEND_EQUATION_ALPHA : 0x883D, |
michael@0 | 74 | |
michael@0 | 75 | /* BlendSubtract */ |
michael@0 | 76 | FUNC_SUBTRACT : 0x800A, |
michael@0 | 77 | FUNC_REVERSE_SUBTRACT : 0x800B, |
michael@0 | 78 | |
michael@0 | 79 | /* Separate Blend Functions */ |
michael@0 | 80 | BLEND_DST_RGB : 0x80C8, |
michael@0 | 81 | BLEND_SRC_RGB : 0x80C9, |
michael@0 | 82 | BLEND_DST_ALPHA : 0x80CA, |
michael@0 | 83 | BLEND_SRC_ALPHA : 0x80CB, |
michael@0 | 84 | CONSTANT_COLOR : 0x8001, |
michael@0 | 85 | ONE_MINUS_CONSTANT_COLOR : 0x8002, |
michael@0 | 86 | CONSTANT_ALPHA : 0x8003, |
michael@0 | 87 | ONE_MINUS_CONSTANT_ALPHA : 0x8004, |
michael@0 | 88 | BLEND_COLOR : 0x8005, |
michael@0 | 89 | |
michael@0 | 90 | /* Buffer Objects */ |
michael@0 | 91 | ARRAY_BUFFER : 0x8892, |
michael@0 | 92 | ELEMENT_ARRAY_BUFFER : 0x8893, |
michael@0 | 93 | ARRAY_BUFFER_BINDING : 0x8894, |
michael@0 | 94 | ELEMENT_ARRAY_BUFFER_BINDING : 0x8895, |
michael@0 | 95 | |
michael@0 | 96 | STREAM_DRAW : 0x88E0, |
michael@0 | 97 | STATIC_DRAW : 0x88E4, |
michael@0 | 98 | DYNAMIC_DRAW : 0x88E8, |
michael@0 | 99 | |
michael@0 | 100 | BUFFER_SIZE : 0x8764, |
michael@0 | 101 | BUFFER_USAGE : 0x8765, |
michael@0 | 102 | |
michael@0 | 103 | CURRENT_VERTEX_ATTRIB : 0x8626, |
michael@0 | 104 | |
michael@0 | 105 | /* CullFaceMode */ |
michael@0 | 106 | FRONT : 0x0404, |
michael@0 | 107 | BACK : 0x0405, |
michael@0 | 108 | FRONT_AND_BACK : 0x0408, |
michael@0 | 109 | |
michael@0 | 110 | /* DepthFunction */ |
michael@0 | 111 | /* NEVER */ |
michael@0 | 112 | /* LESS */ |
michael@0 | 113 | /* EQUAL */ |
michael@0 | 114 | /* LEQUAL */ |
michael@0 | 115 | /* GREATER */ |
michael@0 | 116 | /* NOTEQUAL */ |
michael@0 | 117 | /* GEQUAL */ |
michael@0 | 118 | /* ALWAYS */ |
michael@0 | 119 | |
michael@0 | 120 | /* EnableCap */ |
michael@0 | 121 | /* TEXTURE_2D */ |
michael@0 | 122 | CULL_FACE : 0x0B44, |
michael@0 | 123 | BLEND : 0x0BE2, |
michael@0 | 124 | DITHER : 0x0BD0, |
michael@0 | 125 | STENCIL_TEST : 0x0B90, |
michael@0 | 126 | DEPTH_TEST : 0x0B71, |
michael@0 | 127 | SCISSOR_TEST : 0x0C11, |
michael@0 | 128 | POLYGON_OFFSET_FILL : 0x8037, |
michael@0 | 129 | SAMPLE_ALPHA_TO_COVERAGE : 0x809E, |
michael@0 | 130 | SAMPLE_COVERAGE : 0x80A0, |
michael@0 | 131 | |
michael@0 | 132 | /* ErrorCode */ |
michael@0 | 133 | NO_ERROR : 0, |
michael@0 | 134 | INVALID_ENUM : 0x0500, |
michael@0 | 135 | INVALID_VALUE : 0x0501, |
michael@0 | 136 | INVALID_OPERATION : 0x0502, |
michael@0 | 137 | OUT_OF_MEMORY : 0x0505, |
michael@0 | 138 | |
michael@0 | 139 | /* FrontFaceDirection */ |
michael@0 | 140 | CW : 0x0900, |
michael@0 | 141 | CCW : 0x0901, |
michael@0 | 142 | |
michael@0 | 143 | /* GetPName */ |
michael@0 | 144 | LINE_WIDTH : 0x0B21, |
michael@0 | 145 | ALIASED_POINT_SIZE_RANGE : 0x846D, |
michael@0 | 146 | ALIASED_LINE_WIDTH_RANGE : 0x846E, |
michael@0 | 147 | CULL_FACE_MODE : 0x0B45, |
michael@0 | 148 | FRONT_FACE : 0x0B46, |
michael@0 | 149 | DEPTH_RANGE : 0x0B70, |
michael@0 | 150 | DEPTH_WRITEMASK : 0x0B72, |
michael@0 | 151 | DEPTH_CLEAR_VALUE : 0x0B73, |
michael@0 | 152 | DEPTH_FUNC : 0x0B74, |
michael@0 | 153 | STENCIL_CLEAR_VALUE : 0x0B91, |
michael@0 | 154 | STENCIL_FUNC : 0x0B92, |
michael@0 | 155 | STENCIL_FAIL : 0x0B94, |
michael@0 | 156 | STENCIL_PASS_DEPTH_FAIL : 0x0B95, |
michael@0 | 157 | STENCIL_PASS_DEPTH_PASS : 0x0B96, |
michael@0 | 158 | STENCIL_REF : 0x0B97, |
michael@0 | 159 | STENCIL_VALUE_MASK : 0x0B93, |
michael@0 | 160 | STENCIL_WRITEMASK : 0x0B98, |
michael@0 | 161 | STENCIL_BACK_FUNC : 0x8800, |
michael@0 | 162 | STENCIL_BACK_FAIL : 0x8801, |
michael@0 | 163 | STENCIL_BACK_PASS_DEPTH_FAIL : 0x8802, |
michael@0 | 164 | STENCIL_BACK_PASS_DEPTH_PASS : 0x8803, |
michael@0 | 165 | STENCIL_BACK_REF : 0x8CA3, |
michael@0 | 166 | STENCIL_BACK_VALUE_MASK : 0x8CA4, |
michael@0 | 167 | STENCIL_BACK_WRITEMASK : 0x8CA5, |
michael@0 | 168 | VIEWPORT : 0x0BA2, |
michael@0 | 169 | SCISSOR_BOX : 0x0C10, |
michael@0 | 170 | /* SCISSOR_TEST */ |
michael@0 | 171 | COLOR_CLEAR_VALUE : 0x0C22, |
michael@0 | 172 | COLOR_WRITEMASK : 0x0C23, |
michael@0 | 173 | UNPACK_ALIGNMENT : 0x0CF5, |
michael@0 | 174 | PACK_ALIGNMENT : 0x0D05, |
michael@0 | 175 | MAX_TEXTURE_SIZE : 0x0D33, |
michael@0 | 176 | MAX_VIEWPORT_DIMS : 0x0D3A, |
michael@0 | 177 | SUBPIXEL_BITS : 0x0D50, |
michael@0 | 178 | RED_BITS : 0x0D52, |
michael@0 | 179 | GREEN_BITS : 0x0D53, |
michael@0 | 180 | BLUE_BITS : 0x0D54, |
michael@0 | 181 | ALPHA_BITS : 0x0D55, |
michael@0 | 182 | DEPTH_BITS : 0x0D56, |
michael@0 | 183 | STENCIL_BITS : 0x0D57, |
michael@0 | 184 | POLYGON_OFFSET_UNITS : 0x2A00, |
michael@0 | 185 | /* POLYGON_OFFSET_FILL */ |
michael@0 | 186 | POLYGON_OFFSET_FACTOR : 0x8038, |
michael@0 | 187 | TEXTURE_BINDING_2D : 0x8069, |
michael@0 | 188 | SAMPLE_BUFFERS : 0x80A8, |
michael@0 | 189 | SAMPLES : 0x80A9, |
michael@0 | 190 | SAMPLE_COVERAGE_VALUE : 0x80AA, |
michael@0 | 191 | SAMPLE_COVERAGE_INVERT : 0x80AB, |
michael@0 | 192 | |
michael@0 | 193 | /* GetTextureParameter */ |
michael@0 | 194 | /* TEXTURE_MAG_FILTER */ |
michael@0 | 195 | /* TEXTURE_MIN_FILTER */ |
michael@0 | 196 | /* TEXTURE_WRAP_S */ |
michael@0 | 197 | /* TEXTURE_WRAP_T */ |
michael@0 | 198 | |
michael@0 | 199 | COMPRESSED_TEXTURE_FORMATS : 0x86A3, |
michael@0 | 200 | |
michael@0 | 201 | /* HintMode */ |
michael@0 | 202 | DONT_CARE : 0x1100, |
michael@0 | 203 | FASTEST : 0x1101, |
michael@0 | 204 | NICEST : 0x1102, |
michael@0 | 205 | |
michael@0 | 206 | /* HintTarget */ |
michael@0 | 207 | GENERATE_MIPMAP_HINT : 0x8192, |
michael@0 | 208 | |
michael@0 | 209 | /* DataType */ |
michael@0 | 210 | BYTE : 0x1400, |
michael@0 | 211 | UNSIGNED_BYTE : 0x1401, |
michael@0 | 212 | SHORT : 0x1402, |
michael@0 | 213 | UNSIGNED_SHORT : 0x1403, |
michael@0 | 214 | INT : 0x1404, |
michael@0 | 215 | UNSIGNED_INT : 0x1405, |
michael@0 | 216 | FLOAT : 0x1406, |
michael@0 | 217 | |
michael@0 | 218 | /* PixelFormat */ |
michael@0 | 219 | DEPTH_COMPONENT : 0x1902, |
michael@0 | 220 | ALPHA : 0x1906, |
michael@0 | 221 | RGB : 0x1907, |
michael@0 | 222 | RGBA : 0x1908, |
michael@0 | 223 | LUMINANCE : 0x1909, |
michael@0 | 224 | LUMINANCE_ALPHA : 0x190A, |
michael@0 | 225 | |
michael@0 | 226 | /* PixelType */ |
michael@0 | 227 | /* UNSIGNED_BYTE */ |
michael@0 | 228 | UNSIGNED_SHORT_4_4_4_4 : 0x8033, |
michael@0 | 229 | UNSIGNED_SHORT_5_5_5_1 : 0x8034, |
michael@0 | 230 | UNSIGNED_SHORT_5_6_5 : 0x8363, |
michael@0 | 231 | |
michael@0 | 232 | /* Shaders */ |
michael@0 | 233 | FRAGMENT_SHADER : 0x8B30, |
michael@0 | 234 | VERTEX_SHADER : 0x8B31, |
michael@0 | 235 | MAX_VERTEX_ATTRIBS : 0x8869, |
michael@0 | 236 | MAX_VERTEX_UNIFORM_VECTORS : 0x8DFB, |
michael@0 | 237 | MAX_VARYING_VECTORS : 0x8DFC, |
michael@0 | 238 | MAX_COMBINED_TEXTURE_IMAGE_UNITS : 0x8B4D, |
michael@0 | 239 | MAX_VERTEX_TEXTURE_IMAGE_UNITS : 0x8B4C, |
michael@0 | 240 | MAX_TEXTURE_IMAGE_UNITS : 0x8872, |
michael@0 | 241 | MAX_FRAGMENT_UNIFORM_VECTORS : 0x8DFD, |
michael@0 | 242 | SHADER_TYPE : 0x8B4F, |
michael@0 | 243 | DELETE_STATUS : 0x8B80, |
michael@0 | 244 | LINK_STATUS : 0x8B82, |
michael@0 | 245 | VALIDATE_STATUS : 0x8B83, |
michael@0 | 246 | ATTACHED_SHADERS : 0x8B85, |
michael@0 | 247 | ACTIVE_UNIFORMS : 0x8B86, |
michael@0 | 248 | ACTIVE_ATTRIBUTES : 0x8B89, |
michael@0 | 249 | SHADING_LANGUAGE_VERSION : 0x8B8C, |
michael@0 | 250 | CURRENT_PROGRAM : 0x8B8D, |
michael@0 | 251 | |
michael@0 | 252 | /* StencilFunction */ |
michael@0 | 253 | NEVER : 0x0200, |
michael@0 | 254 | LESS : 0x0201, |
michael@0 | 255 | EQUAL : 0x0202, |
michael@0 | 256 | LEQUAL : 0x0203, |
michael@0 | 257 | GREATER : 0x0204, |
michael@0 | 258 | NOTEQUAL : 0x0205, |
michael@0 | 259 | GEQUAL : 0x0206, |
michael@0 | 260 | ALWAYS : 0x0207, |
michael@0 | 261 | |
michael@0 | 262 | /* StencilOp */ |
michael@0 | 263 | /* ZERO */ |
michael@0 | 264 | KEEP : 0x1E00, |
michael@0 | 265 | REPLACE : 0x1E01, |
michael@0 | 266 | INCR : 0x1E02, |
michael@0 | 267 | DECR : 0x1E03, |
michael@0 | 268 | INVERT : 0x150A, |
michael@0 | 269 | INCR_WRAP : 0x8507, |
michael@0 | 270 | DECR_WRAP : 0x8508, |
michael@0 | 271 | |
michael@0 | 272 | /* StringName */ |
michael@0 | 273 | VENDOR : 0x1F00, |
michael@0 | 274 | RENDERER : 0x1F01, |
michael@0 | 275 | VERSION : 0x1F02, |
michael@0 | 276 | |
michael@0 | 277 | /* TextureMagFilter */ |
michael@0 | 278 | NEAREST : 0x2600, |
michael@0 | 279 | LINEAR : 0x2601, |
michael@0 | 280 | |
michael@0 | 281 | /* TextureMinFilter */ |
michael@0 | 282 | /* NEAREST */ |
michael@0 | 283 | /* LINEAR */ |
michael@0 | 284 | NEAREST_MIPMAP_NEAREST : 0x2700, |
michael@0 | 285 | LINEAR_MIPMAP_NEAREST : 0x2701, |
michael@0 | 286 | NEAREST_MIPMAP_LINEAR : 0x2702, |
michael@0 | 287 | LINEAR_MIPMAP_LINEAR : 0x2703, |
michael@0 | 288 | |
michael@0 | 289 | /* TextureParameterName */ |
michael@0 | 290 | TEXTURE_MAG_FILTER : 0x2800, |
michael@0 | 291 | TEXTURE_MIN_FILTER : 0x2801, |
michael@0 | 292 | TEXTURE_WRAP_S : 0x2802, |
michael@0 | 293 | TEXTURE_WRAP_T : 0x2803, |
michael@0 | 294 | |
michael@0 | 295 | /* TextureTarget */ |
michael@0 | 296 | TEXTURE_2D : 0x0DE1, |
michael@0 | 297 | TEXTURE : 0x1702, |
michael@0 | 298 | |
michael@0 | 299 | TEXTURE_CUBE_MAP : 0x8513, |
michael@0 | 300 | TEXTURE_BINDING_CUBE_MAP : 0x8514, |
michael@0 | 301 | TEXTURE_CUBE_MAP_POSITIVE_X : 0x8515, |
michael@0 | 302 | TEXTURE_CUBE_MAP_NEGATIVE_X : 0x8516, |
michael@0 | 303 | TEXTURE_CUBE_MAP_POSITIVE_Y : 0x8517, |
michael@0 | 304 | TEXTURE_CUBE_MAP_NEGATIVE_Y : 0x8518, |
michael@0 | 305 | TEXTURE_CUBE_MAP_POSITIVE_Z : 0x8519, |
michael@0 | 306 | TEXTURE_CUBE_MAP_NEGATIVE_Z : 0x851A, |
michael@0 | 307 | MAX_CUBE_MAP_TEXTURE_SIZE : 0x851C, |
michael@0 | 308 | |
michael@0 | 309 | /* TextureUnit */ |
michael@0 | 310 | TEXTURE0 : 0x84C0, |
michael@0 | 311 | TEXTURE1 : 0x84C1, |
michael@0 | 312 | TEXTURE2 : 0x84C2, |
michael@0 | 313 | TEXTURE3 : 0x84C3, |
michael@0 | 314 | TEXTURE4 : 0x84C4, |
michael@0 | 315 | TEXTURE5 : 0x84C5, |
michael@0 | 316 | TEXTURE6 : 0x84C6, |
michael@0 | 317 | TEXTURE7 : 0x84C7, |
michael@0 | 318 | TEXTURE8 : 0x84C8, |
michael@0 | 319 | TEXTURE9 : 0x84C9, |
michael@0 | 320 | TEXTURE10 : 0x84CA, |
michael@0 | 321 | TEXTURE11 : 0x84CB, |
michael@0 | 322 | TEXTURE12 : 0x84CC, |
michael@0 | 323 | TEXTURE13 : 0x84CD, |
michael@0 | 324 | TEXTURE14 : 0x84CE, |
michael@0 | 325 | TEXTURE15 : 0x84CF, |
michael@0 | 326 | TEXTURE16 : 0x84D0, |
michael@0 | 327 | TEXTURE17 : 0x84D1, |
michael@0 | 328 | TEXTURE18 : 0x84D2, |
michael@0 | 329 | TEXTURE19 : 0x84D3, |
michael@0 | 330 | TEXTURE20 : 0x84D4, |
michael@0 | 331 | TEXTURE21 : 0x84D5, |
michael@0 | 332 | TEXTURE22 : 0x84D6, |
michael@0 | 333 | TEXTURE23 : 0x84D7, |
michael@0 | 334 | TEXTURE24 : 0x84D8, |
michael@0 | 335 | TEXTURE25 : 0x84D9, |
michael@0 | 336 | TEXTURE26 : 0x84DA, |
michael@0 | 337 | TEXTURE27 : 0x84DB, |
michael@0 | 338 | TEXTURE28 : 0x84DC, |
michael@0 | 339 | TEXTURE29 : 0x84DD, |
michael@0 | 340 | TEXTURE30 : 0x84DE, |
michael@0 | 341 | TEXTURE31 : 0x84DF, |
michael@0 | 342 | ACTIVE_TEXTURE : 0x84E0, |
michael@0 | 343 | |
michael@0 | 344 | /* TextureWrapMode */ |
michael@0 | 345 | REPEAT : 0x2901, |
michael@0 | 346 | CLAMP_TO_EDGE : 0x812F, |
michael@0 | 347 | MIRRORED_REPEAT : 0x8370, |
michael@0 | 348 | |
michael@0 | 349 | /* Uniform Types */ |
michael@0 | 350 | FLOAT_VEC2 : 0x8B50, |
michael@0 | 351 | FLOAT_VEC3 : 0x8B51, |
michael@0 | 352 | FLOAT_VEC4 : 0x8B52, |
michael@0 | 353 | INT_VEC2 : 0x8B53, |
michael@0 | 354 | INT_VEC3 : 0x8B54, |
michael@0 | 355 | INT_VEC4 : 0x8B55, |
michael@0 | 356 | BOOL : 0x8B56, |
michael@0 | 357 | BOOL_VEC2 : 0x8B57, |
michael@0 | 358 | BOOL_VEC3 : 0x8B58, |
michael@0 | 359 | BOOL_VEC4 : 0x8B59, |
michael@0 | 360 | FLOAT_MAT2 : 0x8B5A, |
michael@0 | 361 | FLOAT_MAT3 : 0x8B5B, |
michael@0 | 362 | FLOAT_MAT4 : 0x8B5C, |
michael@0 | 363 | SAMPLER_2D : 0x8B5E, |
michael@0 | 364 | SAMPLER_CUBE : 0x8B60, |
michael@0 | 365 | |
michael@0 | 366 | /* Vertex Arrays */ |
michael@0 | 367 | VERTEX_ATTRIB_ARRAY_ENABLED : 0x8622, |
michael@0 | 368 | VERTEX_ATTRIB_ARRAY_SIZE : 0x8623, |
michael@0 | 369 | VERTEX_ATTRIB_ARRAY_STRIDE : 0x8624, |
michael@0 | 370 | VERTEX_ATTRIB_ARRAY_TYPE : 0x8625, |
michael@0 | 371 | VERTEX_ATTRIB_ARRAY_NORMALIZED : 0x886A, |
michael@0 | 372 | VERTEX_ATTRIB_ARRAY_POINTER : 0x8645, |
michael@0 | 373 | VERTEX_ATTRIB_ARRAY_BUFFER_BINDING : 0x889F, |
michael@0 | 374 | |
michael@0 | 375 | /* Shader Source */ |
michael@0 | 376 | COMPILE_STATUS : 0x8B81, |
michael@0 | 377 | |
michael@0 | 378 | /* Shader Precision-Specified Types */ |
michael@0 | 379 | LOW_FLOAT : 0x8DF0, |
michael@0 | 380 | MEDIUM_FLOAT : 0x8DF1, |
michael@0 | 381 | HIGH_FLOAT : 0x8DF2, |
michael@0 | 382 | LOW_INT : 0x8DF3, |
michael@0 | 383 | MEDIUM_INT : 0x8DF4, |
michael@0 | 384 | HIGH_INT : 0x8DF5, |
michael@0 | 385 | |
michael@0 | 386 | /* Framebuffer Object. */ |
michael@0 | 387 | FRAMEBUFFER : 0x8D40, |
michael@0 | 388 | RENDERBUFFER : 0x8D41, |
michael@0 | 389 | |
michael@0 | 390 | RGBA4 : 0x8056, |
michael@0 | 391 | RGB5_A1 : 0x8057, |
michael@0 | 392 | RGB565 : 0x8D62, |
michael@0 | 393 | DEPTH_COMPONENT16 : 0x81A5, |
michael@0 | 394 | STENCIL_INDEX : 0x1901, |
michael@0 | 395 | STENCIL_INDEX8 : 0x8D48, |
michael@0 | 396 | DEPTH_STENCIL : 0x84F9, |
michael@0 | 397 | |
michael@0 | 398 | RENDERBUFFER_WIDTH : 0x8D42, |
michael@0 | 399 | RENDERBUFFER_HEIGHT : 0x8D43, |
michael@0 | 400 | RENDERBUFFER_INTERNAL_FORMAT : 0x8D44, |
michael@0 | 401 | RENDERBUFFER_RED_SIZE : 0x8D50, |
michael@0 | 402 | RENDERBUFFER_GREEN_SIZE : 0x8D51, |
michael@0 | 403 | RENDERBUFFER_BLUE_SIZE : 0x8D52, |
michael@0 | 404 | RENDERBUFFER_ALPHA_SIZE : 0x8D53, |
michael@0 | 405 | RENDERBUFFER_DEPTH_SIZE : 0x8D54, |
michael@0 | 406 | RENDERBUFFER_STENCIL_SIZE : 0x8D55, |
michael@0 | 407 | |
michael@0 | 408 | FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE : 0x8CD0, |
michael@0 | 409 | FRAMEBUFFER_ATTACHMENT_OBJECT_NAME : 0x8CD1, |
michael@0 | 410 | FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL : 0x8CD2, |
michael@0 | 411 | FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE : 0x8CD3, |
michael@0 | 412 | |
michael@0 | 413 | COLOR_ATTACHMENT0 : 0x8CE0, |
michael@0 | 414 | DEPTH_ATTACHMENT : 0x8D00, |
michael@0 | 415 | STENCIL_ATTACHMENT : 0x8D20, |
michael@0 | 416 | DEPTH_STENCIL_ATTACHMENT : 0x821A, |
michael@0 | 417 | |
michael@0 | 418 | NONE : 0, |
michael@0 | 419 | |
michael@0 | 420 | FRAMEBUFFER_COMPLETE : 0x8CD5, |
michael@0 | 421 | FRAMEBUFFER_INCOMPLETE_ATTACHMENT : 0x8CD6, |
michael@0 | 422 | FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT : 0x8CD7, |
michael@0 | 423 | FRAMEBUFFER_INCOMPLETE_DIMENSIONS : 0x8CD9, |
michael@0 | 424 | FRAMEBUFFER_UNSUPPORTED : 0x8CDD, |
michael@0 | 425 | |
michael@0 | 426 | FRAMEBUFFER_BINDING : 0x8CA6, |
michael@0 | 427 | RENDERBUFFER_BINDING : 0x8CA7, |
michael@0 | 428 | MAX_RENDERBUFFER_SIZE : 0x84E8, |
michael@0 | 429 | |
michael@0 | 430 | INVALID_FRAMEBUFFER_OPERATION : 0x0506, |
michael@0 | 431 | |
michael@0 | 432 | /* WebGL-specific enums */ |
michael@0 | 433 | UNPACK_FLIP_Y_WEBGL : 0x9240, |
michael@0 | 434 | UNPACK_PREMULTIPLY_ALPHA_WEBGL : 0x9241, |
michael@0 | 435 | CONTEXT_LOST_WEBGL : 0x9242, |
michael@0 | 436 | UNPACK_COLORSPACE_CONVERSION_WEBGL : 0x9243, |
michael@0 | 437 | BROWSER_DEFAULT_WEBGL : 0x9244 |
michael@0 | 438 | }; |
michael@0 | 439 | |
michael@0 | 440 | function assertProperty(v, p) { |
michael@0 | 441 | if (v[p] == null) { |
michael@0 | 442 | testFailed("Property does not exist: " + p) |
michael@0 | 443 | return false; |
michael@0 | 444 | } else { |
michael@0 | 445 | return true; |
michael@0 | 446 | } |
michael@0 | 447 | } |
michael@0 | 448 | |
michael@0 | 449 | function assertMsg_(bool, msg) { |
michael@0 | 450 | if (!bool) // show only failures to avoid spamming result list |
michael@0 | 451 | assertMsg(bool, msg); |
michael@0 | 452 | return bool; |
michael@0 | 453 | } |
michael@0 | 454 | |
michael@0 | 455 | debug(""); |
michael@0 | 456 | debug("Canvas.getContext"); |
michael@0 | 457 | |
michael@0 | 458 | var canvas = document.getElementById("canvas"); |
michael@0 | 459 | var gl = create3DContext(canvas); |
michael@0 | 460 | var passed = true; |
michael@0 | 461 | for (var i in constants) { |
michael@0 | 462 | var r = assertProperty(gl, i) && assertMsg_(gl[i] == constants[i], "Property "+i+" value test "+gl[i]+" == "+constants[i]); |
michael@0 | 463 | passed = passed && r; |
michael@0 | 464 | } |
michael@0 | 465 | if (passed) { |
michael@0 | 466 | testPassed("All WebGL constants found to have correct values."); |
michael@0 | 467 | } |
michael@0 | 468 | var extended = false; |
michael@0 | 469 | for (var i in gl) { |
michael@0 | 470 | if (i.match(/^[^a-z]/) && constants[i] == null) { |
michael@0 | 471 | if (!extended) { |
michael@0 | 472 | extended = true; |
michael@0 | 473 | debug("Also found the following extra constants:"); |
michael@0 | 474 | } |
michael@0 | 475 | debug(i); |
michael@0 | 476 | } |
michael@0 | 477 | } |
michael@0 | 478 | |
michael@0 | 479 | debug(""); |
michael@0 | 480 | successfullyParsed = true; |
michael@0 | 481 | </script> |
michael@0 | 482 | <script>finishTest();</script> |
michael@0 | 483 | |
michael@0 | 484 | </body> |
michael@0 | 485 | </html> |