Source/WebCore/ChangeLog

 12018-05-03 Justin Fan <justin_fan@apple.com>
 2
 3 Hooked up ASTC support in WebGL. Requires OpenGL ES 3 context to work.
 4 Also added in Khronos' ASTC test from version 1.0.4 beta of their conformance test suite,
 5 although again, this requires OpenGL ES 3 context for WebKit to detect proper support.
 6 https://bugs.webkit.org/show_bug.cgi?id=185272
 7
 8 Reviewed by NOBODY (OOPS!).
 9
 10 Test: fast/canvas/webgl/webgl-compressed-texture-astc.html
 11
 12 * DerivedSources.make:
 13 * Sources.txt:
 14 * WebCore.xcodeproj/project.pbxproj:
 15 * bindings/js/JSDOMConvertWebGL.cpp:
 16 (WebCore::convertToJSValue):
 17 * html/canvas/WebGL2RenderingContext.cpp:
 18 (WebCore::WebGL2RenderingContext::getExtension):
 19 (WebCore::WebGL2RenderingContext::getSupportedExtensions):
 20 * html/canvas/WebGLCompressedTextureASTC.cpp: Added.
 21 (WebCore::WebGLCompressedTextureASTC::WebGLCompressedTextureASTC):
 22 (WebCore::WebGLCompressedTextureASTC::getName const):
 23 (WebCore::WebGLCompressedTextureASTC::supported):
 24 (WebCore::WebGLCompressedTextureASTC::getSupportedProfiles):
 25 * html/canvas/WebGLCompressedTextureASTC.h: Added.
 26 * html/canvas/WebGLCompressedTextureASTC.idl: Added.
 27 * html/canvas/WebGLExtension.h:
 28 * html/canvas/WebGLRenderingContext.cpp:
 29 (WebCore::WebGLRenderingContext::getExtension):
 30 (WebCore::WebGLRenderingContext::getSupportedExtensions):
 31 * html/canvas/WebGLRenderingContextBase.cpp:
 32 (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData):
 33 (WebCore::WebGLRenderingContextBase::validateCompressedTexDimensions):
 34 * html/canvas/WebGLRenderingContextBase.h:
 35 * platform/graphics/Extensions3D.h:
 36
1372018-05-08 Daniel Bates <dabates@apple.com>
238
339 Resign Strong Password appearance when text field value changes

Source/WebCore/CMakeLists.txt

@@if (ENABLE_WEBGL)
11691169 html/canvas/OESVertexArrayObject.cpp
11701170 html/canvas/WebGL2RenderingContext.cpp
11711171 html/canvas/WebGLBuffer.cpp
 1172 html/canvas/WebGLCompressedTextureASTC.cpp
11721173 html/canvas/WebGLCompressedTextureATC.cpp
11731174 html/canvas/WebGLCompressedTexturePVRTC.cpp
11741175 html/canvas/WebGLCompressedTextureS3TC.cpp

@@if (ENABLE_WEBGL)
12171218 html/canvas/WebGL2RenderingContext.idl
12181219 html/canvas/WebGLActiveInfo.idl
12191220 html/canvas/WebGLBuffer.idl
 1221 html/canvas/WebGLCompressedTextureASTC.idl
12201222 html/canvas/WebGLCompressedTextureATC.idl
12211223 html/canvas/WebGLCompressedTexturePVRTC.idl
12221224 html/canvas/WebGLCompressedTextureS3TC.idl

Source/WebCore/DerivedSources.make

@@JS_BINDING_IDLS = \
693693 $(WebCore)/html/canvas/WebGL2RenderingContext.idl \
694694 $(WebCore)/html/canvas/WebGLActiveInfo.idl \
695695 $(WebCore)/html/canvas/WebGLBuffer.idl \
 696 $(WebCore)/html/canvas/WebGLCompressedTextureASTC.idl \
696697 $(WebCore)/html/canvas/WebGLCompressedTextureATC.idl \
697698 $(WebCore)/html/canvas/WebGLCompressedTexturePVRTC.idl \
698699 $(WebCore)/html/canvas/WebGLCompressedTextureS3TC.idl \

Source/WebCore/Sources.txt

@@JSOESVertexArrayObject.cpp
31943194JSWebGL2RenderingContext.cpp
31953195JSWebGLActiveInfo.cpp
31963196JSWebGLBuffer.cpp
 3197JSWebGLCompressedTextureASTC.cpp
31973198JSWebGLCompressedTextureATC.cpp
31983199JSWebGLCompressedTexturePVRTC.cpp
31993200JSWebGLCompressedTextureS3TC.cpp

Source/WebCore/WebCore.xcodeproj/project.pbxproj

41064106 D05CED2A0A40BB2C00C5AF38 /* FormatBlockCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D05CED280A40BB2C00C5AF38 /* FormatBlockCommand.h */; };
41074107 D06C0D8F0CFD11460065F43F /* RemoveFormatCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D06C0D8D0CFD11460065F43F /* RemoveFormatCommand.h */; };
41084108 D07DEABA0A36554A00CA30F8 /* InsertListCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D07DEAB80A36554A00CA30F8 /* InsertListCommand.h */; };
 4109 D0845CEE20A11F4C0009BC6C /* WebGLCompressedTextureASTC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0A20D562092A0A600E0C259 /* WebGLCompressedTextureASTC.cpp */; };
 4110 D0845CF020A11F590009BC6C /* WebGLCompressedTextureASTC.h in Headers */ = {isa = PBXBuildFile; fileRef = D0A20D542092A0A600E0C259 /* WebGLCompressedTextureASTC.h */; settings = {ATTRIBUTES = (Private, ); }; };
41094111 D086FE9809D53AAB005BC74D /* UnlinkCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D086FE9609D53AAB005BC74D /* UnlinkCommand.h */; };
 4112 D0A20D572092A0A700E0C259 /* WebGLCompressedTextureASTC.h in Headers */ = {isa = PBXBuildFile; fileRef = D0A20D542092A0A600E0C259 /* WebGLCompressedTextureASTC.h */; };
 4113 D0A20D582092A0A700E0C259 /* WebGLCompressedTextureASTC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0A20D562092A0A600E0C259 /* WebGLCompressedTextureASTC.cpp */; };
41104114 D0A3A7311405A39800FB8ED3 /* ResourceLoaderOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = D0A3A7301405A39800FB8ED3 /* ResourceLoaderOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
41114115 D0B0556809C6700100307E43 /* CreateLinkCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D0B0556609C6700100307E43 /* CreateLinkCommand.h */; };
41124116 D0BC54491443AC4A00E105DA /* CachedStyleSheetClient.h in Headers */ = {isa = PBXBuildFile; fileRef = D0BC54481443AC4A00E105DA /* CachedStyleSheetClient.h */; settings = {ATTRIBUTES = (Private, ); }; };

1347513479 D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpaceSplitString.h; sourceTree = "<group>"; };
1347613480 D02B64B014089E56006EFA21 /* DictationPhraseWithAlternativesDot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = DictationPhraseWithAlternativesDot.png; sourceTree = "<group>"; };
1347713481 D02B64B114089E56006EFA21 /* DictationPhraseWithAlternativesDot@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "DictationPhraseWithAlternativesDot@2x.png"; sourceTree = "<group>"; };
 13482 D036DD8D208FFC0C00F9F4B2 /* WebGLCompressedTextureASTC.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGLCompressedTextureASTC.idl; sourceTree = "<group>"; };
1347813483 D05CED270A40BB2C00C5AF38 /* FormatBlockCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FormatBlockCommand.cpp; sourceTree = "<group>"; };
1347913484 D05CED280A40BB2C00C5AF38 /* FormatBlockCommand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FormatBlockCommand.h; sourceTree = "<group>"; };
1348013485 D06C0D8D0CFD11460065F43F /* RemoveFormatCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoveFormatCommand.h; sourceTree = "<group>"; };

1348313488 D07DEAB80A36554A00CA30F8 /* InsertListCommand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InsertListCommand.h; sourceTree = "<group>"; };
1348413489 D086FE9609D53AAB005BC74D /* UnlinkCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnlinkCommand.h; sourceTree = "<group>"; };
1348513490 D086FE9709D53AAB005BC74D /* UnlinkCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UnlinkCommand.cpp; sourceTree = "<group>"; };
 13491 D0A20D542092A0A600E0C259 /* WebGLCompressedTextureASTC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLCompressedTextureASTC.h; sourceTree = "<group>"; };
 13492 D0A20D562092A0A600E0C259 /* WebGLCompressedTextureASTC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebGLCompressedTextureASTC.cpp; sourceTree = "<group>"; };
1348613493 D0A3A7301405A39800FB8ED3 /* ResourceLoaderOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoaderOptions.h; sourceTree = "<group>"; };
1348713494 D0B0556609C6700100307E43 /* CreateLinkCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CreateLinkCommand.h; sourceTree = "<group>"; };
1348813495 D0B0556709C6700100307E43 /* CreateLinkCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CreateLinkCommand.cpp; sourceTree = "<group>"; };

1725617263 49C7B9A81042D32E0009D447 /* WebGLBuffer.cpp */,
1725717264 49C7B9A91042D32E0009D447 /* WebGLBuffer.h */,
1725817265 49C7B9AA1042D32E0009D447 /* WebGLBuffer.idl */,
 17266 D0A20D562092A0A600E0C259 /* WebGLCompressedTextureASTC.cpp */,
 17267 D0A20D542092A0A600E0C259 /* WebGLCompressedTextureASTC.h */,
 17268 D036DD8D208FFC0C00F9F4B2 /* WebGLCompressedTextureASTC.idl */,
1725917269 7E66E23116D6EB6C00F7E7FF /* WebGLCompressedTextureATC.cpp */,
1726017270 7E66E23216D6EB6C00F7E7FF /* WebGLCompressedTextureATC.h */,
1726117271 7EA30F6216DFD62700257D0B /* WebGLCompressedTextureATC.idl */,

3073930749 6E47E66110B7944B00B186C8 /* WebGLAny.h in Headers */,
3074030750 1AFFC4581D5E865500267A66 /* WebGLBlacklist.h in Headers */,
3074130751 49C7B9C91042D32F0009D447 /* WebGLBuffer.h in Headers */,
 30752 D0845CF020A11F590009BC6C /* WebGLCompressedTextureASTC.h in Headers */,
 30753 D0A20D572092A0A700E0C259 /* WebGLCompressedTextureASTC.h in Headers */,
3074230754 7E66E23416D6EB6C00F7E7FF /* WebGLCompressedTextureATC.h in Headers */,
3074330755 7E66E23417E6EB6C00F7E7FF /* WebGLCompressedTexturePVRTC.h in Headers */,
3074430756 6E3FAE8F14733FDB00E42306 /* WebGLCompressedTextureS3TC.h in Headers */,

3202632038 93F19B0708245E59001E9ABC /* WebCoreView.m in Sources */,
3202732039 D3F3D36D1A69B7DC0059FC2B /* WebGL2RenderingContext.cpp in Sources */,
3202832040 49C7B9C81042D32F0009D447 /* WebGLBuffer.cpp in Sources */,
 32041 D0845CEE20A11F4C0009BC6C /* WebGLCompressedTextureASTC.cpp in Sources */,
 32042 D0A20D582092A0A700E0C259 /* WebGLCompressedTextureASTC.cpp in Sources */,
3202932043 7E66E23316D6EB6C00F7E7FF /* WebGLCompressedTextureATC.cpp in Sources */,
3203032044 7E66E23317E6EB6C00F7E7FF /* WebGLCompressedTexturePVRTC.cpp in Sources */,
3203132045 6E3FAE8E14733FDB00E42306 /* WebGLCompressedTextureS3TC.cpp in Sources */,

Source/WebCore/bindings/js/JSDOMConvertWebGL.cpp

4343#include "JSOESTextureHalfFloatLinear.h"
4444#include "JSOESVertexArrayObject.h"
4545#include "JSWebGLBuffer.h"
 46#include "JSWebGLCompressedTextureASTC.h"
4647#include "JSWebGLCompressedTextureATC.h"
4748#include "JSWebGLCompressedTexturePVRTC.h"
4849#include "JSWebGLCompressedTextureS3TC.h"

@@JSValue convertToJSValue(ExecState& state, JSDOMGlobalObject& globalObject, WebG
179180 return toJS(&state, &globalObject, static_cast<WebGLCompressedTexturePVRTC&>(extension));
180181 case WebGLExtension::WebGLCompressedTextureS3TCName:
181182 return toJS(&state, &globalObject, static_cast<WebGLCompressedTextureS3TC&>(extension));
 183 case WebGLExtension::WebGLCompressedTextureASTCName:
 184 return toJS(&state, &globalObject, static_cast<WebGLCompressedTextureASTC&>(extension));
182185 case WebGLExtension::WebGLDepthTextureName:
183186 return toJS(&state, &globalObject, static_cast<WebGLDepthTexture&>(extension));
184187 case WebGLExtension::WebGLDrawBuffersName:

Source/WebCore/html/canvas/WebGL2RenderingContext.cpp

4242#include "OESTextureHalfFloatLinear.h"
4343#include "RenderBox.h"
4444#include "WebGLActiveInfo.h"
 45#include "WebGLCompressedTextureASTC.h"
4546#include "WebGLCompressedTextureATC.h"
4647#include "WebGLCompressedTexturePVRTC.h"
4748#include "WebGLCompressedTextureS3TC.h"

@@WebGLExtension* WebGL2RenderingContext::getExtension(const String& name)
11231124 ENABLE_IF_REQUESTED(WebGLCompressedTextureATC, m_webglCompressedTextureATC, "WEBKIT_WEBGL_compressed_texture_atc", WebGLCompressedTextureATC::supported(*this));
11241125 ENABLE_IF_REQUESTED(WebGLCompressedTexturePVRTC, m_webglCompressedTexturePVRTC, "WEBKIT_WEBGL_compressed_texture_pvrtc", WebGLCompressedTexturePVRTC::supported(*this));
11251126 ENABLE_IF_REQUESTED(WebGLCompressedTextureS3TC, m_webglCompressedTextureS3TC, "WEBGL_compressed_texture_s3tc", WebGLCompressedTextureS3TC::supported(*this));
 1127 ENABLE_IF_REQUESTED(WebGLCompressedTextureASTC, m_webglCompressedTextureASTC, "WEBGL_compressed_texture_astc", WebGLCompressedTextureASTC::supported(*this));
11261128 ENABLE_IF_REQUESTED(WebGLDepthTexture, m_webglDepthTexture, "WEBGL_depth_texture", WebGLDepthTexture::supported(*graphicsContext3D()));
11271129 ENABLE_IF_REQUESTED(WebGLDebugRendererInfo, m_webglDebugRendererInfo, "WEBGL_debug_renderer_info", true);
11281130 ENABLE_IF_REQUESTED(WebGLDebugShaders, m_webglDebugShaders, "WEBGL_debug_shaders", m_context->getExtensions().supports(ASCIILiteral { "GL_ANGLE_translated_shader_source" }));

@@std::optional<Vector<String>> WebGL2RenderingContext::getSupportedExtensions()
11561158 result.append(ASCIILiteral { "WEBKIT_WEBGL_compressed_texture_pvrtc" });
11571159 if (WebGLCompressedTextureS3TC::supported(*this))
11581160 result.append(ASCIILiteral { "WEBGL_compressed_texture_s3tc" });
 1161 if (WebGLCompressedTextureASTC::supported(*this))
 1162 result.append(ASCIILiteral { "WEBGL_compressed_texture_astc" });
11591163 if (WebGLDepthTexture::supported(*graphicsContext3D()))
11601164 result.append(ASCIILiteral { "WEBGL_depth_texture" });
11611165 result.append(ASCIILiteral { "WEBGL_lose_context" });

Source/WebCore/html/canvas/WebGLCompressedTextureASTC.cpp

 1/*
 2 * Copyright (C) 2018 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27#include "WebGLCompressedTextureASTC.h"
 28
 29#if ENABLE(WEBGL)
 30
 31#include "Extensions3D.h"
 32#include "RuntimeEnabledFeatures.h"
 33#include "WebGLRenderingContextBase.h"
 34
 35namespace WebCore {
 36
 37WebGLCompressedTextureASTC::WebGLCompressedTextureASTC(WebGLRenderingContextBase& context)
 38 : WebGLExtension(context)
 39 , m_isHDRSupported(context.graphicsContext3D()->getExtensions().supports(ASCIILiteral { "GL_KHR_texture_compression_astc_hdr" }))
 40 , m_isLDRSupported(context.graphicsContext3D()->getExtensions().supports(ASCIILiteral { "GL_KHR_texture_compression_astc_ldr" }))
 41{
 42 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_4x4_KHR);
 43 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_5x4_KHR);
 44 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_5x5_KHR);
 45 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_6x5_KHR);
 46 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_6x6_KHR);
 47 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_8x5_KHR);
 48 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_8x6_KHR);
 49 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_8x8_KHR);
 50 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_10x5_KHR);
 51 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_10x6_KHR);
 52 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_10x8_KHR);
 53 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_10x10_KHR);
 54 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_12x10_KHR);
 55 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_RGBA_ASTC_12x12_KHR);
 56
 57 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR);
 58 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR);
 59 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR);
 60 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR);
 61 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR);
 62 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR);
 63 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR);
 64 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR);
 65 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR);
 66 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR);
 67 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR);
 68 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR);
 69 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR);
 70 context.addCompressedTextureFormat(Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR);
 71}
 72
 73WebGLCompressedTextureASTC::~WebGLCompressedTextureASTC() = default;
 74
 75WebGLExtension::ExtensionName WebGLCompressedTextureASTC::getName() const
 76{
 77 return WebGLCompressedTextureASTCName;
 78}
 79
 80Vector<String> WebGLCompressedTextureASTC::getSupportedProfiles()
 81{
 82 Vector<String> result;
 83
 84 if (m_isHDRSupported)
 85 result.append(ASCIILiteral { "hdr" });
 86 if (m_isLDRSupported)
 87 result.append(ASCIILiteral { "ldr" });
 88
 89 return result;
 90}
 91
 92bool WebGLCompressedTextureASTC::supported(const WebGLRenderingContextBase& context)
 93{
 94 return RuntimeEnabledFeatures::sharedFeatures().webGLCompressedTextureASTCSupportEnabled()
 95 && (context.graphicsContext3D()->getExtensions().supports(ASCIILiteral { "GL_KHR_texture_compression_astc_hdr" })
 96 || context.graphicsContext3D()->getExtensions().supports(ASCIILiteral { "GL_KHR_texture_compression_astc_ldr" }));
 97}
 98
 99} // namespace WebCore
 100
 101#endif // ENABLE(WEBGL)

Source/WebCore/html/canvas/WebGLCompressedTextureASTC.h

 1/*
 2 * Copyright (C) 2018 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#pragma once
 27
 28#include "WebGLExtension.h"
 29
 30namespace WebCore {
 31
 32class WebGLCompressedTextureASTC final : public WebGLExtension {
 33public:
 34 explicit WebGLCompressedTextureASTC(WebGLRenderingContextBase&);
 35 virtual ~WebGLCompressedTextureASTC();
 36
 37 ExtensionName getName() const override;
 38 Vector<String> getSupportedProfiles();
 39
 40 static bool supported(const WebGLRenderingContextBase&);
 41private:
 42 bool m_isHDRSupported : 1;
 43 bool m_isLDRSupported : 1;
 44};
 45
 46} // namespace WebCore

Source/WebCore/html/canvas/WebGLCompressedTextureASTC.idl

 1/*
 2 * Copyright (C) 2018 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23 * THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26[
 27 Conditional=WEBGL,
 28 DoNotCheckConstants,
 29 GenerateIsReachable=ImplWebGLRenderingContext,
 30 NoInterfaceObject,
 31] interface WebGLCompressedTextureASTC {
 32 /* Compressed Texture Format */
 33 const GLenum COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0;
 34 const GLenum COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1;
 35 const GLenum COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2;
 36 const GLenum COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3;
 37 const GLenum COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4;
 38 const GLenum COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5;
 39 const GLenum COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6;
 40 const GLenum COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7;
 41 const GLenum COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8;
 42 const GLenum COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9;
 43 const GLenum COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA;
 44 const GLenum COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB;
 45 const GLenum COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC;
 46 const GLenum COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD;
 47
 48 const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0;
 49 const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1;
 50 const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2;
 51 const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3;
 52 const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4;
 53 const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5;
 54 const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6;
 55 const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7;
 56 const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8;
 57 const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9;
 58 const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA;
 59 const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB;
 60 const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC;
 61 const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD;
 62
 63 // Profile query support.
 64 sequence<DOMString> getSupportedProfiles();
 65};

Source/WebCore/html/canvas/WebGLExtension.h

@@public:
5454 OESElementIndexUintName,
5555 WebGLCompressedTextureATCName,
5656 WebGLCompressedTexturePVRTCName,
 57 WebGLCompressedTextureASTCName,
5758 ANGLEInstancedArraysName,
5859 };
5960

Source/WebCore/html/canvas/WebGLRenderingContext.cpp

4949#include "OESTextureHalfFloatLinear.h"
5050#include "OESVertexArrayObject.h"
5151#include "RenderBox.h"
 52#include "WebGLCompressedTextureASTC.h"
5253#include "WebGLCompressedTextureATC.h"
5354#include "WebGLCompressedTexturePVRTC.h"
5455#include "WebGLCompressedTextureS3TC.h"

@@WebGLExtension* WebGLRenderingContext::getExtension(const String& name)
147148 ENABLE_IF_REQUESTED(WebGLCompressedTextureATC, m_webglCompressedTextureATC, "WEBKIT_WEBGL_compressed_texture_atc", WebGLCompressedTextureATC::supported(*this));
148149 ENABLE_IF_REQUESTED(WebGLCompressedTexturePVRTC, m_webglCompressedTexturePVRTC, "WEBKIT_WEBGL_compressed_texture_pvrtc", WebGLCompressedTexturePVRTC::supported(*this));
149150 ENABLE_IF_REQUESTED(WebGLCompressedTextureS3TC, m_webglCompressedTextureS3TC, "WEBGL_compressed_texture_s3tc", WebGLCompressedTextureS3TC::supported(*this));
 151 ENABLE_IF_REQUESTED(WebGLCompressedTextureASTC, m_webglCompressedTextureASTC, "WEBGL_compressed_texture_astc", WebGLCompressedTextureASTC::supported(*this));
150152 ENABLE_IF_REQUESTED(WebGLDepthTexture, m_webglDepthTexture, "WEBGL_depth_texture", WebGLDepthTexture::supported(*m_context));
151153 if (equalIgnoringASCIICase(name, "WEBGL_draw_buffers")) {
152154 if (!m_webglDrawBuffers) {

@@std::optional<Vector<String>> WebGLRenderingContext::getSupportedExtensions()
217219 if (WebGLCompressedTexturePVRTC::supported(*this))
218220 result.append(ASCIILiteral { "WEBKIT_WEBGL_compressed_texture_pvrtc" });
219221 if (WebGLCompressedTextureS3TC::supported(*this))
220  result.append("WEBGL_compressed_texture_s3tc");
 222 result.append(ASCIILiteral { "WEBGL_compressed_texture_s3tc" });
 223 if (WebGLCompressedTextureASTC::supported(*this))
 224 result.append(ASCIILiteral { "WEBGL_compressed_texture_astc" });
221225 if (WebGLDepthTexture::supported(*m_context))
222226 result.append(ASCIILiteral { "WEBGL_depth_texture" });
223227 if (supportsDrawBuffers())

Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp

7171#include "WebGL2RenderingContext.h"
7272#include "WebGLActiveInfo.h"
7373#include "WebGLBuffer.h"
 74#include "WebGLCompressedTextureASTC.h"
7475#include "WebGLCompressedTextureATC.h"
7576#include "WebGLCompressedTexturePVRTC.h"
7677#include "WebGLCompressedTextureS3TC.h"

@@bool WebGLRenderingContextBase::validateCompressedTexFormat(GC3Denum format)
53645365 return m_compressedTextureFormats.contains(format);
53655366}
53665367
 5368struct BlockParameters {
 5369 const int width;
 5370 const int height;
 5371 const int size;
 5372};
 5373
 5374static inline unsigned calculateBytesForASTC(GC3Dsizei width, GC3Dsizei height, const BlockParameters& parameters)
 5375{
 5376 return ((width + parameters.width - 1) / parameters.width) * ((height + parameters.height - 1) / parameters.height) * parameters.size;
 5377}
 5378
53675379bool WebGLRenderingContextBase::validateCompressedTexFuncData(const char* functionName, GC3Dsizei width, GC3Dsizei height, GC3Denum format, ArrayBufferView& pixels)
53685380{
53695381 if (width < 0 || height < 0) {
53705382 synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "width or height < 0");
53715383 return false;
53725384 }
5373 
 5385
53745386 unsigned bytesRequired = 0;
 5387
 5388 // Block parameters for ASTC formats
 5389 const int kASTCBlockSize = 16;
 5390 static const BlockParameters ASTCParameters[] {
 5391 BlockParameters { 4, 4, kASTCBlockSize },
 5392 BlockParameters { 5, 4, kASTCBlockSize },
 5393 BlockParameters { 5, 5, kASTCBlockSize },
 5394 BlockParameters { 6, 5, kASTCBlockSize },
 5395 BlockParameters { 6, 6, kASTCBlockSize },
 5396 BlockParameters { 8, 5, kASTCBlockSize },
 5397 BlockParameters { 8, 6, kASTCBlockSize },
 5398 BlockParameters { 8, 8, kASTCBlockSize },
 5399 BlockParameters { 10, 5, kASTCBlockSize },
 5400 BlockParameters { 10, 6, kASTCBlockSize },
 5401 BlockParameters { 10, 8, kASTCBlockSize },
 5402 BlockParameters { 10, 10, kASTCBlockSize },
 5403 BlockParameters { 12, 10, kASTCBlockSize },
 5404 BlockParameters { 12, 12, kASTCBlockSize }
 5405 };
 5406 const GC3Denum ASTCEnumStartRGBA = Extensions3D::COMPRESSED_RGBA_ASTC_4x4_KHR;
 5407 const GC3Denum ASTCEnumStartSRGB8 = Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;
53755408
53765409 switch (format) {
53775410 case Extensions3D::COMPRESSED_RGB_S3TC_DXT1_EXT:

@@bool WebGLRenderingContextBase::validateCompressedTexFuncData(const char* functi
54175450 bytesRequired = (std::max(width, kBlockWidth) * std::max(height, kBlockHeight) * 2 + 7) / kBlockSize;
54185451 }
54195452 break;
 5453 case Extensions3D::COMPRESSED_RGBA_ASTC_4x4_KHR:
 5454 case Extensions3D::COMPRESSED_RGBA_ASTC_5x4_KHR:
 5455 case Extensions3D::COMPRESSED_RGBA_ASTC_5x5_KHR:
 5456 case Extensions3D::COMPRESSED_RGBA_ASTC_6x5_KHR:
 5457 case Extensions3D::COMPRESSED_RGBA_ASTC_6x6_KHR:
 5458 case Extensions3D::COMPRESSED_RGBA_ASTC_8x5_KHR:
 5459 case Extensions3D::COMPRESSED_RGBA_ASTC_8x6_KHR:
 5460 case Extensions3D::COMPRESSED_RGBA_ASTC_8x8_KHR:
 5461 case Extensions3D::COMPRESSED_RGBA_ASTC_10x5_KHR:
 5462 case Extensions3D::COMPRESSED_RGBA_ASTC_10x6_KHR:
 5463 case Extensions3D::COMPRESSED_RGBA_ASTC_10x8_KHR:
 5464 case Extensions3D::COMPRESSED_RGBA_ASTC_10x10_KHR:
 5465 case Extensions3D::COMPRESSED_RGBA_ASTC_12x10_KHR:
 5466 case Extensions3D::COMPRESSED_RGBA_ASTC_12x12_KHR:
 5467 bytesRequired = calculateBytesForASTC(width, height, ASTCParameters[format - ASTCEnumStartRGBA]);
 5468 break;
 5469 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:
 5470 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:
 5471 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:
 5472 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:
 5473 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:
 5474 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:
 5475 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:
 5476 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:
 5477 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:
 5478 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:
 5479 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:
 5480 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:
 5481 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
 5482 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
 5483 bytesRequired = calculateBytesForASTC(width, height, ASTCParameters[format - ASTCEnumStartSRGB8]);
 5484 break;
54205485 default:
54215486 synthesizeGLError(GraphicsContext3D::INVALID_ENUM, functionName, "invalid format");
54225487 return false;

@@bool WebGLRenderingContextBase::validateCompressedTexDimensions(const char* func
54595524 return false;
54605525 }
54615526 return true;
 5527 case Extensions3D::COMPRESSED_RGBA_ASTC_4x4_KHR:
 5528 case Extensions3D::COMPRESSED_RGBA_ASTC_5x4_KHR:
 5529 case Extensions3D::COMPRESSED_RGBA_ASTC_5x5_KHR:
 5530 case Extensions3D::COMPRESSED_RGBA_ASTC_6x5_KHR:
 5531 case Extensions3D::COMPRESSED_RGBA_ASTC_6x6_KHR:
 5532 case Extensions3D::COMPRESSED_RGBA_ASTC_8x5_KHR:
 5533 case Extensions3D::COMPRESSED_RGBA_ASTC_8x6_KHR:
 5534 case Extensions3D::COMPRESSED_RGBA_ASTC_8x8_KHR:
 5535 case Extensions3D::COMPRESSED_RGBA_ASTC_10x5_KHR:
 5536 case Extensions3D::COMPRESSED_RGBA_ASTC_10x6_KHR:
 5537 case Extensions3D::COMPRESSED_RGBA_ASTC_10x8_KHR:
 5538 case Extensions3D::COMPRESSED_RGBA_ASTC_10x10_KHR:
 5539 case Extensions3D::COMPRESSED_RGBA_ASTC_12x10_KHR:
 5540 case Extensions3D::COMPRESSED_RGBA_ASTC_12x12_KHR:
 5541 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:
 5542 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:
 5543 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:
 5544 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:
 5545 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:
 5546 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:
 5547 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:
 5548 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:
 5549 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:
 5550 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:
 5551 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:
 5552 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:
 5553 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
 5554 case Extensions3D::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
 5555 // No height and width restrictions on ASTC.
 5556 return true;
54625557 default:
54635558 return false;
54645559 }

Source/WebCore/html/canvas/WebGLRenderingContextBase.h

@@class OffscreenCanvas;
7171class WebGLActiveInfo;
7272class WebGLContextGroup;
7373class WebGLContextObject;
 74class WebGLCompressedTextureASTC;
7475class WebGLCompressedTextureATC;
7576class WebGLCompressedTexturePVRTC;
7677class WebGLCompressedTextureS3TC;

@@protected:
366367 friend class WebGLObject;
367368 friend class OESVertexArrayObject;
368369 friend class WebGLDebugShaders;
 370 friend class WebGLCompressedTextureASTC;
369371 friend class WebGLCompressedTextureATC;
370372 friend class WebGLCompressedTexturePVRTC;
371373 friend class WebGLCompressedTextureS3TC;

@@protected:
591593 std::unique_ptr<WebGLLoseContext> m_webglLoseContext;
592594 std::unique_ptr<WebGLDebugRendererInfo> m_webglDebugRendererInfo;
593595 std::unique_ptr<WebGLDebugShaders> m_webglDebugShaders;
 596 std::unique_ptr<WebGLCompressedTextureASTC> m_webglCompressedTextureASTC;
594597 std::unique_ptr<WebGLCompressedTextureATC> m_webglCompressedTextureATC;
595598 std::unique_ptr<WebGLCompressedTexturePVRTC> m_webglCompressedTexturePVRTC;
596599 std::unique_ptr<WebGLCompressedTextureS3TC> m_webglCompressedTextureS3TC;

Source/WebCore/platform/graphics/Extensions3D.h

@@public:
7070 // GL_EXT_texture_compression_s3tc
7171 // GL_OES_compressed_ETC1_RGB8_texture
7272 // GL_IMG_texture_compression_pvrtc
 73 // GL_KHR_texture_compression_astc_hdr
 74 // GL_KHR_texture_compression_astc_ldr
7375 // EXT_texture_filter_anisotropic
7476 // GL_EXT_debug_marker
7577 // GL_ARB_draw_buffers / GL_EXT_draw_buffers

@@public:
165167 COMPRESSED_ATC_RGB_AMD = 0x8C92,
166168 COMPRESSED_ATC_RGBA_EXPLICIT_ALPHA_AMD = 0x8C93,
167169 COMPRESSED_ATC_RGBA_INTERPOLATED_ALPHA_AMD = 0x87EE,
 170
 171 // GL_KHR_texture_compression_astc_hdr
 172 COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0,
 173 COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1,
 174 COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2,
 175 COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3,
 176 COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4,
 177 COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5,
 178 COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6,
 179 COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7,
 180 COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8,
 181 COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9,
 182 COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA,
 183 COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB,
 184 COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC,
 185 COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD,
 186
 187 COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0,
 188 COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1,
 189 COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2,
 190 COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3,
 191 COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4,
 192 COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5,
 193 COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6,
 194 COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7,
 195 COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8,
 196 COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9,
 197 COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA,
 198 COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB,
 199 COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC,
 200 COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD,
168201
169202 // GL_EXT_texture_filter_anisotropic
170203 TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE,

LayoutTests/ChangeLog

 12018-05-03 Justin Fan <justin_fan@apple.com>
 2
 3 Also added in Khronos' ASTC test from version 1.0.4 beta of their conformance test suite,
 4 although again, this requires OpenGL ES 3 context for WebKit to detect proper support.
 5 https://bugs.webkit.org/show_bug.cgi?id=185272
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 * fast/canvas/webgl/resources/js-test-post.js: Added.
 10 * fast/canvas/webgl/resources/js-test-pre.js: Added.
 11 * fast/canvas/webgl/resources/js-test-style.css: Added.
 12 * fast/canvas/webgl/resources/webgl-test-utils-khr.js: Added.
 13 * fast/canvas/webgl/webgl-compressed-texture-astc-expected.txt: Added.
 14 * fast/canvas/webgl/webgl-compressed-texture-astc.html: Added.
 15
1162018-05-08 Daniel Bates <dabates@apple.com>
217
318 Resign Strong Password appearance when text field value changes

LayoutTests/fast/canvas/webgl/resources/js-test-post.js

 1/*
 2** Copyright (c) 2012 The Khronos Group Inc.
 3**
 4** Permission is hereby granted, free of charge, to any person obtaining a
 5** copy of this software and/or associated documentation files (the
 6** "Materials"), to deal in the Materials without restriction, including
 7** without limitation the rights to use, copy, modify, merge, publish,
 8** distribute, sublicense, and/or sell copies of the Materials, and to
 9** permit persons to whom the Materials are furnished to do so, subject to
 10** the following conditions:
 11**
 12** The above copyright notice and this permission notice shall be included
 13** in all copies or substantial portions of the Materials.
 14**
 15** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 16** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 17** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 18** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 19** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 20** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 21** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
 22*/
 23
 24shouldBeTrue("successfullyParsed");
 25_addSpan('<br /><span class="pass">TEST COMPLETE</span>');
 26if (_jsTestPreVerboseLogging) {
 27 _bufferedLogToConsole('TEST COMPLETE');
 28}
 29notifyFinishedToHarness()

LayoutTests/fast/canvas/webgl/resources/js-test-pre.js

 1/*
 2** Copyright (c) 2012 The Khronos Group Inc.
 3**
 4** Permission is hereby granted, free of charge, to any person obtaining a
 5** copy of this software and/or associated documentation files (the
 6** "Materials"), to deal in the Materials without restriction, including
 7** without limitation the rights to use, copy, modify, merge, publish,
 8** distribute, sublicense, and/or sell copies of the Materials, and to
 9** permit persons to whom the Materials are furnished to do so, subject to
 10** the following conditions:
 11**
 12** The above copyright notice and this permission notice shall be included
 13** in all copies or substantial portions of the Materials.
 14**
 15** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 16** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 17** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 18** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 19** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 20** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 21** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
 22*/
 23
 24(function() {
 25 var testHarnessInitialized = false;
 26
 27 var initNonKhronosFramework = function() {
 28 if (testHarnessInitialized) {
 29 return;
 30 }
 31 testHarnessInitialized = true;
 32
 33 /* -- plaform specific code -- */
 34
 35 // WebKit Specific code. Add your code here.
 36 if (window.testRunner && !window.layoutTestController) {
 37 window.layoutTestController = window.testRunner;
 38 }
 39
 40 if (window.layoutTestController) {
 41 window.layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
 42 window.layoutTestController.dumpAsText();
 43 window.layoutTestController.waitUntilDone();
 44 }
 45 if (window.internals) {
 46 // The WebKit testing system compares console output.
 47 // Because the output of the WebGL Tests is GPU dependent
 48 // we turn off console messages.
 49 window.console.log = function() { };
 50 window.console.error = function() { };
 51 window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
 52
 53 // RAF doesn't work in LayoutTests. Disable it so the tests will
 54 // use setTimeout instead.
 55 window.requestAnimationFrame = undefined;
 56 window.webkitRequestAnimationFrame = undefined;
 57 }
 58
 59 /* -- end platform specific code --*/
 60 }
 61
 62 this.initTestingHarness = function() {
 63 initNonKhronosFramework();
 64 }
 65}());
 66
 67var getUrlOptions = (function() {
 68 var _urlOptionsParsed = false;
 69 var _urlOptions = {};
 70 return function() {
 71 if (!_urlOptionsParsed) {
 72 var s = window.location.href;
 73 var q = s.indexOf("?");
 74 var e = s.indexOf("#");
 75 if (e < 0) {
 76 e = s.length;
 77 }
 78 var query = s.substring(q + 1, e);
 79 var pairs = query.split("&");
 80 for (var ii = 0; ii < pairs.length; ++ii) {
 81 var keyValue = pairs[ii].split("=");
 82 var key = keyValue[0];
 83 var value = decodeURIComponent(keyValue[1]);
 84 _urlOptions[key] = value;
 85 }
 86 _urlOptionsParsed = true;
 87 }
 88
 89 return _urlOptions;
 90 }
 91})();
 92
 93if (typeof quietMode == 'undefined') {
 94 var quietMode = (function() {
 95 var _quietModeChecked = false;
 96 var _isQuiet = false;
 97 return function() {
 98 if (!_quietModeChecked) {
 99 _isQuiet = (getUrlOptions().quiet == 1);
 100 _quietModeChecked = true;
 101 }
 102 return _isQuiet;
 103 }
 104 })();
 105}
 106
 107function nonKhronosFrameworkNotifyDone() {
 108 // WebKit Specific code. Add your code here.
 109 if (window.layoutTestController) {
 110 window.layoutTestController.notifyDone();
 111 }
 112}
 113
 114function reportTestResultsToHarness(success, msg) {
 115 if (window.parent.webglTestHarness) {
 116 window.parent.webglTestHarness.reportResults(window.location.pathname, success, msg);
 117 }
 118}
 119
 120function reportSkippedTestResultsToHarness(success, msg) {
 121 if (window.parent.webglTestHarness) {
 122 window.parent.webglTestHarness.reportResults(window.location.pathname, success, msg, true);
 123 }
 124}
 125
 126function notifyFinishedToHarness() {
 127 if (window.parent.webglTestHarness) {
 128 window.parent.webglTestHarness.notifyFinished(window.location.pathname);
 129 }
 130 if (window.nonKhronosFrameworkNotifyDone) {
 131 window.nonKhronosFrameworkNotifyDone();
 132 }
 133}
 134
 135var _bufferedConsoleLogs = [];
 136
 137function _bufferedLogToConsole(msg)
 138{
 139 if (_bufferedConsoleLogs) {
 140 _bufferedConsoleLogs.push(msg);
 141 } else if (window.console) {
 142 window.console.log(msg);
 143 }
 144}
 145
 146// Public entry point exposed to many other files.
 147function bufferedLogToConsole(msg)
 148{
 149 _bufferedLogToConsole(msg);
 150}
 151
 152// Called implicitly by testFailed().
 153function _flushBufferedLogsToConsole()
 154{
 155 if (_bufferedConsoleLogs) {
 156 if (window.console) {
 157 for (var ii = 0; ii < _bufferedConsoleLogs.length; ++ii) {
 158 window.console.log(_bufferedConsoleLogs[ii]);
 159 }
 160 }
 161 _bufferedConsoleLogs = null;
 162 }
 163}
 164
 165var _jsTestPreVerboseLogging = false;
 166
 167function enableJSTestPreVerboseLogging()
 168{
 169 _jsTestPreVerboseLogging = true;
 170}
 171
 172function description(msg)
 173{
 174 initTestingHarness();
 175 if (msg === undefined) {
 176 msg = document.title;
 177 }
 178 // For MSIE 6 compatibility
 179 var span = document.createElement("span");
 180 span.innerHTML = '<p>' + msg + '</p><p>On success, you will see a series of "<span class="pass">PASS</span>" messages, followed by "<span class="pass">TEST COMPLETE</span>".</p>';
 181 var description = document.getElementById("description");
 182 if (description.firstChild)
 183 description.replaceChild(span, description.firstChild);
 184 else
 185 description.appendChild(span);
 186 if (_jsTestPreVerboseLogging) {
 187 _bufferedLogToConsole(msg);
 188 }
 189}
 190
 191function _addSpan(contents)
 192{
 193 var span = document.createElement("span");
 194 document.getElementById("console").appendChild(span); // insert it first so XHTML knows the namespace
 195 span.innerHTML = contents + '<br />';
 196}
 197
 198function debug(msg)
 199{
 200 if (!quietMode())
 201 _addSpan(msg);
 202 if (_jsTestPreVerboseLogging) {
 203 _bufferedLogToConsole(msg);
 204 }
 205}
 206
 207function escapeHTML(text)
 208{
 209 return text.replace(/&/g, "&amp;").replace(/</g, "&lt;");
 210}
 211/**
 212 * Defines the exception type for a test failure.
 213 * @constructor
 214 * @param {string} message The error message.
 215 */
 216var TestFailedException = function (message) {
 217 this.message = message;
 218 this.name = "TestFailedException";
 219};
 220
 221/**
 222 * @param {string=} msg
 223 */
 224function testPassed(msg) {
 225 msg = msg || 'Passed';
 226 if (_currentTestName)
 227 msg = _currentTestName + ': ' + msg;
 228
 229 reportTestResultsToHarness(true, msg);
 230
 231 if (!quietMode())
 232 _addSpan('<span><span class="pass">PASS</span> ' + escapeHTML(msg) + '</span>');
 233 if (_jsTestPreVerboseLogging) {
 234 _bufferedLogToConsole('PASS ' + msg);
 235 }
 236}
 237
 238/**
 239 * @param {string=} msg
 240 */
 241function testFailed(msg) {
 242 msg = msg || 'Failed';
 243 if (_currentTestName)
 244 msg = _currentTestName + ': ' + msg;
 245
 246 reportTestResultsToHarness(false, msg);
 247 _addSpan('<span><span class="fail">FAIL</span> ' + escapeHTML(msg) + '</span>');
 248 _bufferedLogToConsole('FAIL ' + msg);
 249 _flushBufferedLogsToConsole();
 250}
 251
 252var _currentTestName;
 253
 254/**
 255 * Sets the current test name for usage within testPassedOptions/testFailedOptions.
 256 * @param {string=} name The name to set as the current test name.
 257 */
 258function setCurrentTestName(name)
 259{
 260 _currentTestName = name;
 261}
 262
 263/**
 264 * Gets the current test name in use within testPassedOptions/testFailedOptions.
 265 * @return {string} The name of the current test.
 266 */
 267function getCurrentTestName()
 268{
 269 return _currentTestName;
 270}
 271
 272/**
 273 * Variation of the testPassed function, with the option to not show (and thus not count) the test's pass result.
 274 * @param {string} msg The message to be shown in the pass result.
 275 * @param {boolean} addSpan Indicates whether the message will be visible (thus counted in the results) or not.
 276 */
 277function testPassedOptions(msg, addSpan)
 278{
 279 if (addSpan && !quietMode())
 280 {
 281 reportTestResultsToHarness(true, _currentTestName + ": " + msg);
 282 _addSpan('<span><span class="pass">PASS</span> ' + escapeHTML(_currentTestName) + ": " + escapeHTML(msg) + '</span>');
 283 }
 284 if (_jsTestPreVerboseLogging) {
 285 _bufferedLogToConsole('PASS ' + msg);
 286 }
 287}
 288
 289/**
 290 * Report skipped tests.
 291 * @param {string} msg The message to be shown in the skip result.
 292 * @param {boolean} addSpan Indicates whether the message will be visible (thus counted in the results) or not.
 293 */
 294function testSkippedOptions(msg, addSpan)
 295{
 296 if (addSpan && !quietMode())
 297 {
 298 reportSkippedTestResultsToHarness(true, _currentTestName + ": " + msg);
 299 _addSpan('<span><span class="warn">SKIP</span> ' + escapeHTML(_currentTestName) + ": " + escapeHTML(msg) + '</span>');
 300 }
 301 if (_jsTestPreVerboseLogging) {
 302 _bufferedLogToConsole('SKIP' + msg);
 303 }
 304}
 305
 306/**
 307 * Variation of the testFailed function, with the option to throw an exception or not.
 308 * @param {string} msg The message to be shown in the fail result.
 309 * @param {boolean} exthrow Indicates whether the function will throw a TestFailedException or not.
 310 */
 311function testFailedOptions(msg, exthrow)
 312{
 313 reportTestResultsToHarness(false, _currentTestName + ": " + msg);
 314 _addSpan('<span><span class="fail">FAIL</span> ' + escapeHTML(_currentTestName) + ": " + escapeHTML(msg) + '</span>');
 315 _bufferedLogToConsole('FAIL ' + msg);
 316 _flushBufferedLogsToConsole();
 317 if (exthrow) {
 318 _currentTestName = ""; //Remembering to set the name of current testcase to empty string.
 319 throw new TestFailedException(msg);
 320 }
 321}
 322
 323function areArraysEqual(_a, _b)
 324{
 325 try {
 326 if (_a.length !== _b.length)
 327 return false;
 328 for (var i = 0; i < _a.length; i++)
 329 if (_a[i] !== _b[i])
 330 return false;
 331 } catch (ex) {
 332 return false;
 333 }
 334 return true;
 335}
 336
 337function isMinusZero(n)
 338{
 339 // the only way to tell 0 from -0 in JS is the fact that 1/-0 is
 340 // -Infinity instead of Infinity
 341 return n === 0 && 1/n < 0;
 342}
 343
 344function isResultCorrect(_actual, _expected)
 345{
 346 if (_expected === 0)
 347 return _actual === _expected && (1/_actual) === (1/_expected);
 348 if (_actual === _expected)
 349 return true;
 350 if (typeof(_expected) == "number" && isNaN(_expected))
 351 return typeof(_actual) == "number" && isNaN(_actual);
 352 if (Object.prototype.toString.call(_expected) == Object.prototype.toString.call([]))
 353 return areArraysEqual(_actual, _expected);
 354 return false;
 355}
 356
 357function stringify(v)
 358{
 359 if (v === 0 && 1/v < 0)
 360 return "-0";
 361 else return "" + v;
 362}
 363
 364function evalAndLog(_a)
 365{
 366 if (typeof _a != "string")
 367 debug("WARN: tryAndLog() expects a string argument");
 368
 369 // Log first in case things go horribly wrong or this causes a sync event.
 370 debug(_a);
 371
 372 var _av;
 373 try {
 374 _av = eval(_a);
 375 } catch (e) {
 376 testFailed(_a + " threw exception " + e);
 377 }
 378 return _av;
 379}
 380
 381function shouldBe(_a, _b, quiet)
 382{
 383 if (typeof _a != "string" || typeof _b != "string")
 384 debug("WARN: shouldBe() expects string arguments");
 385 var exception;
 386 var _av;
 387 try {
 388 _av = eval(_a);
 389 } catch (e) {
 390 exception = e;
 391 }
 392 var _bv = eval(_b);
 393
 394 if (exception)
 395 testFailed(_a + " should be " + _bv + ". Threw exception " + exception);
 396 else if (isResultCorrect(_av, _bv)) {
 397 if (!quiet) {
 398 testPassed(_a + " is " + _b);
 399 }
 400 } else if (typeof(_av) == typeof(_bv))
 401 testFailed(_a + " should be " + _bv + ". Was " + stringify(_av) + ".");
 402 else
 403 testFailed(_a + " should be " + _bv + " (of type " + typeof _bv + "). Was " + _av + " (of type " + typeof _av + ").");
 404}
 405
 406function shouldNotBe(_a, _b, quiet)
 407{
 408 if (typeof _a != "string" || typeof _b != "string")
 409 debug("WARN: shouldNotBe() expects string arguments");
 410 var exception;
 411 var _av;
 412 try {
 413 _av = eval(_a);
 414 } catch (e) {
 415 exception = e;
 416 }
 417 var _bv = eval(_b);
 418
 419 if (exception)
 420 testFailed(_a + " should not be " + _bv + ". Threw exception " + exception);
 421 else if (!isResultCorrect(_av, _bv)) {
 422 if (!quiet) {
 423 testPassed(_a + " is not " + _b);
 424 }
 425 } else
 426 testFailed(_a + " should not be " + _bv + ".");
 427}
 428
 429function shouldBeTrue(_a) { shouldBe(_a, "true"); }
 430function shouldBeFalse(_a) { shouldBe(_a, "false"); }
 431function shouldBeNaN(_a) { shouldBe(_a, "NaN"); }
 432function shouldBeNull(_a) { shouldBe(_a, "null"); }
 433
 434function shouldBeEqualToString(a, b)
 435{
 436 var unevaledString = '"' + b.replace(/"/g, "\"") + '"';
 437 shouldBe(a, unevaledString);
 438}
 439
 440function shouldEvaluateTo(actual, expected) {
 441 // A general-purpose comparator. 'actual' should be a string to be
 442 // evaluated, as for shouldBe(). 'expected' may be any type and will be
 443 // used without being eval'ed.
 444 if (expected == null) {
 445 // Do this before the object test, since null is of type 'object'.
 446 shouldBeNull(actual);
 447 } else if (typeof expected == "undefined") {
 448 shouldBeUndefined(actual);
 449 } else if (typeof expected == "function") {
 450 // All this fuss is to avoid the string-arg warning from shouldBe().
 451 try {
 452 var actualValue = eval(actual);
 453 } catch (e) {
 454 testFailed("Evaluating " + actual + ": Threw exception " + e);
 455 return;
 456 }
 457 shouldBe("'" + actualValue.toString().replace(/\n/g, "") + "'",
 458 "'" + expected.toString().replace(/\n/g, "") + "'");
 459 } else if (typeof expected == "object") {
 460 shouldBeTrue(actual + " == '" + expected + "'");
 461 } else if (typeof expected == "string") {
 462 shouldBe(actual, expected);
 463 } else if (typeof expected == "boolean") {
 464 shouldBe("typeof " + actual, "'boolean'");
 465 if (expected)
 466 shouldBeTrue(actual);
 467 else
 468 shouldBeFalse(actual);
 469 } else if (typeof expected == "number") {
 470 shouldBe(actual, stringify(expected));
 471 } else {
 472 debug(expected + " is unknown type " + typeof expected);
 473 shouldBeTrue(actual, "'" +expected.toString() + "'");
 474 }
 475}
 476
 477function shouldBeNonZero(_a)
 478{
 479 var exception;
 480 var _av;
 481 try {
 482 _av = eval(_a);
 483 } catch (e) {
 484 exception = e;
 485 }
 486
 487 if (exception)
 488 testFailed(_a + " should be non-zero. Threw exception " + exception);
 489 else if (_av != 0)
 490 testPassed(_a + " is non-zero.");
 491 else
 492 testFailed(_a + " should be non-zero. Was " + _av);
 493}
 494
 495function shouldBeNonNull(_a)
 496{
 497 var exception;
 498 var _av;
 499 try {
 500 _av = eval(_a);
 501 } catch (e) {
 502 exception = e;
 503 }
 504
 505 if (exception)
 506 testFailed(_a + " should be non-null. Threw exception " + exception);
 507 else if (_av != null)
 508 testPassed(_a + " is non-null.");
 509 else
 510 testFailed(_a + " should be non-null. Was " + _av);
 511}
 512
 513function shouldBeUndefined(_a)
 514{
 515 var exception;
 516 var _av;
 517 try {
 518 _av = eval(_a);
 519 } catch (e) {
 520 exception = e;
 521 }
 522
 523 if (exception)
 524 testFailed(_a + " should be undefined. Threw exception " + exception);
 525 else if (typeof _av == "undefined")
 526 testPassed(_a + " is undefined.");
 527 else
 528 testFailed(_a + " should be undefined. Was " + _av);
 529}
 530
 531function shouldBeDefined(_a)
 532{
 533 var exception;
 534 var _av;
 535 try {
 536 _av = eval(_a);
 537 } catch (e) {
 538 exception = e;
 539 }
 540
 541 if (exception)
 542 testFailed(_a + " should be defined. Threw exception " + exception);
 543 else if (_av !== undefined)
 544 testPassed(_a + " is defined.");
 545 else
 546 testFailed(_a + " should be defined. Was " + _av);
 547}
 548
 549function shouldBeLessThanOrEqual(_a, _b) {
 550 if (typeof _a != "string" || typeof _b != "string")
 551 debug("WARN: shouldBeLessThanOrEqual expects string arguments");
 552
 553 var exception;
 554 var _av;
 555 try {
 556 _av = eval(_a);
 557 } catch (e) {
 558 exception = e;
 559 }
 560 var _bv = eval(_b);
 561
 562 if (exception)
 563 testFailed(_a + " should be <= " + _b + ". Threw exception " + exception);
 564 else if (typeof _av == "undefined" || _av > _bv)
 565 testFailed(_a + " should be >= " + _b + ". Was " + _av + " (of type " + typeof _av + ").");
 566 else
 567 testPassed(_a + " is <= " + _b);
 568}
 569
 570function shouldBeGreaterThanOrEqual(_a, _b) {
 571 if (typeof _a != "string" || typeof _b != "string")
 572 debug("WARN: shouldBeGreaterThanOrEqual expects string arguments");
 573
 574 var exception;
 575 var _av;
 576 try {
 577 _av = eval(_a);
 578 } catch (e) {
 579 exception = e;
 580 }
 581 var _bv = eval(_b);
 582
 583 if (exception)
 584 testFailed(_a + " should be >= " + _b + ". Threw exception " + exception);
 585 else if (typeof _av == "undefined" || _av < _bv)
 586 testFailed(_a + " should be >= " + _b + ". Was " + _av + " (of type " + typeof _av + ").");
 587 else
 588 testPassed(_a + " is >= " + _b);
 589}
 590
 591function expectTrue(v, msg) {
 592 if (v) {
 593 testPassed(msg);
 594 } else {
 595 testFailed(msg);
 596 }
 597}
 598
 599function shouldThrow(_a, _e)
 600{
 601 var exception;
 602 var _av;
 603 try {
 604 _av = eval(_a);
 605 } catch (e) {
 606 exception = e;
 607 }
 608
 609 var _ev;
 610 if (_e)
 611 _ev = eval(_e);
 612
 613 if (exception) {
 614 if (typeof _e == "undefined" || exception == _ev)
 615 testPassed(_a + " threw exception " + exception + ".");
 616 else
 617 testFailed(_a + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Threw exception " + exception + ".");
 618 } else if (typeof _av == "undefined")
 619 testFailed(_a + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Was undefined.");
 620 else
 621 testFailed(_a + " should throw " + (typeof _e == "undefined" ? "an exception" : _ev) + ". Was " + _av + ".");
 622}
 623
 624function shouldBeType(_a, _type) {
 625 var exception;
 626 var _av;
 627 try {
 628 _av = eval(_a);
 629 } catch (e) {
 630 exception = e;
 631 }
 632
 633 var _typev = eval(_type);
 634
 635 if(_typev === Number){
 636 if(_av instanceof Number){
 637 testPassed(_a + " is an instance of Number");
 638 }
 639 else if(typeof(_av) === 'number'){
 640 testPassed(_a + " is an instance of Number");
 641 }
 642 else{
 643 testFailed(_a + " is not an instance of Number");
 644 }
 645 }
 646 else if (_av instanceof _typev) {
 647 testPassed(_a + " is an instance of " + _type);
 648 } else {
 649 testFailed(_a + " is not an instance of " + _type);
 650 }
 651}
 652
 653/**
 654 * Shows a message in case expression test fails.
 655 * @param {boolean} exp
 656 * @param {straing} message
 657 */
 658function checkMessage(exp, message) {
 659 if ( !exp )
 660 _addSpan('<span><span class="warn">WARNING</span> ' + escapeHTML(_currentTestName) + ": " + escapeHTML(message) + '</span>');
 661}
 662
 663function assertMsg(assertion, msg) {
 664 if (assertion) {
 665 testPassed(msg);
 666 } else {
 667 testFailed(msg);
 668 }
 669}
 670
 671/**
 672 * Variation of the assertMsg function, with the option to not show (and thus not count) the test's pass result,
 673 * and throw or not a TestFailedException in case of failure.
 674 * @param {boolean} assertion If this is true, means success, else failure.
 675 * @param {?string} msg The message to be shown in the result.
 676 * @param {boolean} verbose In case of success, determines if the test will show it's result and count in the results.
 677 * @param {boolean} exthrow In case of failure, determines if the function will throw a TestFailedException.
 678 */
 679function assertMsgOptions(assertion, msg, verbose, exthrow) {
 680 if (assertion) {
 681 testPassedOptions(msg, verbose);
 682 } else {
 683 testFailedOptions(msg, exthrow);
 684 }
 685}
 686
 687
 688function webglHarnessCollectGarbage() {
 689 if (window.GCController) {
 690 window.GCController.collect();
 691 return;
 692 }
 693
 694 if (window.opera && window.opera.collect) {
 695 window.opera.collect();
 696 return;
 697 }
 698
 699 try {
 700 window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
 701 .getInterface(Components.interfaces.nsIDOMWindowUtils)
 702 .garbageCollect();
 703 return;
 704 } catch(e) {}
 705
 706 if (window.gc) {
 707 window.gc();
 708 return;
 709 }
 710
 711 if (window.CollectGarbage) {
 712 CollectGarbage();
 713 return;
 714 }
 715
 716 function gcRec(n) {
 717 if (n < 1)
 718 return {};
 719 var temp = {i: "ab" + i + (i / 100000)};
 720 temp += "foo";
 721 gcRec(n-1);
 722 }
 723 for (var i = 0; i < 1000; i++)
 724 gcRec(10);
 725}
 726
 727function finishTest() {
 728 successfullyParsed = true;
 729 var epilogue = document.createElement("script");
 730 var basePath = "";
 731 var expectedBase = "js-test-pre.js";
 732 var scripts = document.getElementsByTagName('script');
 733 for (var script, i = 0; script = scripts[i]; i++) {
 734 var src = script.src;
 735 var l = src.length;
 736 if (src.substr(l - expectedBase.length) == expectedBase) {
 737 basePath = src.substr(0, l - expectedBase.length);
 738 break;
 739 }
 740 }
 741 epilogue.src = basePath + "js-test-post.js";
 742 document.body.appendChild(epilogue);
 743}
 744

LayoutTests/fast/canvas/webgl/resources/js-test-style.css

 1.pass {
 2 font-weight: bold;
 3 color: green;
 4}
 5.fail {
 6 font-weight: bold;
 7 color: red;
 8}
 9.warn {
 10 font-weight: bold;
 11 color: yellow;
 12 text-shadow: 1px 1px #ff0000
 13}
 14#console {
 15 white-space: pre-wrap;
 16 font-family: monospace;
 17}

LayoutTests/fast/canvas/webgl/resources/webgl-test-utils-khr.js

 1/*
 2** Copyright (c) 2012 The Khronos Group Inc.
 3**
 4** Permission is hereby granted, free of charge, to any person obtaining a
 5** copy of this software and/or associated documentation files (the
 6** "Materials"), to deal in the Materials without restriction, including
 7** without limitation the rights to use, copy, modify, merge, publish,
 8** distribute, sublicense, and/or sell copies of the Materials, and to
 9** permit persons to whom the Materials are furnished to do so, subject to
 10** the following conditions:
 11**
 12** The above copyright notice and this permission notice shall be included
 13** in all copies or substantial portions of the Materials.
 14**
 15** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 16** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 17** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 18** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 19** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 20** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 21** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
 22*/
 23var WebGLTestUtils = (function() {
 24"use strict";
 25
 26/**
 27 * Wrapped logging function.
 28 * @param {string} msg The message to log.
 29 */
 30var log = function(msg) {
 31 bufferedLogToConsole(msg);
 32};
 33
 34/**
 35 * Wrapped logging function.
 36 * @param {string} msg The message to log.
 37 */
 38var error = function(msg) {
 39 // For the time being, diverting this to window.console.log rather
 40 // than window.console.error. If anyone cares enough they can
 41 // generalize the mechanism in js-test-pre.js.
 42 log(msg);
 43};
 44
 45/**
 46 * Turn off all logging.
 47 */
 48var loggingOff = function() {
 49 log = function() {};
 50 error = function() {};
 51};
 52
 53/**
 54 * Converts a WebGL enum to a string.
 55 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 56 * @param {number} value The enum value.
 57 * @return {string} The enum as a string.
 58 */
 59var glEnumToString = function(gl, value) {
 60 // Avoid returning "NO_ERROR" if the arguments are totally wrong.
 61 if (gl.NO_ERROR === undefined || value === undefined) {
 62 return undefined;
 63 }
 64 // Optimization for the most common enum:
 65 if (value === gl.NO_ERROR) {
 66 return "NO_ERROR";
 67 }
 68 for (var p in gl) {
 69 if (gl[p] == value) {
 70 if (p == 'drawingBufferWidth' || p == 'drawingBufferHeight') {
 71 continue;
 72 }
 73 return p;
 74 }
 75 }
 76 return "0x" + Number(value).toString(16);
 77};
 78
 79var lastError = "";
 80
 81/**
 82 * Returns the last compiler/linker error.
 83 * @return {string} The last compiler/linker error.
 84 */
 85var getLastError = function() {
 86 return lastError;
 87};
 88
 89/**
 90 * Whether a haystack ends with a needle.
 91 * @param {string} haystack String to search
 92 * @param {string} needle String to search for.
 93 * @param {boolean} True if haystack ends with needle.
 94 */
 95var endsWith = function(haystack, needle) {
 96 return haystack.substr(haystack.length - needle.length) === needle;
 97};
 98
 99/**
 100 * Whether a haystack starts with a needle.
 101 * @param {string} haystack String to search
 102 * @param {string} needle String to search for.
 103 * @param {boolean} True if haystack starts with needle.
 104 */
 105var startsWith = function(haystack, needle) {
 106 return haystack.substr(0, needle.length) === needle;
 107};
 108
 109/**
 110 * A vertex shader for a single texture.
 111 * @type {string}
 112 */
 113var simpleTextureVertexShader = [
 114 'attribute vec4 vPosition;',
 115 'attribute vec2 texCoord0;',
 116 'varying vec2 texCoord;',
 117 'void main() {',
 118 ' gl_Position = vPosition;',
 119 ' texCoord = texCoord0;',
 120 '}'].join('\n');
 121
 122/**
 123 * A fragment shader for a single texture.
 124 * @type {string}
 125 */
 126var simpleTextureFragmentShader = [
 127 'precision mediump float;',
 128 'uniform sampler2D tex;',
 129 'varying vec2 texCoord;',
 130 'void main() {',
 131 ' gl_FragData[0] = texture2D(tex, texCoord);',
 132 '}'].join('\n');
 133
 134/**
 135 * A fragment shader for a single cube map texture.
 136 * @type {string}
 137 */
 138var simpleCubeMapTextureFragmentShader = [
 139 'precision mediump float;',
 140 'uniform samplerCube tex;',
 141 'uniform highp int face;',
 142 'varying vec2 texCoord;',
 143 'void main() {',
 144 // Transform [0, 1] -> [-1, 1]
 145 ' vec2 texC2 = (texCoord * 2.) - 1.;',
 146 // Transform 2d tex coord. to each face of TEXTURE_CUBE_MAP coord.
 147 ' vec3 texCube = vec3(0., 0., 0.);',
 148 ' if (face == 34069) {', // TEXTURE_CUBE_MAP_POSITIVE_X
 149 ' texCube = vec3(1., -texC2.y, -texC2.x);',
 150 ' } else if (face == 34070) {', // TEXTURE_CUBE_MAP_NEGATIVE_X
 151 ' texCube = vec3(-1., -texC2.y, texC2.x);',
 152 ' } else if (face == 34071) {', // TEXTURE_CUBE_MAP_POSITIVE_Y
 153 ' texCube = vec3(texC2.x, 1., texC2.y);',
 154 ' } else if (face == 34072) {', // TEXTURE_CUBE_MAP_NEGATIVE_Y
 155 ' texCube = vec3(texC2.x, -1., -texC2.y);',
 156 ' } else if (face == 34073) {', // TEXTURE_CUBE_MAP_POSITIVE_Z
 157 ' texCube = vec3(texC2.x, -texC2.y, 1.);',
 158 ' } else if (face == 34074) {', // TEXTURE_CUBE_MAP_NEGATIVE_Z
 159 ' texCube = vec3(-texC2.x, -texC2.y, -1.);',
 160 ' }',
 161 ' gl_FragData[0] = textureCube(tex, texCube);',
 162 '}'].join('\n');
 163
 164/**
 165 * A vertex shader for a single texture.
 166 * @type {string}
 167 */
 168var noTexCoordTextureVertexShader = [
 169 'attribute vec4 vPosition;',
 170 'varying vec2 texCoord;',
 171 'void main() {',
 172 ' gl_Position = vPosition;',
 173 ' texCoord = vPosition.xy * 0.5 + 0.5;',
 174 '}'].join('\n');
 175
 176/**
 177 * A vertex shader for a uniform color.
 178 * @type {string}
 179 */
 180var simpleVertexShader = [
 181 'attribute vec4 vPosition;',
 182 'void main() {',
 183 ' gl_Position = vPosition;',
 184 '}'].join('\n');
 185
 186/**
 187 * A fragment shader for a uniform color.
 188 * @type {string}
 189 */
 190var simpleColorFragmentShader = [
 191 'precision mediump float;',
 192 'uniform vec4 u_color;',
 193 'void main() {',
 194 ' gl_FragData[0] = u_color;',
 195 '}'].join('\n');
 196
 197/**
 198 * A fragment shader for a uniform color.
 199 * @type {string}
 200 */
 201var simpleColorFragmentShaderESSL300 = [
 202 '#version 300 es',
 203 'precision mediump float;',
 204 'out vec4 out_color;',
 205 'uniform vec4 u_color;',
 206 'void main() {',
 207 ' out_color = u_color;',
 208 '}'].join('\n');
 209
 210/**
 211 * A vertex shader for vertex colors.
 212 * @type {string}
 213 */
 214var simpleVertexColorVertexShader = [
 215 'attribute vec4 vPosition;',
 216 'attribute vec4 a_color;',
 217 'varying vec4 v_color;',
 218 'void main() {',
 219 ' gl_Position = vPosition;',
 220 ' v_color = a_color;',
 221 '}'].join('\n');
 222
 223/**
 224 * A fragment shader for vertex colors.
 225 * @type {string}
 226 */
 227var simpleVertexColorFragmentShader = [
 228 'precision mediump float;',
 229 'varying vec4 v_color;',
 230 'void main() {',
 231 ' gl_FragData[0] = v_color;',
 232 '}'].join('\n');
 233
 234/**
 235 * Creates a program, attaches shaders, binds attrib locations, links the
 236 * program and calls useProgram.
 237 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 238 * @param {!Array.<!WebGLShader|string>} shaders The shaders to
 239 * attach, or the source, or the id of a script to get
 240 * the source from.
 241 * @param {!Array.<string>} opt_attribs The attribs names.
 242 * @param {!Array.<number>} opt_locations The locations for the attribs.
 243 * @param {boolean} opt_logShaders Whether to log shader source.
 244 */
 245var setupProgram = function(
 246 gl, shaders, opt_attribs, opt_locations, opt_logShaders) {
 247 var realShaders = [];
 248 var program = gl.createProgram();
 249 var shaderCount = 0;
 250 for (var ii = 0; ii < shaders.length; ++ii) {
 251 var shader = shaders[ii];
 252 var shaderType = undefined;
 253 if (typeof shader == 'string') {
 254 var element = document.getElementById(shader);
 255 if (element) {
 256 if (element.type != "x-shader/x-vertex" && element.type != "x-shader/x-fragment")
 257 shaderType = ii ? gl.FRAGMENT_SHADER : gl.VERTEX_SHADER;
 258 shader = loadShaderFromScript(gl, shader, shaderType, undefined, opt_logShaders);
 259 } else if (endsWith(shader, ".vert")) {
 260 shader = loadShaderFromFile(gl, shader, gl.VERTEX_SHADER, undefined, opt_logShaders);
 261 } else if (endsWith(shader, ".frag")) {
 262 shader = loadShaderFromFile(gl, shader, gl.FRAGMENT_SHADER, undefined, opt_logShaders);
 263 } else {
 264 shader = loadShader(gl, shader, ii ? gl.FRAGMENT_SHADER : gl.VERTEX_SHADER, undefined, opt_logShaders);
 265 }
 266 } else if (opt_logShaders) {
 267 throw 'Shader source logging requested but no shader source provided';
 268 }
 269 if (shader) {
 270 ++shaderCount;
 271 gl.attachShader(program, shader);
 272 }
 273 }
 274 if (shaderCount != 2) {
 275 error("Error in compiling shader");
 276 return null;
 277 }
 278 if (opt_attribs) {
 279 for (var ii = 0; ii < opt_attribs.length; ++ii) {
 280 gl.bindAttribLocation(
 281 program,
 282 opt_locations ? opt_locations[ii] : ii,
 283 opt_attribs[ii]);
 284 }
 285 }
 286 gl.linkProgram(program);
 287
 288 // Check the link status
 289 var linked = gl.getProgramParameter(program, gl.LINK_STATUS);
 290 if (!linked) {
 291 // something went wrong with the link
 292 lastError = gl.getProgramInfoLog (program);
 293 error("Error in program linking:" + lastError);
 294
 295 gl.deleteProgram(program);
 296 return null;
 297 }
 298
 299 gl.useProgram(program);
 300 return program;
 301};
 302
 303/**
 304 * Creates a program, attaches shader, sets up trasnform feedback varyings,
 305 * binds attrib locations, links the program and calls useProgram.
 306 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 307 * @param {!Array.<!WebGLShader|string>} shaders The shaders to
 308 * attach, or the source, or the id of a script to get
 309 * the source from.
 310 * @param {!Array.<string>} varyings The transform feedback varying names.
 311 * @param {number} bufferMode The mode used to capture the varying variables.
 312 * @param {!Array.<string>} opt_attribs The attribs names.
 313 * @param {!Array.<number>} opt_locations The locations for the attribs.
 314 * @param {boolean} opt_logShaders Whether to log shader source.
 315 */
 316var setupTransformFeedbackProgram = function(
 317 gl, shaders, varyings, bufferMode, opt_attribs, opt_locations, opt_logShaders, opt_skipCompileStatus) {
 318 var realShaders = [];
 319 var program = gl.createProgram();
 320 var shaderCount = 0;
 321 for (var ii = 0; ii < shaders.length; ++ii) {
 322 var shader = shaders[ii];
 323 var shaderType = undefined;
 324 if (typeof shader == 'string') {
 325 var element = document.getElementById(shader);
 326 if (element) {
 327 if (element.type != "x-shader/x-vertex" && element.type != "x-shader/x-fragment")
 328 shaderType = ii ? gl.FRAGMENT_SHADER : gl.VERTEX_SHADER;
 329 shader = loadShaderFromScript(gl, shader, shaderType, undefined, opt_logShaders, opt_skipCompileStatus);
 330 } else if (endsWith(shader, ".vert")) {
 331 shader = loadShaderFromFile(gl, shader, gl.VERTEX_SHADER, undefined, opt_logShaders, opt_skipCompileStatus);
 332 } else if (endsWith(shader, ".frag")) {
 333 shader = loadShaderFromFile(gl, shader, gl.FRAGMENT_SHADER, undefined, opt_logShaders, opt_skipCompileStatus);
 334 } else {
 335 shader = loadShader(gl, shader, ii ? gl.FRAGMENT_SHADER : gl.VERTEX_SHADER, undefined, opt_logShaders, undefined, undefined, opt_skipCompileStatus);
 336 }
 337 } else if (opt_logShaders) {
 338 throw 'Shader source logging requested but no shader source provided';
 339 }
 340 if (shader) {
 341 ++shaderCount;
 342 gl.attachShader(program, shader);
 343 }
 344 }
 345 if (shaderCount != 2) {
 346 error("Error in compiling shader");
 347 return null;
 348 }
 349
 350 if (opt_attribs) {
 351 for (var ii = 0; ii < opt_attribs.length; ++ii) {
 352 gl.bindAttribLocation(
 353 program,
 354 opt_locations ? opt_locations[ii] : ii,
 355 opt_attribs[ii]);
 356 }
 357 }
 358
 359 gl.transformFeedbackVaryings(program, varyings, bufferMode);
 360
 361 gl.linkProgram(program);
 362
 363 // Check the link status
 364 var linked = gl.getProgramParameter(program, gl.LINK_STATUS);
 365 if (!linked) {
 366 // something went wrong with the link
 367 lastError = gl.getProgramInfoLog (program);
 368 error("Error in program linking:" + lastError);
 369
 370 gl.deleteProgram(program);
 371 return null;
 372 }
 373
 374 gl.useProgram(program);
 375 return program;
 376};
 377
 378/**
 379 * Creates a simple texture program.
 380 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 381 * @return {WebGLProgram}
 382 */
 383var setupNoTexCoordTextureProgram = function(gl) {
 384 return setupProgram(gl,
 385 [noTexCoordTextureVertexShader, simpleTextureFragmentShader],
 386 ['vPosition'],
 387 [0]);
 388};
 389
 390/**
 391 * Creates a simple texture program.
 392 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 393 * @param {number} opt_positionLocation The attrib location for position.
 394 * @param {number} opt_texcoordLocation The attrib location for texture coords.
 395 * @return {WebGLProgram}
 396 */
 397var setupSimpleTextureProgram = function(
 398 gl, opt_positionLocation, opt_texcoordLocation) {
 399 opt_positionLocation = opt_positionLocation || 0;
 400 opt_texcoordLocation = opt_texcoordLocation || 1;
 401 return setupProgram(gl,
 402 [simpleTextureVertexShader, simpleTextureFragmentShader],
 403 ['vPosition', 'texCoord0'],
 404 [opt_positionLocation, opt_texcoordLocation]);
 405};
 406
 407/**
 408 * Creates a simple cube map texture program.
 409 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 410 * @param {number} opt_positionLocation The attrib location for position.
 411 * @param {number} opt_texcoordLocation The attrib location for texture coords.
 412 * @return {WebGLProgram}
 413 */
 414var setupSimpleCubeMapTextureProgram = function(
 415 gl, opt_positionLocation, opt_texcoordLocation) {
 416 opt_positionLocation = opt_positionLocation || 0;
 417 opt_texcoordLocation = opt_texcoordLocation || 1;
 418 return setupProgram(gl,
 419 [simpleTextureVertexShader, simpleCubeMapTextureFragmentShader],
 420 ['vPosition', 'texCoord0'],
 421 [opt_positionLocation, opt_texcoordLocation]);
 422};
 423
 424/**
 425 * Creates a simple vertex color program.
 426 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 427 * @param {number} opt_positionLocation The attrib location for position.
 428 * @param {number} opt_vertexColorLocation The attrib location
 429 * for vertex colors.
 430 * @return {WebGLProgram}
 431 */
 432var setupSimpleVertexColorProgram = function(
 433 gl, opt_positionLocation, opt_vertexColorLocation) {
 434 opt_positionLocation = opt_positionLocation || 0;
 435 opt_vertexColorLocation = opt_vertexColorLocation || 1;
 436 return setupProgram(gl,
 437 [simpleVertexColorVertexShader, simpleVertexColorFragmentShader],
 438 ['vPosition', 'a_color'],
 439 [opt_positionLocation, opt_vertexColorLocation]);
 440};
 441
 442/**
 443 * Creates a simple color program.
 444 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 445 * @param {number} opt_positionLocation The attrib location for position.
 446 * @return {WebGLProgram}
 447 */
 448var setupSimpleColorProgram = function(gl, opt_positionLocation) {
 449 opt_positionLocation = opt_positionLocation || 0;
 450 return setupProgram(gl,
 451 [simpleVertexShader, simpleColorFragmentShader],
 452 ['vPosition'],
 453 [opt_positionLocation]);
 454};
 455
 456/**
 457 * Creates buffers for a textured unit quad and attaches them to vertex attribs.
 458 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 459 * @param {number} opt_positionLocation The attrib location for position.
 460 * @param {number} opt_texcoordLocation The attrib location for texture coords.
 461 * @param {!Object} various options. See setupQuad for details.
 462 * @return {!Array.<WebGLBuffer>} The buffer objects that were
 463 * created.
 464 */
 465var setupUnitQuad = function(gl, opt_positionLocation, opt_texcoordLocation, options) {
 466 return setupQuadWithTexCoords(gl, [ 0.0, 0.0 ], [ 1.0, 1.0 ],
 467 opt_positionLocation, opt_texcoordLocation,
 468 options);
 469};
 470
 471/**
 472 * Creates buffers for a textured quad with specified lower left
 473 * and upper right texture coordinates, and attaches them to vertex
 474 * attribs.
 475 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 476 * @param {!Array.<number>} lowerLeftTexCoords The texture coordinates for the lower left corner.
 477 * @param {!Array.<number>} upperRightTexCoords The texture coordinates for the upper right corner.
 478 * @param {number} opt_positionLocation The attrib location for position.
 479 * @param {number} opt_texcoordLocation The attrib location for texture coords.
 480 * @param {!Object} various options. See setupQuad for details.
 481 * @return {!Array.<WebGLBuffer>} The buffer objects that were
 482 * created.
 483 */
 484var setupQuadWithTexCoords = function(
 485 gl, lowerLeftTexCoords, upperRightTexCoords,
 486 opt_positionLocation, opt_texcoordLocation, options) {
 487 var defaultOptions = {
 488 positionLocation: opt_positionLocation || 0,
 489 texcoordLocation: opt_texcoordLocation || 1,
 490 lowerLeftTexCoords: lowerLeftTexCoords,
 491 upperRightTexCoords: upperRightTexCoords
 492 };
 493 if (options) {
 494 for (var prop in options) {
 495 defaultOptions[prop] = options[prop]
 496 }
 497 }
 498 return setupQuad(gl, defaultOptions);
 499};
 500
 501/**
 502 * Makes a quad with various options.
 503 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 504 * @param {!Object} options
 505 *
 506 * scale: scale to multiply unit quad values by. default 1.0.
 507 * positionLocation: attribute location for position.
 508 * texcoordLocation: attribute location for texcoords.
 509 * If this does not exist no texture coords are created.
 510 * lowerLeftTexCoords: an array of 2 values for the
 511 * lowerLeftTexCoords.
 512 * upperRightTexCoords: an array of 2 values for the
 513 * upperRightTexCoords.
 514 */
 515var setupQuad = function(gl, options) {
 516 var positionLocation = options.positionLocation || 0;
 517 var scale = options.scale || 1;
 518
 519 var objects = [];
 520
 521 var vertexObject = gl.createBuffer();
 522 gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
 523 gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
 524 1.0 * scale , 1.0 * scale,
 525 -1.0 * scale , 1.0 * scale,
 526 -1.0 * scale , -1.0 * scale,
 527 1.0 * scale , 1.0 * scale,
 528 -1.0 * scale , -1.0 * scale,
 529 1.0 * scale , -1.0 * scale]), gl.STATIC_DRAW);
 530 gl.enableVertexAttribArray(positionLocation);
 531 gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);
 532 objects.push(vertexObject);
 533
 534 if (options.texcoordLocation !== undefined) {
 535 var llx = options.lowerLeftTexCoords[0];
 536 var lly = options.lowerLeftTexCoords[1];
 537 var urx = options.upperRightTexCoords[0];
 538 var ury = options.upperRightTexCoords[1];
 539
 540 vertexObject = gl.createBuffer();
 541 gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
 542 gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
 543 urx, ury,
 544 llx, ury,
 545 llx, lly,
 546 urx, ury,
 547 llx, lly,
 548 urx, lly]), gl.STATIC_DRAW);
 549 gl.enableVertexAttribArray(options.texcoordLocation);
 550 gl.vertexAttribPointer(options.texcoordLocation, 2, gl.FLOAT, false, 0, 0);
 551 objects.push(vertexObject);
 552 }
 553
 554 return objects;
 555};
 556
 557/**
 558 * Creates a program and buffers for rendering a textured quad.
 559 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 560 * @param {number} opt_positionLocation The attrib location for
 561 * position. Default = 0.
 562 * @param {number} opt_texcoordLocation The attrib location for
 563 * texture coords. Default = 1.
 564 * @param {!Object} various options. See setupQuad for details.
 565 * @return {!WebGLProgram}
 566 */
 567var setupTexturedQuad = function(
 568 gl, opt_positionLocation, opt_texcoordLocation, options) {
 569 var program = setupSimpleTextureProgram(
 570 gl, opt_positionLocation, opt_texcoordLocation);
 571 setupUnitQuad(gl, opt_positionLocation, opt_texcoordLocation, options);
 572 return program;
 573};
 574
 575/**
 576 * Creates a program and buffers for rendering a color quad.
 577 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 578 * @param {number} opt_positionLocation The attrib location for position.
 579 * @param {!Object} various options. See setupQuad for details.
 580 * @return {!WebGLProgram}
 581 */
 582var setupColorQuad = function(gl, opt_positionLocation, options) {
 583 opt_positionLocation = opt_positionLocation || 0;
 584 var program = setupSimpleColorProgram(gl, opt_positionLocation);
 585 setupUnitQuad(gl, opt_positionLocation, 0, options);
 586 return program;
 587};
 588
 589/**
 590 * Creates a program and buffers for rendering a textured quad with
 591 * specified lower left and upper right texture coordinates.
 592 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 593 * @param {!Array.<number>} lowerLeftTexCoords The texture coordinates for the lower left corner.
 594 * @param {!Array.<number>} upperRightTexCoords The texture coordinates for the upper right corner.
 595 * @param {number} opt_positionLocation The attrib location for position.
 596 * @param {number} opt_texcoordLocation The attrib location for texture coords.
 597 * @return {!WebGLProgram}
 598 */
 599var setupTexturedQuadWithTexCoords = function(
 600 gl, lowerLeftTexCoords, upperRightTexCoords,
 601 opt_positionLocation, opt_texcoordLocation) {
 602 var program = setupSimpleTextureProgram(
 603 gl, opt_positionLocation, opt_texcoordLocation);
 604 setupQuadWithTexCoords(gl, lowerLeftTexCoords, upperRightTexCoords,
 605 opt_positionLocation, opt_texcoordLocation);
 606 return program;
 607};
 608
 609/**
 610 * Creates a program and buffers for rendering a textured quad with
 611 * a cube map texture.
 612 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 613 * @param {number} opt_positionLocation The attrib location for
 614 * position. Default = 0.
 615 * @param {number} opt_texcoordLocation The attrib location for
 616 * texture coords. Default = 1.
 617 * @return {!WebGLProgram}
 618 */
 619var setupTexturedQuadWithCubeMap = function(
 620 gl, opt_positionLocation, opt_texcoordLocation) {
 621 var program = setupSimpleCubeMapTextureProgram(
 622 gl, opt_positionLocation, opt_texcoordLocation);
 623 setupUnitQuad(gl, opt_positionLocation, opt_texcoordLocation, undefined);
 624 return program;
 625};
 626
 627/**
 628 * Creates a unit quad with only positions of a given resolution.
 629 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 630 * @param {number} gridRes The resolution of the mesh grid,
 631 * expressed in the number of quads across and down.
 632 * @param {number} opt_positionLocation The attrib location for position.
 633 */
 634var setupIndexedQuad = function (
 635 gl, gridRes, opt_positionLocation, opt_flipOddTriangles) {
 636 return setupIndexedQuadWithOptions(gl,
 637 { gridRes: gridRes,
 638 positionLocation: opt_positionLocation,
 639 flipOddTriangles: opt_flipOddTriangles
 640 });
 641};
 642
 643/**
 644 * Creates a quad with various options.
 645 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 646 * @param {!Object} options The options. See below.
 647 * @return {!Array.<WebGLBuffer>} The created buffers.
 648 * [positions, <colors>, indices]
 649 *
 650 * Options:
 651 * gridRes: number of quads across and down grid.
 652 * positionLocation: attrib location for position
 653 * flipOddTriangles: reverse order of vertices of every other
 654 * triangle
 655 * positionOffset: offset added to each vertex
 656 * positionMult: multipier for each vertex
 657 * colorLocation: attrib location for vertex colors. If
 658 * undefined no vertex colors will be created.
 659 */
 660var setupIndexedQuadWithOptions = function (gl, options) {
 661 var positionLocation = options.positionLocation || 0;
 662 var objects = [];
 663
 664 var gridRes = options.gridRes || 1;
 665 var positionOffset = options.positionOffset || 0;
 666 var positionMult = options.positionMult || 1;
 667 var vertsAcross = gridRes + 1;
 668 var numVerts = vertsAcross * vertsAcross;
 669 var positions = new Float32Array(numVerts * 3);
 670 var indices = new Uint16Array(6 * gridRes * gridRes);
 671 var poffset = 0;
 672
 673 for (var yy = 0; yy <= gridRes; ++yy) {
 674 for (var xx = 0; xx <= gridRes; ++xx) {
 675 positions[poffset + 0] = (-1 + 2 * xx / gridRes) * positionMult + positionOffset;
 676 positions[poffset + 1] = (-1 + 2 * yy / gridRes) * positionMult + positionOffset;
 677 positions[poffset + 2] = 0;
 678
 679 poffset += 3;
 680 }
 681 }
 682
 683 var buf = gl.createBuffer();
 684 gl.bindBuffer(gl.ARRAY_BUFFER, buf);
 685 gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);
 686 gl.enableVertexAttribArray(positionLocation);
 687 gl.vertexAttribPointer(positionLocation, 3, gl.FLOAT, false, 0, 0);
 688 objects.push(buf);
 689
 690 if (options.colorLocation !== undefined) {
 691 var colors = new Float32Array(numVerts * 4);
 692 for (var yy = 0; yy <= gridRes; ++yy) {
 693 for (var xx = 0; xx <= gridRes; ++xx) {
 694 if (options.color !== undefined) {
 695 colors[poffset + 0] = options.color[0];
 696 colors[poffset + 1] = options.color[1];
 697 colors[poffset + 2] = options.color[2];
 698 colors[poffset + 3] = options.color[3];
 699 } else {
 700 colors[poffset + 0] = xx / gridRes;
 701 colors[poffset + 1] = yy / gridRes;
 702 colors[poffset + 2] = (xx / gridRes) * (yy / gridRes);
 703 colors[poffset + 3] = (yy % 2) * 0.5 + 0.5;
 704 }
 705 poffset += 4;
 706 }
 707 }
 708
 709 buf = gl.createBuffer();
 710 gl.bindBuffer(gl.ARRAY_BUFFER, buf);
 711 gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW);
 712 gl.enableVertexAttribArray(options.colorLocation);
 713 gl.vertexAttribPointer(options.colorLocation, 4, gl.FLOAT, false, 0, 0);
 714 objects.push(buf);
 715 }
 716
 717 var tbase = 0;
 718 for (var yy = 0; yy < gridRes; ++yy) {
 719 var index = yy * vertsAcross;
 720 for (var xx = 0; xx < gridRes; ++xx) {
 721 indices[tbase + 0] = index + 0;
 722 indices[tbase + 1] = index + 1;
 723 indices[tbase + 2] = index + vertsAcross;
 724 indices[tbase + 3] = index + vertsAcross;
 725 indices[tbase + 4] = index + 1;
 726 indices[tbase + 5] = index + vertsAcross + 1;
 727
 728 if (options.flipOddTriangles) {
 729 indices[tbase + 4] = index + vertsAcross + 1;
 730 indices[tbase + 5] = index + 1;
 731 }
 732
 733 index += 1;
 734 tbase += 6;
 735 }
 736 }
 737
 738 buf = gl.createBuffer();
 739 gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buf);
 740 gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
 741 objects.push(buf);
 742
 743 return objects;
 744};
 745
 746/**
 747 * Returns the constructor for a typed array that corresponds to the given
 748 * WebGL type.
 749 * @param {!WebGLRenderingContext} gl A WebGLRenderingContext.
 750 * @param {number} type The WebGL type (eg, gl.UNSIGNED_BYTE)
 751 * @return {!Constructor} The typed array constructor that
 752 * corresponds to the given type.
 753 */
 754var glTypeToTypedArrayType = function(gl, type) {
 755 switch (type) {
 756 case gl.BYTE:
 757 return window.Int8Array;
 758 case gl.UNSIGNED_BYTE:
 759 return window.Uint8Array;
 760 case gl.SHORT:
 761 return window.Int16Array;
 762 case gl.UNSIGNED_SHORT:
 763 case gl.UNSIGNED_SHORT_5_6_5:
 764 case gl.UNSIGNED_SHORT_4_4_4_4:
 765 case gl.UNSIGNED_SHORT_5_5_5_1:
 766 return window.Uint16Array;
 767 case gl.INT:
 768 return window.Int32Array;
 769 case gl.UNSIGNED_INT:
 770 case gl.UNSIGNED_INT_5_9_9_9_REV:
 771 case gl.UNSIGNED_INT_10F_11F_11F_REV:
 772 case gl.UNSIGNED_INT_2_10_10_10_REV:
 773 case gl.UNSIGNED_INT_24_8:
 774 return window.Uint32Array;
 775 case gl.HALF_FLOAT:
 776 case 0x8D61: // HALF_FLOAT_OES
 777 return window.Uint16Array;
 778 case gl.FLOAT:
 779 return window.Float32Array;
 780 default:
 781 throw 'unknown gl type ' + glEnumToString(gl, type);
 782 }
 783};
 784
 785/**
 786 * Returns the number of bytes per component for a given WebGL type.
 787 * @param {!WebGLRenderingContext} gl A WebGLRenderingContext.
 788 * @param {GLenum} type The WebGL type (eg, gl.UNSIGNED_BYTE)
 789 * @return {number} The number of bytes per component.
 790 */
 791var getBytesPerComponent = function(gl, type) {
 792 switch (type) {
 793 case gl.BYTE:
 794 case gl.UNSIGNED_BYTE:
 795 return 1;
 796 case gl.SHORT:
 797 case gl.UNSIGNED_SHORT:
 798 case gl.UNSIGNED_SHORT_5_6_5:
 799 case gl.UNSIGNED_SHORT_4_4_4_4:
 800 case gl.UNSIGNED_SHORT_5_5_5_1:
 801 case gl.HALF_FLOAT:
 802 case 0x8D61: // HALF_FLOAT_OES
 803 return 2;
 804 case gl.INT:
 805 case gl.UNSIGNED_INT:
 806 case gl.UNSIGNED_INT_5_9_9_9_REV:
 807 case gl.UNSIGNED_INT_10F_11F_11F_REV:
 808 case gl.UNSIGNED_INT_2_10_10_10_REV:
 809 case gl.UNSIGNED_INT_24_8:
 810 case gl.FLOAT:
 811 return 4;
 812 default:
 813 throw 'unknown gl type ' + glEnumToString(gl, type);
 814 }
 815};
 816
 817/**
 818 * Returns the number of typed array elements per pixel for a given WebGL
 819 * format/type combination. The corresponding typed array type can be determined
 820 * by calling glTypeToTypedArrayType.
 821 * @param {!WebGLRenderingContext} gl A WebGLRenderingContext.
 822 * @param {GLenum} format The WebGL format (eg, gl.RGBA)
 823 * @param {GLenum} type The WebGL type (eg, gl.UNSIGNED_BYTE)
 824 * @return {number} The number of typed array elements per pixel.
 825 */
 826var getTypedArrayElementsPerPixel = function(gl, format, type) {
 827 switch (type) {
 828 case gl.UNSIGNED_SHORT_5_6_5:
 829 case gl.UNSIGNED_SHORT_4_4_4_4:
 830 case gl.UNSIGNED_SHORT_5_5_5_1:
 831 return 1;
 832 case gl.UNSIGNED_BYTE:
 833 break;
 834 default:
 835 throw 'not a gl type for color information ' + glEnumToString(gl, type);
 836 }
 837
 838 switch (format) {
 839 case gl.RGBA:
 840 return 4;
 841 case gl.RGB:
 842 return 3;
 843 case gl.LUMINANCE_ALPHA:
 844 return 2;
 845 case gl.LUMINANCE:
 846 case gl.ALPHA:
 847 return 1;
 848 default:
 849 throw 'unknown gl format ' + glEnumToString(gl, format);
 850 }
 851};
 852
 853/**
 854 * Fills the given texture with a solid color.
 855 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 856 * @param {!WebGLTexture} tex The texture to fill.
 857 * @param {number} width The width of the texture to create.
 858 * @param {number} height The height of the texture to create.
 859 * @param {!Array.<number>} color The color to fill with.
 860 * where each element is in the range 0 to 255.
 861 * @param {number} opt_level The level of the texture to fill. Default = 0.
 862 * @param {number} opt_format The format for the texture.
 863 * @param {number} opt_internalFormat The internal format for the texture.
 864 */
 865var fillTexture = function(gl, tex, width, height, color, opt_level, opt_format, opt_type, opt_internalFormat) {
 866 opt_level = opt_level || 0;
 867 opt_format = opt_format || gl.RGBA;
 868 opt_type = opt_type || gl.UNSIGNED_BYTE;
 869 opt_internalFormat = opt_internalFormat || opt_format;
 870 var pack = gl.getParameter(gl.UNPACK_ALIGNMENT);
 871 var numComponents = color.length;
 872 var bytesPerComponent = getBytesPerComponent(gl, opt_type);
 873 var rowSize = numComponents * width * bytesPerComponent;
 874 // See equation 3.10 in ES 2.0 spec and equation 3.13 in ES 3.0 spec for paddedRowLength calculation.
 875 // k is paddedRowLength.
 876 // n is numComponents.
 877 // l is width.
 878 // a is pack.
 879 // s is bytesPerComponent.
 880 var paddedRowLength;
 881 if (bytesPerComponent >= pack)
 882 paddedRowLength = numComponents * width;
 883 else
 884 paddedRowLength = Math.floor((rowSize + pack - 1) / pack) * pack / bytesPerComponent;
 885 var size = width * numComponents + (height - 1) * paddedRowLength;
 886 var buf = new (glTypeToTypedArrayType(gl, opt_type))(size);
 887 for (var yy = 0; yy < height; ++yy) {
 888 var off = yy * paddedRowLength;
 889 for (var xx = 0; xx < width; ++xx) {
 890 for (var jj = 0; jj < numComponents; ++jj) {
 891 buf[off++] = color[jj];
 892 }
 893 }
 894 }
 895 gl.bindTexture(gl.TEXTURE_2D, tex);
 896 gl.texImage2D(
 897 gl.TEXTURE_2D, opt_level, opt_internalFormat, width, height, 0,
 898 opt_format, opt_type, buf);
 899};
 900
 901/**
 902 * Creates a texture and fills it with a solid color.
 903 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 904 * @param {number} width The width of the texture to create.
 905 * @param {number} height The height of the texture to create.
 906 * @param {!Array.<number>} color The color to fill with. A 4 element array
 907 * where each element is in the range 0 to 255.
 908 * @return {!WebGLTexture}
 909 */
 910var createColoredTexture = function(gl, width, height, color) {
 911 var tex = gl.createTexture();
 912 fillTexture(gl, tex, width, height, color);
 913 return tex;
 914};
 915
 916var ubyteToFloat = function(c) {
 917 return c / 255;
 918};
 919
 920var ubyteColorToFloatColor = function(color) {
 921 var floatColor = [];
 922 for (var ii = 0; ii < color.length; ++ii) {
 923 floatColor[ii] = ubyteToFloat(color[ii]);
 924 }
 925 return floatColor;
 926};
 927
 928/**
 929 * Sets the "u_color" uniform of the current program to color.
 930 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 931 * @param {!Array.<number>} color 4 element array of 0-1 color
 932 * components.
 933 */
 934var setFloatDrawColor = function(gl, color) {
 935 var program = gl.getParameter(gl.CURRENT_PROGRAM);
 936 var colorLocation = gl.getUniformLocation(program, "u_color");
 937 gl.uniform4fv(colorLocation, color);
 938};
 939
 940/**
 941 * Sets the "u_color" uniform of the current program to color.
 942 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 943 * @param {!Array.<number>} color 4 element array of 0-255 color
 944 * components.
 945 */
 946var setUByteDrawColor = function(gl, color) {
 947 setFloatDrawColor(gl, ubyteColorToFloatColor(color));
 948};
 949
 950/**
 951 * Draws a previously setup quad in the given color.
 952 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 953 * @param {!Array.<number>} color The color to draw with. A 4
 954 * element array where each element is in the range 0 to
 955 * 1.
 956 */
 957var drawFloatColorQuad = function(gl, color) {
 958 var program = gl.getParameter(gl.CURRENT_PROGRAM);
 959 var colorLocation = gl.getUniformLocation(program, "u_color");
 960 gl.uniform4fv(colorLocation, color);
 961 gl.drawArrays(gl.TRIANGLES, 0, 6);
 962};
 963
 964
 965/**
 966 * Draws a previously setup quad in the given color.
 967 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 968 * @param {!Array.<number>} color The color to draw with. A 4
 969 * element array where each element is in the range 0 to
 970 * 255.
 971 */
 972var drawUByteColorQuad = function(gl, color) {
 973 drawFloatColorQuad(gl, ubyteColorToFloatColor(color));
 974};
 975
 976/**
 977 * Draws a previously setupUnitQuad.
 978 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 979 */
 980var drawUnitQuad = function(gl) {
 981 gl.drawArrays(gl.TRIANGLES, 0, 6);
 982};
 983
 984var dummySetProgramAndDrawNothing = function(gl) {
 985 if (!gl._wtuDummyProgram) {
 986 gl._wtuDummyProgram = setupProgram(gl, [
 987 "void main() { gl_Position = vec4(0.0); }",
 988 "void main() { gl_FragColor = vec4(0.0); }"
 989 ], [], []);
 990 }
 991 gl.useProgram(gl._wtuDummyProgram);
 992 gl.drawArrays(gl.TRIANGLES, 0, 3);
 993};
 994
 995/**
 996 * Clears then Draws a previously setupUnitQuad.
 997 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 998 * @param {!Array.<number>} opt_color The color to fill clear with before
 999 * drawing. A 4 element array where each element is in the range 0 to
 1000 * 255. Default [255, 255, 255, 255]
 1001 */
 1002var clearAndDrawUnitQuad = function(gl, opt_color) {
 1003 opt_color = opt_color || [255, 255, 255, 255];
 1004 gl.clearColor(
 1005 opt_color[0] / 255,
 1006 opt_color[1] / 255,
 1007 opt_color[2] / 255,
 1008 opt_color[3] / 255);
 1009 gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
 1010 drawUnitQuad(gl);
 1011};
 1012
 1013/**
 1014 * Draws a quad previously setup with setupIndexedQuad.
 1015 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 1016 * @param {number} gridRes Resolution of grid.
 1017 */
 1018var drawIndexedQuad = function(gl, gridRes) {
 1019 gl.drawElements(gl.TRIANGLES, gridRes * gridRes * 6, gl.UNSIGNED_SHORT, 0);
 1020};
 1021
 1022/**
 1023 * Draws a previously setupIndexedQuad
 1024 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 1025 * @param {number} gridRes Resolution of grid.
 1026 * @param {!Array.<number>} opt_color The color to fill clear with before
 1027 * drawing. A 4 element array where each element is in the range 0 to
 1028 * 255. Default [255, 255, 255, 255]
 1029 */
 1030var clearAndDrawIndexedQuad = function(gl, gridRes, opt_color) {
 1031 opt_color = opt_color || [255, 255, 255, 255];
 1032 gl.clearColor(
 1033 opt_color[0] / 255,
 1034 opt_color[1] / 255,
 1035 opt_color[2] / 255,
 1036 opt_color[3] / 255);
 1037 gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
 1038 drawIndexedQuad(gl, gridRes);
 1039};
 1040
 1041/**
 1042 * Clips a range to min, max
 1043 * (Eg. clipToRange(-5,7,0,20) would return {value:0,extent:2}
 1044 * @param {number} value start of range
 1045 * @param {number} extent extent of range
 1046 * @param {number} min min.
 1047 * @param {number} max max.
 1048 * @return {!{value:number,extent:number}} The clipped value.
 1049 */
 1050var clipToRange = function(value, extent, min, max) {
 1051 if (value < min) {
 1052 extent -= min - value;
 1053 value = min;
 1054 }
 1055 var end = value + extent;
 1056 if (end > max) {
 1057 extent -= end - max;
 1058 }
 1059 if (extent < 0) {
 1060 value = max;
 1061 extent = 0;
 1062 }
 1063 return {value:value, extent: extent};
 1064};
 1065
 1066/**
 1067 * Determines if the passed context is an instance of a WebGLRenderingContext
 1068 * or later variant (like WebGL2RenderingContext)
 1069 * @param {CanvasRenderingContext} ctx The context to check.
 1070 */
 1071var isWebGLContext = function(ctx) {
 1072 if (ctx instanceof WebGLRenderingContext)
 1073 return true;
 1074
 1075 if ('WebGL2RenderingContext' in window && ctx instanceof WebGL2RenderingContext)
 1076 return true;
 1077
 1078 return false;
 1079};
 1080
 1081/**
 1082 * Creates a check rect is used by checkCanvasRects.
 1083 * @param {number} x left corner of region to check.
 1084 * @param {number} y bottom corner of region to check in case of checking from
 1085 * a GL context or top corner in case of checking from a 2D context.
 1086 * @param {number} width width of region to check.
 1087 * @param {number} height width of region to check.
 1088 * @param {!Array.<number>} color The color expected. A 4 element array where
 1089 * each element is in the range 0 to 255.
 1090 * @param {string} opt_msg Message to associate with success. Eg
 1091 * ("should be red").
 1092 * @param {number} opt_errorRange Optional. Acceptable error in
 1093 * color checking. 0 by default.
 1094 */
 1095var makeCheckRect = function(x, y, width, height, color, msg, errorRange) {
 1096 var rect = {
 1097 'x': x, 'y': y,
 1098 'width': width, 'height': height,
 1099 'color': color, 'msg': msg,
 1100 'errorRange': errorRange,
 1101
 1102 'checkRect': function (buf, l, b, w) {
 1103 for (var px = (x - l) ; px < (x + width - l) ; ++px) {
 1104 for (var py = (y - b) ; py < (y + height - b) ; ++py) {
 1105 var offset = (py * w + px) * 4;
 1106 for (var j = 0; j < color.length; ++j) {
 1107 if (Math.abs(buf[offset + j] - color[j]) > errorRange) {
 1108 testFailed(msg);
 1109 var was = buf[offset + 0].toString();
 1110 for (j = 1; j < color.length; ++j) {
 1111 was += "," + buf[offset + j];
 1112 }
 1113 debug('at (' + px + ', ' + py +
 1114 ') expected: ' + color + ' was ' + was);
 1115 return;
 1116 }
 1117 }
 1118 }
 1119 }
 1120 testPassed(msg);
 1121 }
 1122 }
 1123 return rect;
 1124};
 1125
 1126/**
 1127 * Checks that a portions of a canvas or the currently attached framebuffer is 1 color.
 1128 * @param {!WebGLRenderingContext|CanvasRenderingContext2D} gl The
 1129 * WebGLRenderingContext or 2D context to use.
 1130 * @param {!Array.<checkRect>} array of rects to check for matching color.
 1131 */
 1132var checkCanvasRects = function(gl, rects) {
 1133 if (rects.length > 0) {
 1134 var left = rects[0].x;
 1135 var right = rects[0].x + rects[1].width;
 1136 var bottom = rects[0].y;
 1137 var top = rects[0].y + rects[0].height;
 1138 for (var i = 1; i < rects.length; ++i) {
 1139 left = Math.min(left, rects[i].x);
 1140 right = Math.max(right, rects[i].x + rects[i].width);
 1141 bottom = Math.min(bottom, rects[i].y);
 1142 top = Math.max(top, rects[i].y + rects[i].height);
 1143 }
 1144 var width = right - left;
 1145 var height = top - bottom;
 1146 var buf = new Uint8Array(width * height * 4);
 1147 gl.readPixels(left, bottom, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf);
 1148 for (var i = 0; i < rects.length; ++i) {
 1149 rects[i].checkRect(buf, left, bottom, width);
 1150 }
 1151 }
 1152};
 1153
 1154/**
 1155 * Checks that a portion of a canvas or the currently attached framebuffer is 1 color.
 1156 * @param {!WebGLRenderingContext|CanvasRenderingContext2D} gl The
 1157 * WebGLRenderingContext or 2D context to use.
 1158 * @param {number} x left corner of region to check.
 1159 * @param {number} y bottom corner of region to check in case of checking from
 1160 * a GL context or top corner in case of checking from a 2D context.
 1161 * @param {number} width width of region to check.
 1162 * @param {number} height width of region to check.
 1163 * @param {!Array.<number>} color The color expected. A 4 element array where
 1164 * each element is in the range 0 to 255.
 1165 * @param {number} opt_errorRange Optional. Acceptable error in
 1166 * color checking. 0 by default.
 1167 * @param {!function()} sameFn Function to call if all pixels
 1168 * are the same as color.
 1169 * @param {!function()} differentFn Function to call if a pixel
 1170 * is different than color
 1171 * @param {!function()} logFn Function to call for logging.
 1172 * @param {TypedArray} opt_readBackBuf optional buffer to read back into.
 1173 * Typically passed to either reuse buffer, or support readbacks from
 1174 * floating-point framebuffers.
 1175 * @param {GLenum} opt_readBackType optional read back type, defaulting to
 1176 * gl.UNSIGNED_BYTE. Can be used to support readback from floating-point
 1177 * framebuffers.
 1178 */
 1179var checkCanvasRectColor = function(gl, x, y, width, height, color, opt_errorRange, sameFn, differentFn, logFn, opt_readBackBuf, opt_readBackType) {
 1180 if (isWebGLContext(gl) && !gl.getParameter(gl.FRAMEBUFFER_BINDING)) {
 1181 // We're reading the backbuffer so clip.
 1182 var xr = clipToRange(x, width, 0, gl.canvas.width);
 1183 var yr = clipToRange(y, height, 0, gl.canvas.height);
 1184 if (!xr.extent || !yr.extent) {
 1185 logFn("checking rect: effective width or height is zero");
 1186 sameFn();
 1187 return;
 1188 }
 1189 x = xr.value;
 1190 y = yr.value;
 1191 width = xr.extent;
 1192 height = yr.extent;
 1193 }
 1194 var errorRange = opt_errorRange || 0;
 1195 if (!errorRange.length) {
 1196 errorRange = [errorRange, errorRange, errorRange, errorRange]
 1197 }
 1198 var buf;
 1199 if (isWebGLContext(gl)) {
 1200 buf = opt_readBackBuf ? opt_readBackBuf : new Uint8Array(width * height * 4);
 1201 var readBackType = opt_readBackType ? opt_readBackType : gl.UNSIGNED_BYTE;
 1202 gl.readPixels(x, y, width, height, gl.RGBA, readBackType, buf);
 1203 } else {
 1204 buf = gl.getImageData(x, y, width, height).data;
 1205 }
 1206 for (var i = 0; i < width * height; ++i) {
 1207 var offset = i * 4;
 1208 for (var j = 0; j < color.length; ++j) {
 1209 if (Math.abs(buf[offset + j] - color[j]) > errorRange[j]) {
 1210 var was = buf[offset + 0].toString();
 1211 for (j = 1; j < color.length; ++j) {
 1212 was += "," + buf[offset + j];
 1213 }
 1214 differentFn('at (' + (x + (i % width)) + ', ' + (y + Math.floor(i / width)) +
 1215 ') expected: ' + color + ' was ' + was);
 1216 return;
 1217 }
 1218 }
 1219 }
 1220 sameFn();
 1221};
 1222
 1223/**
 1224 * Checks that a portion of a canvas or the currently attached framebuffer is 1 color.
 1225 * @param {!WebGLRenderingContext|CanvasRenderingContext2D} gl The
 1226 * WebGLRenderingContext or 2D context to use.
 1227 * @param {number} x left corner of region to check.
 1228 * @param {number} y bottom corner of region to check in case of checking from
 1229 * a GL context or top corner in case of checking from a 2D context.
 1230 * @param {number} width width of region to check.
 1231 * @param {number} height width of region to check.
 1232 * @param {!Array.<number>} color The color expected. A 4 element array where
 1233 * each element is in the range 0 to 255.
 1234 * @param {string} opt_msg Message to associate with success or failure. Eg
 1235 * ("should be red").
 1236 * @param {number} opt_errorRange Optional. Acceptable error in
 1237 * color checking. 0 by default.
 1238 * @param {TypedArray} opt_readBackBuf optional buffer to read back into.
 1239 * Typically passed to either reuse buffer, or support readbacks from
 1240 * floating-point framebuffers.
 1241 * @param {GLenum} opt_readBackType optional read back type, defaulting to
 1242 * gl.UNSIGNED_BYTE. Can be used to support readback from floating-point
 1243 * framebuffers.
 1244 */
 1245var checkCanvasRect = function(gl, x, y, width, height, color, opt_msg, opt_errorRange, opt_readBackBuf, opt_readBackType) {
 1246 checkCanvasRectColor(
 1247 gl, x, y, width, height, color, opt_errorRange,
 1248 function() {
 1249 var msg = opt_msg;
 1250 if (msg === undefined)
 1251 msg = "should be " + color.toString();
 1252 testPassed(msg);
 1253 },
 1254 function(differentMsg) {
 1255 var msg = opt_msg;
 1256 if (msg === undefined)
 1257 msg = "should be " + color.toString();
 1258 testFailed(msg + "\n" + differentMsg);
 1259 },
 1260 debug,
 1261 opt_readBackBuf,
 1262 opt_readBackType);
 1263};
 1264
 1265/**
 1266 * Checks that an entire canvas or the currently attached framebuffer is 1 color.
 1267 * @param {!WebGLRenderingContext|CanvasRenderingContext2D} gl The
 1268 * WebGLRenderingContext or 2D context to use.
 1269 * @param {!Array.<number>} color The color expected. A 4 element array where
 1270 * each element is in the range 0 to 255.
 1271 * @param {string} msg Message to associate with success. Eg ("should be red").
 1272 * @param {number} errorRange Optional. Acceptable error in
 1273 * color checking. 0 by default.
 1274 */
 1275var checkCanvas = function(gl, color, msg, errorRange) {
 1276 checkCanvasRect(gl, 0, 0, gl.canvas.width, gl.canvas.height, color, msg, errorRange);
 1277};
 1278
 1279/**
 1280 * Checks a rectangular area both inside the area and outside
 1281 * the area.
 1282 * @param {!WebGLRenderingContext|CanvasRenderingContext2D} gl The
 1283 * WebGLRenderingContext or 2D context to use.
 1284 * @param {number} x left corner of region to check.
 1285 * @param {number} y bottom corner of region to check in case of checking from
 1286 * a GL context or top corner in case of checking from a 2D context.
 1287 * @param {number} width width of region to check.
 1288 * @param {number} height width of region to check.
 1289 * @param {!Array.<number>} innerColor The color expected inside
 1290 * the area. A 4 element array where each element is in the
 1291 * range 0 to 255.
 1292 * @param {!Array.<number>} outerColor The color expected
 1293 * outside. A 4 element array where each element is in the
 1294 * range 0 to 255.
 1295 * @param {!number} opt_edgeSize: The number of pixels to skip
 1296 * around the edges of the area. Defaut 0.
 1297 * @param {!{width:number, height:number}} opt_outerDimensions
 1298 * The outer dimensions. Default the size of gl.canvas.
 1299 */
 1300var checkAreaInAndOut = function(gl, x, y, width, height, innerColor, outerColor, opt_edgeSize, opt_outerDimensions) {
 1301 var outerDimensions = opt_outerDimensions || { width: gl.canvas.width, height: gl.canvas.height };
 1302 var edgeSize = opt_edgeSize || 0;
 1303 checkCanvasRect(gl, x + edgeSize, y + edgeSize, width - edgeSize * 2, height - edgeSize * 2, innerColor);
 1304 checkCanvasRect(gl, 0, 0, x - edgeSize, outerDimensions.height, outerColor);
 1305 checkCanvasRect(gl, x + width + edgeSize, 0, outerDimensions.width - x - width - edgeSize, outerDimensions.height, outerColor);
 1306 checkCanvasRect(gl, 0, 0, outerDimensions.width, y - edgeSize, outerColor);
 1307 checkCanvasRect(gl, 0, y + height + edgeSize, outerDimensions.width, outerDimensions.height - y - height - edgeSize, outerColor);
 1308};
 1309
 1310/**
 1311 * Checks that an entire buffer matches the floating point values provided.
 1312 * (WebGL 2.0 only)
 1313 * @param {!WebGL2RenderingContext} gl The WebGL2RenderingContext to use.
 1314 * @param {number} target The buffer target to bind to.
 1315 * @param {!Array.<number>} expected The values expected.
 1316 * @param {string} opt_msg Optional. Message to associate with success. Eg ("should be red").
 1317 * @param {number} opt_errorRange Optional. Acceptable error in value checking. 0.001 by default.
 1318 */
 1319var checkFloatBuffer = function(gl, target, expected, opt_msg, opt_errorRange) {
 1320 if (opt_msg === undefined)
 1321 opt_msg = "buffer should match expected values";
 1322
 1323 if (opt_errorRange === undefined)
 1324 opt_errorRange = 0.001;
 1325
 1326 var floatArray = new Float32Array(expected.length);
 1327 gl.getBufferSubData(target, 0, floatArray);
 1328
 1329 for (var i = 0; i < expected.length; i++) {
 1330 if (Math.abs(floatArray[i] - expected[i]) > opt_errorRange) {
 1331 testFailed(opt_msg);
 1332 debug('at [' + i + '] expected: ' + expected[i] + ' was ' + floatArray[i]);
 1333 return;
 1334 }
 1335 }
 1336 testPassed(opt_msg);
 1337};
 1338
 1339/**
 1340 * Loads a texture, calls callback when finished.
 1341 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 1342 * @param {string} url URL of image to load
 1343 * @param {function(!Image): void} callback Function that gets called after
 1344 * image has loaded
 1345 * @return {!WebGLTexture} The created texture.
 1346 */
 1347var loadTexture = function(gl, url, callback) {
 1348 var texture = gl.createTexture();
 1349 gl.bindTexture(gl.TEXTURE_2D, texture);
 1350 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
 1351 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
 1352 var image = new Image();
 1353 image.onload = function() {
 1354 gl.bindTexture(gl.TEXTURE_2D, texture);
 1355 gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
 1356 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
 1357 callback(image);
 1358 };
 1359 image.src = url;
 1360 return texture;
 1361};
 1362
 1363/**
 1364 * Checks whether the bound texture has expected dimensions. One corner pixel
 1365 * of the texture will be changed as a side effect.
 1366 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 1367 * @param {!WebGLTexture} texture The texture to check.
 1368 * @param {number} width Expected width.
 1369 * @param {number} height Expected height.
 1370 * @param {GLenum} opt_format The texture's format. Defaults to RGBA.
 1371 * @param {GLenum} opt_type The texture's type. Defaults to UNSIGNED_BYTE.
 1372 */
 1373var checkTextureSize = function(gl, width, height, opt_format, opt_type) {
 1374 opt_format = opt_format || gl.RGBA;
 1375 opt_type = opt_type || gl.UNSIGNED_BYTE;
 1376
 1377 var numElements = getTypedArrayElementsPerPixel(gl, opt_format, opt_type);
 1378 var buf = new (glTypeToTypedArrayType(gl, opt_type))(numElements);
 1379
 1380 var errors = 0;
 1381 gl.texSubImage2D(gl.TEXTURE_2D, 0, width - 1, height - 1, 1, 1, opt_format, opt_type, buf);
 1382 if (gl.getError() != gl.NO_ERROR) {
 1383 testFailed("Texture was smaller than the expected size " + width + "x" + height);
 1384 ++errors;
 1385 }
 1386 gl.texSubImage2D(gl.TEXTURE_2D, 0, width - 1, height, 1, 1, opt_format, opt_type, buf);
 1387 if (gl.getError() == gl.NO_ERROR) {
 1388 testFailed("Texture was taller than " + height);
 1389 ++errors;
 1390 }
 1391 gl.texSubImage2D(gl.TEXTURE_2D, 0, width, height - 1, 1, 1, opt_format, opt_type, buf);
 1392 if (gl.getError() == gl.NO_ERROR) {
 1393 testFailed("Texture was wider than " + width);
 1394 ++errors;
 1395 }
 1396 if (errors == 0) {
 1397 testPassed("Texture had the expected size " + width + "x" + height);
 1398 }
 1399};
 1400
 1401/**
 1402 * Makes a shallow copy of an object.
 1403 * @param {!Object} src Object to copy
 1404 * @return {!Object} The copy of src.
 1405 */
 1406var shallowCopyObject = function(src) {
 1407 var dst = {};
 1408 for (var attr in src) {
 1409 if (src.hasOwnProperty(attr)) {
 1410 dst[attr] = src[attr];
 1411 }
 1412 }
 1413 return dst;
 1414};
 1415
 1416/**
 1417 * Checks if an attribute exists on an object case insensitive.
 1418 * @param {!Object} obj Object to check
 1419 * @param {string} attr Name of attribute to look for.
 1420 * @return {string?} The name of the attribute if it exists,
 1421 * undefined if not.
 1422 */
 1423var hasAttributeCaseInsensitive = function(obj, attr) {
 1424 var lower = attr.toLowerCase();
 1425 for (var key in obj) {
 1426 if (obj.hasOwnProperty(key) && key.toLowerCase() == lower) {
 1427 return key;
 1428 }
 1429 }
 1430};
 1431
 1432/**
 1433 * Returns a map of URL querystring options
 1434 * @return {Object?} Object containing all the values in the URL querystring
 1435 */
 1436var getUrlOptions = (function() {
 1437 var _urlOptionsParsed = false;
 1438 var _urlOptions = {};
 1439 return function() {
 1440 if (!_urlOptionsParsed) {
 1441 var s = window.location.href;
 1442 var q = s.indexOf("?");
 1443 var e = s.indexOf("#");
 1444 if (e < 0) {
 1445 e = s.length;
 1446 }
 1447 var query = s.substring(q + 1, e);
 1448 var pairs = query.split("&");
 1449 for (var ii = 0; ii < pairs.length; ++ii) {
 1450 var keyValue = pairs[ii].split("=");
 1451 var key = keyValue[0];
 1452 var value = decodeURIComponent(keyValue[1]);
 1453 _urlOptions[key] = value;
 1454 }
 1455 _urlOptionsParsed = true;
 1456 }
 1457
 1458 return _urlOptions;
 1459 }
 1460})();
 1461
 1462var default3DContextVersion = 1;
 1463
 1464/**
 1465 * Set the default context version for create3DContext.
 1466 * Initially the default version is 1.
 1467 * @param {number} Default version of WebGL contexts.
 1468 */
 1469var setDefault3DContextVersion = function(version) {
 1470 default3DContextVersion = version;
 1471};
 1472
 1473/**
 1474 * Get the default contex version for create3DContext.
 1475 * First it looks at the URI option |webglVersion|. If it does not exist,
 1476 * then look at the global default3DContextVersion variable.
 1477 */
 1478var getDefault3DContextVersion = function() {
 1479 return parseInt(getUrlOptions().webglVersion, 10) || default3DContextVersion;
 1480};
 1481
 1482/**
 1483 * Creates a webgl context.
 1484 * @param {!Canvas|string} opt_canvas The canvas tag to get
 1485 * context from. If one is not passed in one will be
 1486 * created. If it's a string it's assumed to be the id of a
 1487 * canvas.
 1488 * @param {Object} opt_attributes Context attributes.
 1489 * @param {!number} opt_version Version of WebGL context to create.
 1490 * The default version can be set by calling setDefault3DContextVersion.
 1491 * @return {!WebGLRenderingContext} The created context.
 1492 */
 1493var create3DContext = function(opt_canvas, opt_attributes, opt_version) {
 1494 if (window.initTestingHarness) {
 1495 window.initTestingHarness();
 1496 }
 1497 var attributes = shallowCopyObject(opt_attributes || {});
 1498 if (!hasAttributeCaseInsensitive(attributes, "antialias")) {
 1499 attributes.antialias = false;
 1500 }
 1501 if (!opt_version) {
 1502 opt_version = parseInt(getUrlOptions().webglVersion, 10) || default3DContextVersion;
 1503 }
 1504 opt_canvas = opt_canvas || document.createElement("canvas");
 1505 if (typeof opt_canvas == 'string') {
 1506 opt_canvas = document.getElementById(opt_canvas);
 1507 }
 1508 var context = null;
 1509
 1510 var names;
 1511 switch (opt_version) {
 1512 case 2:
 1513 names = ["webgl2"]; break;
 1514 default:
 1515 names = ["webgl", "experimental-webgl"]; break;
 1516 }
 1517
 1518 for (var i = 0; i < names.length; ++i) {
 1519 try {
 1520 context = opt_canvas.getContext(names[i], attributes);
 1521 } catch (e) {
 1522 }
 1523 if (context) {
 1524 break;
 1525 }
 1526 }
 1527 if (!context) {
 1528 testFailed("Unable to fetch WebGL rendering context for Canvas");
 1529 }
 1530 return context;
 1531};
 1532
 1533/**
 1534 * Defines the exception type for a GL error.
 1535 * @constructor
 1536 * @param {string} message The error message.
 1537 * @param {number} error GL error code
 1538 */
 1539function GLErrorException (message, error) {
 1540 this.message = message;
 1541 this.name = "GLErrorException";
 1542 this.error = error;
 1543};
 1544
 1545/**
 1546 * Wraps a WebGL function with a function that throws an exception if there is
 1547 * an error.
 1548 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 1549 * @param {string} fname Name of function to wrap.
 1550 * @return {function()} The wrapped function.
 1551 */
 1552var createGLErrorWrapper = function(context, fname) {
 1553 return function() {
 1554 var rv = context[fname].apply(context, arguments);
 1555 var err = context.getError();
 1556 if (err != context.NO_ERROR) {
 1557 var msg = "GL error " + glEnumToString(context, err) + " in " + fname;
 1558 throw new GLErrorException(msg, err);
 1559 }
 1560 return rv;
 1561 };
 1562};
 1563
 1564/**
 1565 * Creates a WebGL context where all functions are wrapped to throw an exception
 1566 * if there is an error.
 1567 * @param {!Canvas} canvas The HTML canvas to get a context from.
 1568 * @param {Object} opt_attributes Context attributes.
 1569 * @param {!number} opt_version Version of WebGL context to create
 1570 * @return {!Object} The wrapped context.
 1571 */
 1572function create3DContextWithWrapperThatThrowsOnGLError(canvas, opt_attributes, opt_version) {
 1573 var context = create3DContext(canvas, opt_attributes, opt_version);
 1574 var wrap = {};
 1575 for (var i in context) {
 1576 try {
 1577 if (typeof context[i] == 'function') {
 1578 wrap[i] = createGLErrorWrapper(context, i);
 1579 } else {
 1580 wrap[i] = context[i];
 1581 }
 1582 } catch (e) {
 1583 error("createContextWrapperThatThrowsOnGLError: Error accessing " + i);
 1584 }
 1585 }
 1586 wrap.getError = function() {
 1587 return context.getError();
 1588 };
 1589 return wrap;
 1590};
 1591
 1592/**
 1593 * Tests that an evaluated expression generates a specific GL error.
 1594 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 1595 * @param {number|Array.<number>} glErrors The expected gl error or an array of expected errors.
 1596 * @param {string} evalStr The string to evaluate.
 1597 */
 1598var shouldGenerateGLError = function(gl, glErrors, evalStr, opt_msg) {
 1599 var exception;
 1600 try {
 1601 eval(evalStr);
 1602 } catch (e) {
 1603 exception = e;
 1604 }
 1605 if (exception) {
 1606 testFailed(evalStr + " threw exception " + exception);
 1607 return -1;
 1608 } else {
 1609 if (!opt_msg) {
 1610 opt_msg = "after evaluating: " + evalStr;
 1611 }
 1612 return glErrorShouldBe(gl, glErrors, opt_msg);
 1613 }
 1614};
 1615
 1616/**
 1617 * Tests that an evaluated expression does not generate a GL error.
 1618 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 1619 * @param {string} evalStr The string to evaluate.
 1620 */
 1621var failIfGLError = function(gl, evalStr) {
 1622 var exception;
 1623 try {
 1624 eval(evalStr);
 1625 } catch (e) {
 1626 exception = e;
 1627 }
 1628 if (exception) {
 1629 testFailed(evalStr + " threw exception " + exception);
 1630 } else {
 1631 glErrorShouldBeImpl(gl, gl.NO_ERROR, false, "after evaluating: " + evalStr);
 1632 }
 1633};
 1634
 1635/**
 1636 * Tests that the first error GL returns is the specified error.
 1637 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 1638 * @param {number|Array.<number>} glErrors The expected gl error or an array of expected errors.
 1639 * @param {string} opt_msg Optional additional message.
 1640 */
 1641var glErrorShouldBe = function(gl, glErrors, opt_msg) {
 1642 return glErrorShouldBeImpl(gl, glErrors, true, opt_msg);
 1643};
 1644
 1645
 1646
 1647/**
 1648 * Tests that the first error GL returns is the specified error. Allows suppression of successes.
 1649 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 1650 * @param {number|Array.<number>} glErrors The expected gl error or an array of expected errors.
 1651 * @param {boolean} reportSuccesses Whether to report successes as passes, or to silently pass.
 1652 * @param {string} opt_msg Optional additional message.
 1653 */
 1654var glErrorShouldBeImpl = function(gl, glErrors, reportSuccesses, opt_msg) {
 1655 if (!glErrors.length) {
 1656 glErrors = [glErrors];
 1657 }
 1658 opt_msg = opt_msg || "";
 1659 var err = gl.getError();
 1660 var ndx = glErrors.indexOf(err);
 1661 var errStrs = [];
 1662 for (var ii = 0; ii < glErrors.length; ++ii) {
 1663 errStrs.push(glEnumToString(gl, glErrors[ii]));
 1664 }
 1665 var expected = errStrs.join(" or ");
 1666 if (ndx < 0) {
 1667 var msg = "getError expected" + ((glErrors.length > 1) ? " one of: " : ": ");
 1668 testFailed(msg + expected + ". Was " + glEnumToString(gl, err) + " : " + opt_msg);
 1669 } else if (reportSuccesses) {
 1670 var msg = "getError was " + ((glErrors.length > 1) ? "one of: " : "expected value: ");
 1671 testPassed(msg + expected + " : " + opt_msg);
 1672 }
 1673 return err;
 1674};
 1675
 1676/**
 1677 * Links a WebGL program, throws if there are errors.
 1678 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 1679 * @param {!WebGLProgram} program The WebGLProgram to link.
 1680 * @param {function(string): void} opt_errorCallback callback for errors.
 1681 */
 1682var linkProgram = function(gl, program, opt_errorCallback) {
 1683 var errFn = opt_errorCallback || testFailed;
 1684 // Link the program
 1685 gl.linkProgram(program);
 1686
 1687 // Check the link status
 1688 var linked = gl.getProgramParameter(program, gl.LINK_STATUS);
 1689 if (!linked) {
 1690 // something went wrong with the link
 1691 var error = gl.getProgramInfoLog (program);
 1692
 1693 errFn("Error in program linking:" + error);
 1694
 1695 gl.deleteProgram(program);
 1696 }
 1697};
 1698
 1699/**
 1700 * Loads text from an external file. This function is asynchronous.
 1701 * @param {string} url The url of the external file.
 1702 * @param {!function(bool, string): void} callback that is sent a bool for
 1703 * success and the string.
 1704 */
 1705var loadTextFileAsync = function(url, callback) {
 1706 log ("loading: " + url);
 1707 var error = 'loadTextFileAsync failed to load url "' + url + '"';
 1708 var request;
 1709 if (window.XMLHttpRequest) {
 1710 request = new XMLHttpRequest();
 1711 if (request.overrideMimeType) {
 1712 request.overrideMimeType('text/plain');
 1713 }
 1714 } else {
 1715 throw 'XMLHttpRequest is disabled';
 1716 }
 1717 try {
 1718 request.open('GET', url, true);
 1719 request.onreadystatechange = function() {
 1720 if (request.readyState == 4) {
 1721 var text = '';
 1722 // HTTP reports success with a 200 status. The file protocol reports
 1723 // success with zero. HTTP does not use zero as a status code (they
 1724 // start at 100).
 1725 // https://developer.mozilla.org/En/Using_XMLHttpRequest
 1726 var success = request.status == 200 || request.status == 0;
 1727 if (success) {
 1728 text = request.responseText;
 1729 log("completed load request: " + url);
 1730 } else {
 1731 log("loading " + url + " resulted in unexpected status: " + request.status + " " + request.statusText);
 1732 }
 1733 callback(success, text);
 1734 }
 1735 };
 1736 request.onerror = function(errorEvent) {
 1737 log("error occurred loading " + url);
 1738 callback(false, '');
 1739 };
 1740 request.send(null);
 1741 } catch (err) {
 1742 log("failed to load: " + url + " with exception " + err.message);
 1743 callback(false, '');
 1744 }
 1745};
 1746
 1747/**
 1748 * Recursively loads a file as a list. Each line is parsed for a relative
 1749 * path. If the file ends in .txt the contents of that file is inserted in
 1750 * the list.
 1751 *
 1752 * @param {string} url The url of the external file.
 1753 * @param {!function(bool, Array<string>): void} callback that is sent a bool
 1754 * for success and the array of strings.
 1755 */
 1756var getFileListAsync = function(url, callback) {
 1757 var files = [];
 1758
 1759 var getFileListImpl = function(url, callback) {
 1760 var files = [];
 1761 if (url.substr(url.length - 4) == '.txt') {
 1762 loadTextFileAsync(url, function() {
 1763 return function(success, text) {
 1764 if (!success) {
 1765 callback(false, '');
 1766 return;
 1767 }
 1768 var lines = text.split('\n');
 1769 var prefix = '';
 1770 var lastSlash = url.lastIndexOf('/');
 1771 if (lastSlash >= 0) {
 1772 prefix = url.substr(0, lastSlash + 1);
 1773 }
 1774 var fail = false;
 1775 var count = 1;
 1776 var index = 0;
 1777 for (var ii = 0; ii < lines.length; ++ii) {
 1778 var str = lines[ii].replace(/^\s\s*/, '').replace(/\s\s*$/, '');
 1779 if (str.length > 4 &&
 1780 str[0] != '#' &&
 1781 str[0] != ";" &&
 1782 str.substr(0, 2) != "//") {
 1783 var names = str.split(/ +/);
 1784 var new_url = prefix + str;
 1785 if (names.length == 1) {
 1786 new_url = prefix + str;
 1787 ++count;
 1788 getFileListImpl(new_url, function(index) {
 1789 return function(success, new_files) {
 1790 log("got files: " + new_files.length);
 1791 if (success) {
 1792 files[index] = new_files;
 1793 }
 1794 finish(success);
 1795 };
 1796 }(index++));
 1797 } else {
 1798 var s = "";
 1799 var p = "";
 1800 for (var jj = 0; jj < names.length; ++jj) {
 1801 s += p + prefix + names[jj];
 1802 p = " ";
 1803 }
 1804 files[index++] = s;
 1805 }
 1806 }
 1807 }
 1808 finish(true);
 1809
 1810 function finish(success) {
 1811 if (!success) {
 1812 fail = true;
 1813 }
 1814 --count;
 1815 log("count: " + count);
 1816 if (!count) {
 1817 callback(!fail, files);
 1818 }
 1819 }
 1820 }
 1821 }());
 1822
 1823 } else {
 1824 files.push(url);
 1825 callback(true, files);
 1826 }
 1827 };
 1828
 1829 getFileListImpl(url, function(success, files) {
 1830 // flatten
 1831 var flat = [];
 1832 flatten(files);
 1833 function flatten(files) {
 1834 for (var ii = 0; ii < files.length; ++ii) {
 1835 var value = files[ii];
 1836 if (typeof(value) == "string") {
 1837 flat.push(value);
 1838 } else {
 1839 flatten(value);
 1840 }
 1841 }
 1842 }
 1843 callback(success, flat);
 1844 });
 1845};
 1846
 1847/**
 1848 * Gets a file from a file/URL.
 1849 * @param {string} file the URL of the file to get.
 1850 * @return {string} The contents of the file.
 1851 */
 1852var readFile = function(file) {
 1853 var xhr = new XMLHttpRequest();
 1854 xhr.open("GET", file, false);
 1855 xhr.overrideMimeType("text/plain");
 1856 xhr.send();
 1857 return xhr.responseText.replace(/\r/g, "");
 1858};
 1859
 1860var readFileList = function(url) {
 1861 var files = [];
 1862 if (url.substr(url.length - 4) == '.txt') {
 1863 var lines = readFile(url).split('\n');
 1864 var prefix = '';
 1865 var lastSlash = url.lastIndexOf('/');
 1866 if (lastSlash >= 0) {
 1867 prefix = url.substr(0, lastSlash + 1);
 1868 }
 1869 for (var ii = 0; ii < lines.length; ++ii) {
 1870 var str = lines[ii].replace(/^\s\s*/, '').replace(/\s\s*$/, '');
 1871 if (str.length > 4 &&
 1872 str[0] != '#' &&
 1873 str[0] != ";" &&
 1874 str.substr(0, 2) != "//") {
 1875 var names = str.split(/ +/);
 1876 if (names.length == 1) {
 1877 var new_url = prefix + str;
 1878 files = files.concat(readFileList(new_url));
 1879 } else {
 1880 var s = "";
 1881 var p = "";
 1882 for (var jj = 0; jj < names.length; ++jj) {
 1883 s += p + prefix + names[jj];
 1884 p = " ";
 1885 }
 1886 files.push(s);
 1887 }
 1888 }
 1889 }
 1890 } else {
 1891 files.push(url);
 1892 }
 1893 return files;
 1894};
 1895
 1896/**
 1897 * Loads a shader.
 1898 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 1899 * @param {string} shaderSource The shader source.
 1900 * @param {number} shaderType The type of shader.
 1901 * @param {function(string): void} opt_errorCallback callback for errors.
 1902 * @param {boolean} opt_logShaders Whether to log shader source.
 1903 * @param {string} opt_shaderLabel Label that identifies the shader source in
 1904 * the log.
 1905 * @param {string} opt_url URL from where the shader source was loaded from.
 1906 * If opt_logShaders is set, then a link to the source file will also be
 1907 * added.
 1908 * @param {boolean} Skip compilation status check. Default = false.
 1909 * @return {!WebGLShader} The created shader.
 1910 */
 1911var loadShader = function(
 1912 gl, shaderSource, shaderType, opt_errorCallback, opt_logShaders,
 1913 opt_shaderLabel, opt_url, opt_skipCompileStatus) {
 1914 var errFn = opt_errorCallback || error;
 1915 // Create the shader object
 1916 var shader = gl.createShader(shaderType);
 1917 if (shader == null) {
 1918 errFn("*** Error: unable to create shader '"+shaderSource+"'");
 1919 return null;
 1920 }
 1921
 1922 // Load the shader source
 1923 gl.shaderSource(shader, shaderSource);
 1924
 1925 // Compile the shader
 1926 gl.compileShader(shader);
 1927
 1928 if (opt_logShaders) {
 1929 var label = shaderType == gl.VERTEX_SHADER ? 'vertex shader' : 'fragment_shader';
 1930 if (opt_shaderLabel) {
 1931 label = opt_shaderLabel + ' ' + label;
 1932 }
 1933 addShaderSources(
 1934 gl, document.getElementById('console'), label, shader, shaderSource, opt_url);
 1935 }
 1936
 1937 // Check the compile status
 1938 if (!opt_skipCompileStatus) {
 1939 var compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);
 1940 if (!compiled) {
 1941 // Something went wrong during compilation; get the error
 1942 lastError = gl.getShaderInfoLog(shader);
 1943 errFn("*** Error compiling " + glEnumToString(gl, shaderType) + " '" + shader + "':" + lastError);
 1944 gl.deleteShader(shader);
 1945 return null;
 1946 }
 1947 }
 1948
 1949 return shader;
 1950}
 1951
 1952/**
 1953 * Loads a shader from a URL.
 1954 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 1955 * @param {file} file The URL of the shader source.
 1956 * @param {number} type The type of shader.
 1957 * @param {function(string): void} opt_errorCallback callback for errors.
 1958 * @param {boolean} opt_logShaders Whether to log shader source.
 1959 * @param {boolean} Skip compilation status check. Default = false.
 1960 * @return {!WebGLShader} The created shader.
 1961 */
 1962var loadShaderFromFile = function(
 1963 gl, file, type, opt_errorCallback, opt_logShaders, opt_skipCompileStatus) {
 1964 var shaderSource = readFile(file);
 1965 return loadShader(gl, shaderSource, type, opt_errorCallback,
 1966 opt_logShaders, undefined, file, opt_skipCompileStatus);
 1967};
 1968
 1969var loadShaderFromFileAsync = function(
 1970 gl, file, type, opt_errorCallback, opt_logShaders, opt_skipCompileStatus, callback) {
 1971 loadTextFileAsync(file, function(gl, type, opt_errorCallback, opt_logShaders, file, opt_skipCompileStatus){
 1972 return function(success, shaderSource) {
 1973 if (success) {
 1974 var shader = loadShader(gl, shaderSource, type, opt_errorCallback,
 1975 opt_logShaders, undefined, file, opt_skipCompileStatus);
 1976 callback(true, shader);
 1977 } else {
 1978 callback(false, null);
 1979 }
 1980 }
 1981 }(gl, type, opt_errorCallback, opt_logShaders, file, opt_skipCompileStatus));
 1982};
 1983
 1984/**
 1985 * Gets the content of script.
 1986 * @param {string} scriptId The id of the script tag.
 1987 * @return {string} The content of the script.
 1988 */
 1989var getScript = function(scriptId) {
 1990 var shaderScript = document.getElementById(scriptId);
 1991 if (!shaderScript) {
 1992 throw("*** Error: unknown script element " + scriptId);
 1993 }
 1994 return shaderScript.text;
 1995};
 1996
 1997/**
 1998 * Loads a shader from a script tag.
 1999 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 2000 * @param {string} scriptId The id of the script tag.
 2001 * @param {number} opt_shaderType The type of shader. If not passed in it will
 2002 * be derived from the type of the script tag.
 2003 * @param {function(string): void} opt_errorCallback callback for errors.
 2004 * @param {boolean} opt_logShaders Whether to log shader source.
 2005 * @param {boolean} Skip compilation status check. Default = false.
 2006 * @return {!WebGLShader} The created shader.
 2007 */
 2008var loadShaderFromScript = function(
 2009 gl, scriptId, opt_shaderType, opt_errorCallback, opt_logShaders, opt_skipCompileStatus) {
 2010 var shaderSource = "";
 2011 var shaderScript = document.getElementById(scriptId);
 2012 if (!shaderScript) {
 2013 throw("*** Error: unknown script element " + scriptId);
 2014 }
 2015 shaderSource = shaderScript.text;
 2016
 2017 if (!opt_shaderType) {
 2018 if (shaderScript.type == "x-shader/x-vertex") {
 2019 opt_shaderType = gl.VERTEX_SHADER;
 2020 } else if (shaderScript.type == "x-shader/x-fragment") {
 2021 opt_shaderType = gl.FRAGMENT_SHADER;
 2022 } else {
 2023 throw("*** Error: unknown shader type");
 2024 return null;
 2025 }
 2026 }
 2027
 2028 return loadShader(gl, shaderSource, opt_shaderType, opt_errorCallback,
 2029 opt_logShaders, undefined, undefined, opt_skipCompileStatus);
 2030};
 2031
 2032var loadStandardProgram = function(gl) {
 2033 var program = gl.createProgram();
 2034 gl.attachShader(program, loadStandardVertexShader(gl));
 2035 gl.attachShader(program, loadStandardFragmentShader(gl));
 2036 gl.bindAttribLocation(program, 0, "a_vertex");
 2037 gl.bindAttribLocation(program, 1, "a_normal");
 2038 linkProgram(gl, program);
 2039 return program;
 2040};
 2041
 2042var loadStandardProgramAsync = function(gl, callback) {
 2043 loadStandardVertexShaderAsync(gl, function(gl) {
 2044 return function(success, vs) {
 2045 if (success) {
 2046 loadStandardFragmentShaderAsync(gl, function(vs) {
 2047 return function(success, fs) {
 2048 if (success) {
 2049 var program = gl.createProgram();
 2050 gl.attachShader(program, vs);
 2051 gl.attachShader(program, fs);
 2052 gl.bindAttribLocation(program, 0, "a_vertex");
 2053 gl.bindAttribLocation(program, 1, "a_normal");
 2054 linkProgram(gl, program);
 2055 callback(true, program);
 2056 } else {
 2057 callback(false, null);
 2058 }
 2059 };
 2060 }(vs));
 2061 } else {
 2062 callback(false, null);
 2063 }
 2064 };
 2065 }(gl));
 2066};
 2067
 2068/**
 2069 * Loads shaders from files, creates a program, attaches the shaders and links.
 2070 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 2071 * @param {string} vertexShaderPath The URL of the vertex shader.
 2072 * @param {string} fragmentShaderPath The URL of the fragment shader.
 2073 * @param {function(string): void} opt_errorCallback callback for errors.
 2074 * @return {!WebGLProgram} The created program.
 2075 */
 2076var loadProgramFromFile = function(
 2077 gl, vertexShaderPath, fragmentShaderPath, opt_errorCallback) {
 2078 var program = gl.createProgram();
 2079 var vs = loadShaderFromFile(
 2080 gl, vertexShaderPath, gl.VERTEX_SHADER, opt_errorCallback);
 2081 var fs = loadShaderFromFile(
 2082 gl, fragmentShaderPath, gl.FRAGMENT_SHADER, opt_errorCallback);
 2083 if (vs && fs) {
 2084 gl.attachShader(program, vs);
 2085 gl.attachShader(program, fs);
 2086 linkProgram(gl, program, opt_errorCallback);
 2087 }
 2088 if (vs) {
 2089 gl.deleteShader(vs);
 2090 }
 2091 if (fs) {
 2092 gl.deleteShader(fs);
 2093 }
 2094 return program;
 2095};
 2096
 2097/**
 2098 * Loads shaders from script tags, creates a program, attaches the shaders and
 2099 * links.
 2100 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 2101 * @param {string} vertexScriptId The id of the script tag that contains the
 2102 * vertex shader.
 2103 * @param {string} fragmentScriptId The id of the script tag that contains the
 2104 * fragment shader.
 2105 * @param {function(string): void} opt_errorCallback callback for errors.
 2106 * @return {!WebGLProgram} The created program.
 2107 */
 2108var loadProgramFromScript = function loadProgramFromScript(
 2109 gl, vertexScriptId, fragmentScriptId, opt_errorCallback) {
 2110 var program = gl.createProgram();
 2111 gl.attachShader(
 2112 program,
 2113 loadShaderFromScript(
 2114 gl, vertexScriptId, gl.VERTEX_SHADER, opt_errorCallback));
 2115 gl.attachShader(
 2116 program,
 2117 loadShaderFromScript(
 2118 gl, fragmentScriptId, gl.FRAGMENT_SHADER, opt_errorCallback));
 2119 linkProgram(gl, program, opt_errorCallback);
 2120 return program;
 2121};
 2122
 2123/**
 2124 * Loads shaders from source, creates a program, attaches the shaders and
 2125 * links.
 2126 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 2127 * @param {!WebGLShader} vertexShader The vertex shader.
 2128 * @param {!WebGLShader} fragmentShader The fragment shader.
 2129 * @param {function(string): void} opt_errorCallback callback for errors.
 2130 * @return {!WebGLProgram} The created program.
 2131 */
 2132var createProgram = function(gl, vertexShader, fragmentShader, opt_errorCallback) {
 2133 var program = gl.createProgram();
 2134 gl.attachShader(program, vertexShader);
 2135 gl.attachShader(program, fragmentShader);
 2136 linkProgram(gl, program, opt_errorCallback);
 2137 return program;
 2138};
 2139
 2140/**
 2141 * Loads shaders from source, creates a program, attaches the shaders and
 2142 * links.
 2143 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 2144 * @param {string} vertexShader The vertex shader source.
 2145 * @param {string} fragmentShader The fragment shader source.
 2146 * @param {function(string): void} opt_errorCallback callback for errors.
 2147 * @param {boolean} opt_logShaders Whether to log shader source.
 2148 * @return {!WebGLProgram} The created program.
 2149 */
 2150var loadProgram = function(
 2151 gl, vertexShader, fragmentShader, opt_errorCallback, opt_logShaders) {
 2152 var program;
 2153 var vs = loadShader(
 2154 gl, vertexShader, gl.VERTEX_SHADER, opt_errorCallback, opt_logShaders);
 2155 var fs = loadShader(
 2156 gl, fragmentShader, gl.FRAGMENT_SHADER, opt_errorCallback, opt_logShaders);
 2157 if (vs && fs) {
 2158 program = createProgram(gl, vs, fs, opt_errorCallback)
 2159 }
 2160 if (vs) {
 2161 gl.deleteShader(vs);
 2162 }
 2163 if (fs) {
 2164 gl.deleteShader(fs);
 2165 }
 2166 return program;
 2167};
 2168
 2169/**
 2170 * Loads shaders from source, creates a program, attaches the shaders and
 2171 * links but expects error.
 2172 *
 2173 * GLSL 1.0.17 10.27 effectively says that compileShader can
 2174 * always succeed as long as linkProgram fails so we can't
 2175 * rely on compileShader failing. This function expects
 2176 * one of the shader to fail OR linking to fail.
 2177 *
 2178 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 2179 * @param {string} vertexShaderScriptId The vertex shader.
 2180 * @param {string} fragmentShaderScriptId The fragment shader.
 2181 * @return {WebGLProgram} The created program.
 2182 */
 2183var loadProgramFromScriptExpectError = function(
 2184 gl, vertexShaderScriptId, fragmentShaderScriptId) {
 2185 var vertexShader = loadShaderFromScript(gl, vertexShaderScriptId);
 2186 if (!vertexShader) {
 2187 return null;
 2188 }
 2189 var fragmentShader = loadShaderFromScript(gl, fragmentShaderScriptId);
 2190 if (!fragmentShader) {
 2191 return null;
 2192 }
 2193 var linkSuccess = true;
 2194 var program = gl.createProgram();
 2195 gl.attachShader(program, vertexShader);
 2196 gl.attachShader(program, fragmentShader);
 2197 linkSuccess = true;
 2198 linkProgram(gl, program, function() {
 2199 linkSuccess = false;
 2200 });
 2201 return linkSuccess ? program : null;
 2202};
 2203
 2204
 2205var getActiveMap = function(gl, program, typeInfo) {
 2206 var numVariables = gl.getProgramParameter(program, gl[typeInfo.param]);
 2207 var variables = {};
 2208 for (var ii = 0; ii < numVariables; ++ii) {
 2209 var info = gl[typeInfo.activeFn](program, ii);
 2210 variables[info.name] = {
 2211 name: info.name,
 2212 size: info.size,
 2213 type: info.type,
 2214 location: gl[typeInfo.locFn](program, info.name)
 2215 };
 2216 }
 2217 return variables;
 2218};
 2219
 2220/**
 2221 * Returns a map of attrib names to info about those
 2222 * attribs.
 2223 *
 2224 * eg:
 2225 * { "attrib1Name":
 2226 * {
 2227 * name: "attrib1Name",
 2228 * size: 1,
 2229 * type: gl.FLOAT_MAT2,
 2230 * location: 0
 2231 * },
 2232 * "attrib2Name[0]":
 2233 * {
 2234 * name: "attrib2Name[0]",
 2235 * size: 4,
 2236 * type: gl.FLOAT,
 2237 * location: 1
 2238 * },
 2239 * }
 2240 *
 2241 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 2242 * @param {WebGLProgram} The program to query for attribs.
 2243 * @return the map.
 2244 */
 2245var getAttribMap = function(gl, program) {
 2246 return getActiveMap(gl, program, {
 2247 param: "ACTIVE_ATTRIBUTES",
 2248 activeFn: "getActiveAttrib",
 2249 locFn: "getAttribLocation"
 2250 });
 2251};
 2252
 2253/**
 2254 * Returns a map of uniform names to info about those uniforms.
 2255 *
 2256 * eg:
 2257 * { "uniform1Name":
 2258 * {
 2259 * name: "uniform1Name",
 2260 * size: 1,
 2261 * type: gl.FLOAT_MAT2,
 2262 * location: WebGLUniformLocation
 2263 * },
 2264 * "uniform2Name[0]":
 2265 * {
 2266 * name: "uniform2Name[0]",
 2267 * size: 4,
 2268 * type: gl.FLOAT,
 2269 * location: WebGLUniformLocation
 2270 * },
 2271 * }
 2272 *
 2273 * @param {!WebGLRenderingContext} gl The WebGLRenderingContext to use.
 2274 * @param {WebGLProgram} The program to query for uniforms.
 2275 * @return the map.
 2276 */
 2277var getUniformMap = function(gl, program) {
 2278 return getActiveMap(gl, program, {
 2279 param: "ACTIVE_UNIFORMS",
 2280 activeFn: "getActiveUniform",
 2281 locFn: "getUniformLocation"
 2282 });
 2283};
 2284
 2285var basePath;
 2286var getResourcePath = function() {
 2287 if (!basePath) {
 2288 var expectedBase = "js/webgl-test-utils.js";
 2289 var scripts = document.getElementsByTagName('script');
 2290 for (var script, i = 0; script = scripts[i]; i++) {
 2291 var src = script.src;
 2292 var l = src.length;
 2293 if (src.substr(l - expectedBase.length) == expectedBase) {
 2294 basePath = src.substr(0, l - expectedBase.length);
 2295 }
 2296 }
 2297 }
 2298 return basePath + "resources/";
 2299};
 2300
 2301var loadStandardVertexShader = function(gl) {
 2302 return loadShaderFromFile(
 2303 gl, getResourcePath() + "vertexShader.vert", gl.VERTEX_SHADER);
 2304};
 2305var loadStandardVertexShaderAsync = function(gl, callback) {
 2306 loadShaderFromFileAsync(gl, getResourcePath() + "vertexShader.vert", gl.VERTEX_SHADER, undefined, undefined, undefined, callback);
 2307};
 2308
 2309var loadStandardFragmentShader = function(gl) {
 2310 return loadShaderFromFile(
 2311 gl, getResourcePath() + "fragmentShader.frag", gl.FRAGMENT_SHADER);
 2312};
 2313var loadStandardFragmentShaderAsync = function(gl, callback) {
 2314 loadShaderFromFileAsync(gl, getResourcePath() + "fragmentShader.frag", gl.FRAGMENT_SHADER, undefined, undefined, undefined, callback);
 2315};
 2316
 2317var loadUniformBlockProgram = function(gl) {
 2318 var program = gl.createProgram();
 2319 gl.attachShader(program, loadUniformBlockVertexShader(gl));
 2320 gl.attachShader(program, loadUniformBlockFragmentShader(gl));
 2321 gl.bindAttribLocation(program, 0, "a_vertex");
 2322 gl.bindAttribLocation(program, 1, "a_normal");
 2323 linkProgram(gl, program);
 2324 return program;
 2325};
 2326
 2327var loadUniformBlockVertexShader = function(gl) {
 2328 return loadShaderFromFile(
 2329 gl, getResourcePath() + "uniformBlockShader.vert", gl.VERTEX_SHADER);
 2330};
 2331
 2332var loadUniformBlockFragmentShader = function(gl) {
 2333 return loadShaderFromFile(
 2334 gl, getResourcePath() + "uniformBlockShader.frag", gl.FRAGMENT_SHADER);
 2335};
 2336
 2337/**
 2338 * Loads an image asynchronously.
 2339 * @param {string} url URL of image to load.
 2340 * @param {!function(!Element): void} callback Function to call
 2341 * with loaded image.
 2342 */
 2343var loadImageAsync = function(url, callback) {
 2344 var img = document.createElement('img');
 2345 img.onload = function() {
 2346 callback(img);
 2347 };
 2348 img.src = url;
 2349};
 2350
 2351/**
 2352 * Loads an array of images.
 2353 * @param {!Array.<string>} urls URLs of images to load.
 2354 * @param {!function(!{string, img}): void} callback Callback
 2355 * that gets passed map of urls to img tags.
 2356 */
 2357var loadImagesAsync = function(urls, callback) {
 2358 var count = 1;
 2359 var images = { };
 2360 function countDown() {
 2361 --count;
 2362 if (count == 0) {
 2363 log("loadImagesAsync: all images loaded");
 2364 callback(images);
 2365 }
 2366 }
 2367 function imageLoaded(url) {
 2368 return function(img) {
 2369 images[url] = img;
 2370 log("loadImagesAsync: loaded " + url);
 2371 countDown();
 2372 }
 2373 }
 2374 for (var ii = 0; ii < urls.length; ++ii) {
 2375 ++count;
 2376 loadImageAsync(urls[ii], imageLoaded(urls[ii]));
 2377 }
 2378 countDown();
 2379};
 2380
 2381/**
 2382 * Returns a map of key=value values from url.
 2383 * @return {!Object.<string, number>} map of keys to values.
 2384 */
 2385var getUrlArguments = function() {
 2386 var args = {};
 2387 try {
 2388 var s = window.location.href;
 2389 var q = s.indexOf("?");
 2390 var e = s.indexOf("#");
 2391 if (e < 0) {
 2392 e = s.length;
 2393 }
 2394 var query = s.substring(q + 1, e);
 2395 var pairs = query.split("&");
 2396 for (var ii = 0; ii < pairs.length; ++ii) {
 2397 var keyValue = pairs[ii].split("=");
 2398 var key = keyValue[0];
 2399 var value = decodeURIComponent(keyValue[1]);
 2400 args[key] = value;
 2401 }
 2402 } catch (e) {
 2403 throw "could not parse url";
 2404 }
 2405 return args;
 2406};
 2407
 2408/**
 2409 * Makes an image from a src.
 2410 * @param {string} src Image source URL.
 2411 * @param {function()} onload Callback to call when the image has finised loading.
 2412 * @param {function()} onerror Callback to call when an error occurs.
 2413 * @return {!Image} The created image.
 2414 */
 2415var makeImage = function(src, onload, onerror) {
 2416 var img = document.createElement('img');
 2417 if (onload) {
 2418 img.onload = onload;
 2419 }
 2420 if (onerror) {
 2421 img.onerror = onerror;
 2422 } else {
 2423 img.onerror = function() {
 2424 log("WARNING: creating image failed; src: " + this.src);
 2425 };
 2426 }
 2427 if (src) {
 2428 img.src = src;
 2429 }
 2430 return img;
 2431}
 2432
 2433/**
 2434 * Makes an image element from a canvas.
 2435 * @param {!HTMLCanvas} canvas Canvas to make image from.
 2436 * @param {function()} onload Callback to call when the image has finised loading.
 2437 * @param {string} imageFormat Image format to be passed to toDataUrl().
 2438 * @return {!Image} The created image.
 2439 */
 2440var makeImageFromCanvas = function(canvas, onload, imageFormat) {
 2441 return makeImage(canvas.toDataURL(imageFormat), onload);
 2442};
 2443
 2444/**
 2445 * Makes a video element from a src.
 2446 * @param {string} src Video source URL.
 2447 * @param {function()} onerror Callback to call when an error occurs.
 2448 * @return {!Video} The created video.
 2449 */
 2450var makeVideo = function(src, onerror) {
 2451 var vid = document.createElement('video');
 2452 if (onerror) {
 2453 vid.onerror = onerror;
 2454 } else {
 2455 vid.onerror = function() {
 2456 log("WARNING: creating video failed; src: " + this.src);
 2457 };
 2458 }
 2459 if (src) {
 2460 vid.src = src;
 2461 }
 2462 return vid;
 2463}
 2464
 2465/**
 2466 * Inserts an image with a caption into 'element'.
 2467 * @param {!HTMLElement} element Element to append image to.
 2468 * @param {string} caption caption to associate with image.
 2469 * @param {!Image} img image to insert.
 2470 */
 2471var insertImage = function(element, caption, img) {
 2472 var div = document.createElement("div");
 2473 var label = document.createElement("div");
 2474 label.appendChild(document.createTextNode(caption));
 2475 div.appendChild(label);
 2476 div.appendChild(img);
 2477 element.appendChild(div);
 2478};
 2479
 2480/**
 2481 * Inserts a 'label' that when clicked expands to the pre formatted text
 2482 * supplied by 'source'.
 2483 * @param {!HTMLElement} element element to append label to.
 2484 * @param {string} label label for anchor.
 2485 * @param {string} source preformatted text to expand to.
 2486 * @param {string} opt_url URL of source. If provided a link to the source file
 2487 * will also be added.
 2488 */
 2489var addShaderSource = function(element, label, source, opt_url) {
 2490 var div = document.createElement("div");
 2491 var s = document.createElement("pre");
 2492 s.className = "shader-source";
 2493 s.style.display = "none";
 2494 var ol = document.createElement("ol");
 2495 //s.appendChild(document.createTextNode(source));
 2496 var lines = source.split("\n");
 2497 for (var ii = 0; ii < lines.length; ++ii) {
 2498 var line = lines[ii];
 2499 var li = document.createElement("li");
 2500 li.appendChild(document.createTextNode(line));
 2501 ol.appendChild(li);
 2502 }
 2503 s.appendChild(ol);
 2504 var l = document.createElement("a");
 2505 l.href = "show-shader-source";
 2506 l.appendChild(document.createTextNode(label));
 2507 l.addEventListener('click', function(event) {
 2508 if (event.preventDefault) {
 2509 event.preventDefault();
 2510 }
 2511 s.style.display = (s.style.display == 'none') ? 'block' : 'none';
 2512 return false;
 2513 }, false);
 2514 div.appendChild(l);
 2515 if (opt_url) {
 2516 var u = document.createElement("a");
 2517 u.href = opt_url;
 2518 div.appendChild(document.createTextNode(" "));
 2519 u.appendChild(document.createTextNode("(" + opt_url + ")"));
 2520 div.appendChild(u);
 2521 }
 2522 div.appendChild(s);
 2523 element.appendChild(div);
 2524};
 2525
 2526/**
 2527 * Inserts labels that when clicked expand to show the original source of the
 2528 * shader and also translated source of the shader, if that is available.
 2529 * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use.
 2530 * @param {!HTMLElement} element element to append label to.
 2531 * @param {string} label label for anchor.
 2532 * @param {WebGLShader} shader Shader to show the sources for.
 2533 * @param {string} shaderSource Original shader source.
 2534 * @param {string} opt_url URL of source. If provided a link to the source file
 2535 * will also be added.
 2536 */
 2537var addShaderSources = function(
 2538 gl, element, label, shader, shaderSource, opt_url) {
 2539 addShaderSource(element, label, shaderSource, opt_url);
 2540
 2541 var debugShaders = gl.getExtension('WEBGL_debug_shaders');
 2542 if (debugShaders && shader) {
 2543 var translatedSource = debugShaders.getTranslatedShaderSource(shader);
 2544 if (translatedSource != '') {
 2545 addShaderSource(element, label + ' translated for driver', translatedSource);
 2546 }
 2547 }
 2548};
 2549
 2550/**
 2551 * Sends shader information to the server to be dumped into text files
 2552 * when tests are run from within the test-runner harness.
 2553 * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use.
 2554 * @param {string} url URL of current.
 2555 * @param {string} passMsg Test description.
 2556 * @param {object} vInfo Object containing vertex shader information.
 2557 * @param {object} fInfo Object containing fragment shader information.
 2558 */
 2559var dumpShadersInfo = function(gl, url, passMsg, vInfo, fInfo) {
 2560 var shaderInfo = {};
 2561 shaderInfo.url = url;
 2562 shaderInfo.testDescription = passMsg;
 2563 shaderInfo.vLabel = vInfo.label;
 2564 shaderInfo.vShouldCompile = vInfo.shaderSuccess;
 2565 shaderInfo.vSource = vInfo.source;
 2566 shaderInfo.fLabel = fInfo.label;
 2567 shaderInfo.fShouldCompile = fInfo.shaderSuccess;
 2568 shaderInfo.fSource = fInfo.source;
 2569 shaderInfo.vTranslatedSource = null;
 2570 shaderInfo.fTranslatedSource = null;
 2571 var debugShaders = gl.getExtension('WEBGL_debug_shaders');
 2572 if (debugShaders) {
 2573 if (vInfo.shader)
 2574 shaderInfo.vTranslatedSource = debugShaders.getTranslatedShaderSource(vInfo.shader);
 2575 if (fInfo.shader)
 2576 shaderInfo.fTranslatedSource = debugShaders.getTranslatedShaderSource(fInfo.shader);
 2577 }
 2578
 2579 var dumpShaderInfoRequest = new XMLHttpRequest();
 2580 dumpShaderInfoRequest.open('POST', "/dumpShaderInfo", true);
 2581 dumpShaderInfoRequest.setRequestHeader("Content-Type", "text/plain");
 2582 dumpShaderInfoRequest.send(JSON.stringify(shaderInfo));
 2583};
 2584
 2585// Add your prefix here.
 2586var browserPrefixes = [
 2587 "",
 2588 "MOZ_",
 2589 "OP_",
 2590 "WEBKIT_"
 2591];
 2592
 2593/**
 2594 * Given an extension name like WEBGL_compressed_texture_s3tc
 2595 * returns the name of the supported version extension, like
 2596 * WEBKIT_WEBGL_compressed_teture_s3tc
 2597 * @param {string} name Name of extension to look for.
 2598 * @return {string} name of extension found or undefined if not
 2599 * found.
 2600 */
 2601var getSupportedExtensionWithKnownPrefixes = function(gl, name) {
 2602 var supported = gl.getSupportedExtensions();
 2603 for (var ii = 0; ii < browserPrefixes.length; ++ii) {
 2604 var prefixedName = browserPrefixes[ii] + name;
 2605 if (supported.indexOf(prefixedName) >= 0) {
 2606 return prefixedName;
 2607 }
 2608 }
 2609};
 2610
 2611/**
 2612 * Given an extension name like WEBGL_compressed_texture_s3tc
 2613 * returns the supported version extension, like
 2614 * WEBKIT_WEBGL_compressed_teture_s3tc
 2615 * @param {string} name Name of extension to look for.
 2616 * @return {WebGLExtension} The extension or undefined if not
 2617 * found.
 2618 */
 2619var getExtensionWithKnownPrefixes = function(gl, name) {
 2620 for (var ii = 0; ii < browserPrefixes.length; ++ii) {
 2621 var prefixedName = browserPrefixes[ii] + name;
 2622 var ext = gl.getExtension(prefixedName);
 2623 if (ext) {
 2624 return ext;
 2625 }
 2626 }
 2627};
 2628
 2629/**
 2630 * Returns possible prefixed versions of an extension's name.
 2631 * @param {string} name Name of extension. May already include a prefix.
 2632 * @return {Array.<string>} Variations of the extension name with known
 2633 * browser prefixes.
 2634 */
 2635var getExtensionPrefixedNames = function(name) {
 2636 var unprefix = function(name) {
 2637 for (var ii = 0; ii < browserPrefixes.length; ++ii) {
 2638 if (browserPrefixes[ii].length > 0 &&
 2639 name.substring(0, browserPrefixes[ii].length).toLowerCase() ===
 2640 browserPrefixes[ii].toLowerCase()) {
 2641 return name.substring(browserPrefixes[ii].length);
 2642 }
 2643 }
 2644 return name;
 2645 }
 2646
 2647 var unprefixed = unprefix(name);
 2648
 2649 var variations = [];
 2650 for (var ii = 0; ii < browserPrefixes.length; ++ii) {
 2651 variations.push(browserPrefixes[ii] + unprefixed);
 2652 }
 2653
 2654 return variations;
 2655};
 2656
 2657var replaceRE = /\$\((\w+)\)/g;
 2658
 2659/**
 2660 * Replaces strings with property values.
 2661 * Given a string like "hello $(first) $(last)" and an object
 2662 * like {first:"John", last:"Smith"} will return
 2663 * "hello John Smith".
 2664 * @param {string} str String to do replacements in.
 2665 * @param {...} 1 or more objects containing properties.
 2666 */
 2667var replaceParams = function(str) {
 2668 var args = arguments;
 2669 return str.replace(replaceRE, function(str, p1, offset, s) {
 2670 for (var ii = 1; ii < args.length; ++ii) {
 2671 if (args[ii][p1] !== undefined) {
 2672 return args[ii][p1];
 2673 }
 2674 }
 2675 throw "unknown string param '" + p1 + "'";
 2676 });
 2677};
 2678
 2679var upperCaseFirstLetter = function(str) {
 2680 return str.substring(0, 1).toUpperCase() + str.substring(1);
 2681};
 2682
 2683/**
 2684 * Gets a prefixed property. For example,
 2685 *
 2686 * var fn = getPrefixedProperty(
 2687 * window,
 2688 * "requestAnimationFrame");
 2689 *
 2690 * Will return either:
 2691 * "window.requestAnimationFrame",
 2692 * "window.oRequestAnimationFrame",
 2693 * "window.msRequestAnimationFrame",
 2694 * "window.mozRequestAnimationFrame",
 2695 * "window.webKitRequestAnimationFrame",
 2696 * undefined
 2697 *
 2698 * the non-prefixed function is tried first.
 2699 */
 2700var propertyPrefixes = ["", "moz", "ms", "o", "webkit"];
 2701var getPrefixedProperty = function(obj, propertyName) {
 2702 for (var ii = 0; ii < propertyPrefixes.length; ++ii) {
 2703 var prefix = propertyPrefixes[ii];
 2704 var name = prefix + propertyName;
 2705 log(name);
 2706 var property = obj[name];
 2707 if (property) {
 2708 return property;
 2709 }
 2710 if (ii == 0) {
 2711 propertyName = upperCaseFirstLetter(propertyName);
 2712 }
 2713 }
 2714 return undefined;
 2715};
 2716
 2717var _requestAnimFrame;
 2718
 2719/**
 2720 * Provides requestAnimationFrame in a cross browser way.
 2721 */
 2722var requestAnimFrame = function(callback) {
 2723 if (!_requestAnimFrame) {
 2724 _requestAnimFrame = getPrefixedProperty(window, "requestAnimationFrame") ||
 2725 function(callback, element) {
 2726 return window.setTimeout(callback, 1000 / 70);
 2727 };
 2728 }
 2729 _requestAnimFrame.call(window, callback);
 2730};
 2731
 2732var _cancelAnimFrame;
 2733
 2734/**
 2735 * Provides cancelAnimationFrame in a cross browser way.
 2736 */
 2737var cancelAnimFrame = function(request) {
 2738 if (!_cancelAnimFrame) {
 2739 _cancelAnimFrame = getPrefixedProperty(window, "cancelAnimationFrame") ||
 2740 window.clearTimeout;
 2741 }
 2742 _cancelAnimFrame.call(window, request);
 2743};
 2744
 2745/**
 2746 * Provides requestFullScreen in a cross browser way.
 2747 */
 2748var requestFullScreen = function(element) {
 2749 var fn = getPrefixedProperty(element, "requestFullScreen");
 2750 if (fn) {
 2751 fn.call(element);
 2752 }
 2753};
 2754
 2755/**
 2756 * Provides cancelFullScreen in a cross browser way.
 2757 */
 2758var cancelFullScreen = function() {
 2759 var fn = getPrefixedProperty(document, "cancelFullScreen");
 2760 if (fn) {
 2761 fn.call(document);
 2762 }
 2763};
 2764
 2765var fullScreenStateName;
 2766(function() {
 2767 var fullScreenStateNames = [
 2768 "isFullScreen",
 2769 "fullScreen"
 2770 ];
 2771 for (var ii = 0; ii < fullScreenStateNames.length; ++ii) {
 2772 var propertyName = fullScreenStateNames[ii];
 2773 for (var jj = 0; jj < propertyPrefixes.length; ++jj) {
 2774 var prefix = propertyPrefixes[jj];
 2775 if (prefix.length) {
 2776 propertyName = upperCaseFirstLetter(propertyName);
 2777 fullScreenStateName = prefix + propertyName;
 2778 if (document[fullScreenStateName] !== undefined) {
 2779 return;
 2780 }
 2781 }
 2782 }
 2783 fullScreenStateName = undefined;
 2784 }
 2785}());
 2786
 2787/**
 2788 * @return {boolean} True if fullscreen mode is active.
 2789 */
 2790var getFullScreenState = function() {
 2791 log("fullscreenstatename:" + fullScreenStateName);
 2792 log(document[fullScreenStateName]);
 2793 return document[fullScreenStateName];
 2794};
 2795
 2796/**
 2797 * @param {!HTMLElement} element The element to go fullscreen.
 2798 * @param {!function(boolean)} callback A function that will be called
 2799 * when entering/exiting fullscreen. It is passed true if
 2800 * entering fullscreen, false if exiting.
 2801 */
 2802var onFullScreenChange = function(element, callback) {
 2803 propertyPrefixes.forEach(function(prefix) {
 2804 var eventName = prefix + "fullscreenchange";
 2805 log("addevent: " + eventName);
 2806 document.addEventListener(eventName, function(event) {
 2807 log("event: " + eventName);
 2808 callback(getFullScreenState());
 2809 });
 2810 });
 2811};
 2812
 2813/**
 2814 * @param {!string} buttonId The id of the button that will toggle fullscreen
 2815 * mode.
 2816 * @param {!string} fullscreenId The id of the element to go fullscreen.
 2817 * @param {!function(boolean)} callback A function that will be called
 2818 * when entering/exiting fullscreen. It is passed true if
 2819 * entering fullscreen, false if exiting.
 2820 * @return {boolean} True if fullscreen mode is supported.
 2821 */
 2822var setupFullscreen = function(buttonId, fullscreenId, callback) {
 2823 if (!fullScreenStateName) {
 2824 return false;
 2825 }
 2826
 2827 var fullscreenElement = document.getElementById(fullscreenId);
 2828 onFullScreenChange(fullscreenElement, callback);
 2829
 2830 var toggleFullScreen = function(event) {
 2831 if (getFullScreenState()) {
 2832 cancelFullScreen(fullscreenElement);
 2833 } else {
 2834 requestFullScreen(fullscreenElement);
 2835 }
 2836 event.preventDefault();
 2837 return false;
 2838 };
 2839
 2840 var buttonElement = document.getElementById(buttonId);
 2841 buttonElement.addEventListener('click', toggleFullScreen);
 2842
 2843 return true;
 2844};
 2845
 2846/**
 2847 * Waits for the browser to composite the web page.
 2848 * @param {function()} callback A function to call after compositing has taken
 2849 * place.
 2850 */
 2851var waitForComposite = function(callback) {
 2852 var frames = 5;
 2853 var countDown = function() {
 2854 if (frames == 0) {
 2855 // TODO(kbr): unify with js-test-pre.js and enable these with
 2856 // verbose logging.
 2857 // log("waitForComposite: callback");
 2858 callback();
 2859 } else {
 2860 // log("waitForComposite: countdown(" + frames + ")");
 2861 --frames;
 2862 requestAnimFrame.call(window, countDown);
 2863 }
 2864 };
 2865 countDown();
 2866};
 2867
 2868/**
 2869 * Runs an array of functions, yielding to the browser between each step.
 2870 * If you want to know when all the steps are finished add a last step.
 2871 * @param {!Array.<function(): void>} steps Array of functions.
 2872 */
 2873var runSteps = function(steps) {
 2874 if (!steps.length) {
 2875 return;
 2876 }
 2877
 2878 // copy steps so they can't be modifed.
 2879 var stepsToRun = steps.slice();
 2880 var currentStep = 0;
 2881 var runNextStep = function() {
 2882 stepsToRun[currentStep++]();
 2883 if (currentStep < stepsToRun.length) {
 2884 setTimeout(runNextStep, 1);
 2885 }
 2886 };
 2887 runNextStep();
 2888};
 2889
 2890/**
 2891 * Starts playing a video and waits for it to be consumable.
 2892 * @param {!HTMLVideoElement} video An HTML5 Video element.
 2893 * @param {!function(!HTMLVideoElement): void} callback Function to call when
 2894 * video is ready.
 2895 */
 2896var startPlayingAndWaitForVideo = function(video, callback) {
 2897 var gotPlaying = false;
 2898 var gotTimeUpdate = false;
 2899
 2900 var maybeCallCallback = function() {
 2901 if (gotPlaying && gotTimeUpdate && callback) {
 2902 callback(video);
 2903 callback = undefined;
 2904 video.removeEventListener('playing', playingListener, true);
 2905 video.removeEventListener('timeupdate', timeupdateListener, true);
 2906 }
 2907 };
 2908
 2909 var playingListener = function() {
 2910 gotPlaying = true;
 2911 maybeCallCallback();
 2912 };
 2913
 2914 var timeupdateListener = function() {
 2915 // Checking to make sure the current time has advanced beyond
 2916 // the start time seems to be a reliable heuristic that the
 2917 // video element has data that can be consumed.
 2918 if (video.currentTime > 0.0) {
 2919 gotTimeUpdate = true;
 2920 maybeCallCallback();
 2921 }
 2922 };
 2923
 2924 video.addEventListener('playing', playingListener, true);
 2925 video.addEventListener('timeupdate', timeupdateListener, true);
 2926 video.loop = true;
 2927 video.play();
 2928};
 2929
 2930var getHost = function(url) {
 2931 url = url.replace("\\", "/");
 2932 var pos = url.indexOf("://");
 2933 if (pos >= 0) {
 2934 url = url.substr(pos + 3);
 2935 }
 2936 var parts = url.split('/');
 2937 return parts[0];
 2938}
 2939
 2940// This function returns the last 2 words of the domain of a URL
 2941// This is probably not the correct check but it will do for now.
 2942var getBaseDomain = function(host) {
 2943 var parts = host.split(":");
 2944 var hostname = parts[0];
 2945 var port = parts[1] || "80";
 2946 parts = hostname.split(".");
 2947 if(parts.length < 2)
 2948 return hostname + ":" + port;
 2949 var tld = parts[parts.length-1];
 2950 var domain = parts[parts.length-2];
 2951 return domain + "." + tld + ":" + port;
 2952}
 2953
 2954var runningOnLocalhost = function() {
 2955 return window.location.hostname.indexOf("localhost") != -1 ||
 2956 window.location.hostname.indexOf("127.0.0.1") != -1;
 2957}
 2958
 2959var getLocalCrossOrigin = function() {
 2960 var domain;
 2961 if (window.location.host.indexOf("localhost") != -1) {
 2962 domain = "127.0.0.1";
 2963 } else {
 2964 domain = "localhost";
 2965 }
 2966
 2967 var port = window.location.port || "80";
 2968 return window.location.protocol + "//" + domain + ":" + port
 2969}
 2970
 2971var getRelativePath = function(path) {
 2972 var relparts = window.location.pathname.split("/");
 2973 relparts.pop(); // Pop off filename
 2974 var pathparts = path.split("/");
 2975
 2976 var i;
 2977 for (i = 0; i < pathparts.length; ++i) {
 2978 switch (pathparts[i]) {
 2979 case "": break;
 2980 case ".": break;
 2981 case "..":
 2982 relparts.pop();
 2983 break;
 2984 default:
 2985 relparts.push(pathparts[i]);
 2986 break;
 2987 }
 2988 }
 2989
 2990 return relparts.join("/");
 2991}
 2992
 2993var setupImageForCrossOriginTest = function(img, imgUrl, localUrl, callback) {
 2994 window.addEventListener("load", function() {
 2995 if (typeof(img) == "string")
 2996 img = document.querySelector(img);
 2997 if (!img)
 2998 img = new Image();
 2999
 3000 img.addEventListener("load", callback, false);
 3001 img.addEventListener("error", callback, false);
 3002
 3003 if (runningOnLocalhost())
 3004 img.src = getLocalCrossOrigin() + getRelativePath(localUrl);
 3005 else
 3006 img.src = getUrlOptions().imgUrl || imgUrl;
 3007 }, false);
 3008}
 3009
 3010/**
 3011 * Convert sRGB color to linear color.
 3012 * @param {!Array.<number>} color The color to be converted.
 3013 * The array has 4 elements, for example [R, G, B, A].
 3014 * where each element is in the range 0 to 255.
 3015 * @return {!Array.<number>} color The color to be converted.
 3016 * The array has 4 elements, for example [R, G, B, A].
 3017 * where each element is in the range 0 to 255.
 3018 */
 3019var sRGBToLinear = function(color) {
 3020 return [sRGBChannelToLinear(color[0]),
 3021 sRGBChannelToLinear(color[1]),
 3022 sRGBChannelToLinear(color[2]),
 3023 color[3]]
 3024}
 3025
 3026/**
 3027 * Convert linear color to sRGB color.
 3028 * @param {!Array.<number>} color The color to be converted.
 3029 * The array has 4 elements, for example [R, G, B, A].
 3030 * where each element is in the range 0 to 255.
 3031 * @return {!Array.<number>} color The color to be converted.
 3032 * The array has 4 elements, for example [R, G, B, A].
 3033 * where each element is in the range 0 to 255.
 3034 */
 3035var linearToSRGB = function(color) {
 3036 return [linearChannelToSRGB(color[0]),
 3037 linearChannelToSRGB(color[1]),
 3038 linearChannelToSRGB(color[2]),
 3039 color[3]]
 3040}
 3041
 3042function sRGBChannelToLinear(value) {
 3043 value = value / 255;
 3044 if (value <= 0.04045)
 3045 value = value / 12.92;
 3046 else
 3047 value = Math.pow((value + 0.055) / 1.055, 2.4);
 3048 return Math.trunc(value * 255 + 0.5);
 3049}
 3050
 3051function linearChannelToSRGB(value) {
 3052 value = value / 255;
 3053 if (value <= 0.0) {
 3054 value = 0.0;
 3055 } else if (value < 0.0031308) {
 3056 value = value * 12.92;
 3057 } else if (value < 1) {
 3058 value = Math.pow(value, 0.41666) * 1.055 - 0.055;
 3059 } else {
 3060 value = 1.0;
 3061 }
 3062 return Math.trunc(value * 255 + 0.5);
 3063}
 3064
 3065function comparePixels(cmp, ref, tolerance, diff) {
 3066 if (cmp.length != ref.length) {
 3067 testFailed("invalid pixel size.");
 3068 }
 3069
 3070 var count = 0;
 3071 for (var i = 0; i < cmp.length; i++) {
 3072 diff[i * 4] = 0;
 3073 diff[i * 4 + 1] = 255;
 3074 diff[i * 4 + 2] = 0;
 3075 diff[i * 4 + 3] = 255;
 3076 if (Math.abs(cmp[i * 4] - ref[i * 4]) > tolerance ||
 3077 Math.abs(cmp[i * 4 + 1] - ref[i * 4 + 1]) > tolerance ||
 3078 Math.abs(cmp[i * 4 + 2] - ref[i * 4 + 2]) > tolerance ||
 3079 Math.abs(cmp[i * 4 + 3] - ref[i * 4 + 3]) > tolerance) {
 3080 if (count < 10) {
 3081 testFailed("Pixel " + i + ": expected (" +
 3082 [ref[i * 4], ref[i * 4 + 1], ref[i * 4 + 2], ref[i * 4 + 3]] + "), got (" +
 3083 [cmp[i * 4], cmp[i * 4 + 1], cmp[i * 4 + 2], cmp[i * 4 + 3]] + ")");
 3084 }
 3085 count++;
 3086 diff[i * 4] = 255;
 3087 diff[i * 4 + 1] = 0;
 3088 }
 3089 }
 3090
 3091 return count;
 3092}
 3093
 3094function displayImageDiff(cmp, ref, diff, width, height) {
 3095 var div = document.createElement("div");
 3096
 3097 var cmpImg = createImageFromPixel(cmp, width, height);
 3098 var refImg = createImageFromPixel(ref, width, height);
 3099 var diffImg = createImageFromPixel(diff, width, height);
 3100 wtu.insertImage(div, "Reference", refImg);
 3101 wtu.insertImage(div, "Result", cmpImg);
 3102 wtu.insertImage(div, "Difference", diffImg);
 3103
 3104 var console = document.getElementById("console");
 3105 console.appendChild(div);
 3106}
 3107
 3108function createImageFromPixel(buf, width, height) {
 3109 var canvas = document.createElement("canvas");
 3110 canvas.width = width;
 3111 canvas.height = height;
 3112 var ctx = canvas.getContext("2d");
 3113 var imgData = ctx.getImageData(0, 0, width, height);
 3114
 3115 for (var i = 0; i < buf.length; i++)
 3116 imgData.data[i] = buf[i];
 3117 ctx.putImageData(imgData, 0, 0);
 3118 var img = wtu.makeImageFromCanvas(canvas);
 3119 return img;
 3120}
 3121
 3122var API = {
 3123 addShaderSource: addShaderSource,
 3124 addShaderSources: addShaderSources,
 3125 cancelAnimFrame: cancelAnimFrame,
 3126 create3DContext: create3DContext,
 3127 GLErrorException: GLErrorException,
 3128 create3DContextWithWrapperThatThrowsOnGLError: create3DContextWithWrapperThatThrowsOnGLError,
 3129 checkAreaInAndOut: checkAreaInAndOut,
 3130 checkCanvas: checkCanvas,
 3131 checkCanvasRect: checkCanvasRect,
 3132 checkCanvasRectColor: checkCanvasRectColor,
 3133 checkCanvasRects: checkCanvasRects,
 3134 checkFloatBuffer: checkFloatBuffer,
 3135 checkTextureSize: checkTextureSize,
 3136 clipToRange: clipToRange,
 3137 createColoredTexture: createColoredTexture,
 3138 createProgram: createProgram,
 3139 clearAndDrawUnitQuad: clearAndDrawUnitQuad,
 3140 clearAndDrawIndexedQuad: clearAndDrawIndexedQuad,
 3141 comparePixels: comparePixels,
 3142 displayImageDiff: displayImageDiff,
 3143 drawUnitQuad: drawUnitQuad,
 3144 drawIndexedQuad: drawIndexedQuad,
 3145 drawUByteColorQuad: drawUByteColorQuad,
 3146 drawFloatColorQuad: drawFloatColorQuad,
 3147 dummySetProgramAndDrawNothing: dummySetProgramAndDrawNothing,
 3148 dumpShadersInfo: dumpShadersInfo,
 3149 endsWith: endsWith,
 3150 failIfGLError: failIfGLError,
 3151 fillTexture: fillTexture,
 3152 getBytesPerComponent: getBytesPerComponent,
 3153 getDefault3DContextVersion: getDefault3DContextVersion,
 3154 getExtensionPrefixedNames: getExtensionPrefixedNames,
 3155 getExtensionWithKnownPrefixes: getExtensionWithKnownPrefixes,
 3156 getFileListAsync: getFileListAsync,
 3157 getLastError: getLastError,
 3158 getPrefixedProperty: getPrefixedProperty,
 3159 getScript: getScript,
 3160 getSupportedExtensionWithKnownPrefixes: getSupportedExtensionWithKnownPrefixes,
 3161 getTypedArrayElementsPerPixel: getTypedArrayElementsPerPixel,
 3162 getUrlArguments: getUrlArguments,
 3163 getUrlOptions: getUrlOptions,
 3164 getAttribMap: getAttribMap,
 3165 getUniformMap: getUniformMap,
 3166 glEnumToString: glEnumToString,
 3167 glErrorShouldBe: glErrorShouldBe,
 3168 glTypeToTypedArrayType: glTypeToTypedArrayType,
 3169 hasAttributeCaseInsensitive: hasAttributeCaseInsensitive,
 3170 insertImage: insertImage,
 3171 loadImageAsync: loadImageAsync,
 3172 loadImagesAsync: loadImagesAsync,
 3173 loadProgram: loadProgram,
 3174 loadProgramFromFile: loadProgramFromFile,
 3175 loadProgramFromScript: loadProgramFromScript,
 3176 loadProgramFromScriptExpectError: loadProgramFromScriptExpectError,
 3177 loadShader: loadShader,
 3178 loadShaderFromFile: loadShaderFromFile,
 3179 loadShaderFromScript: loadShaderFromScript,
 3180 loadStandardProgram: loadStandardProgram,
 3181 loadStandardProgramAsync: loadStandardProgramAsync,
 3182 loadStandardVertexShader: loadStandardVertexShader,
 3183 loadStandardVertexShaderAsync: loadStandardVertexShaderAsync,
 3184 loadStandardFragmentShader: loadStandardFragmentShader,
 3185 loadStandardFragmentShaderAsync: loadStandardFragmentShaderAsync,
 3186 loadUniformBlockProgram: loadUniformBlockProgram,
 3187 loadUniformBlockVertexShader: loadUniformBlockVertexShader,
 3188 loadUniformBlockFragmentShader: loadUniformBlockFragmentShader,
 3189 loadTextFileAsync: loadTextFileAsync,
 3190 loadTexture: loadTexture,
 3191 log: log,
 3192 loggingOff: loggingOff,
 3193 makeCheckRect: makeCheckRect,
 3194 makeImage: makeImage,
 3195 makeImageFromCanvas: makeImageFromCanvas,
 3196 makeVideo: makeVideo,
 3197 error: error,
 3198 shallowCopyObject: shallowCopyObject,
 3199 setDefault3DContextVersion: setDefault3DContextVersion,
 3200 setupColorQuad: setupColorQuad,
 3201 setupProgram: setupProgram,
 3202 setupTransformFeedbackProgram: setupTransformFeedbackProgram,
 3203 setupQuad: setupQuad,
 3204 setupQuadWithTexCoords: setupQuadWithTexCoords,
 3205 setupIndexedQuad: setupIndexedQuad,
 3206 setupIndexedQuadWithOptions: setupIndexedQuadWithOptions,
 3207 setupSimpleColorProgram: setupSimpleColorProgram,
 3208 setupSimpleTextureProgram: setupSimpleTextureProgram,
 3209 setupSimpleCubeMapTextureProgram: setupSimpleCubeMapTextureProgram,
 3210 setupSimpleVertexColorProgram: setupSimpleVertexColorProgram,
 3211 setupNoTexCoordTextureProgram: setupNoTexCoordTextureProgram,
 3212 setupTexturedQuad: setupTexturedQuad,
 3213 setupTexturedQuadWithTexCoords: setupTexturedQuadWithTexCoords,
 3214 setupTexturedQuadWithCubeMap: setupTexturedQuadWithCubeMap,
 3215 setupUnitQuad: setupUnitQuad,
 3216 setFloatDrawColor: setFloatDrawColor,
 3217 setUByteDrawColor: setUByteDrawColor,
 3218 startPlayingAndWaitForVideo: startPlayingAndWaitForVideo,
 3219 startsWith: startsWith,
 3220 shouldGenerateGLError: shouldGenerateGLError,
 3221 readFile: readFile,
 3222 readFileList: readFileList,
 3223 replaceParams: replaceParams,
 3224 requestAnimFrame: requestAnimFrame,
 3225 runSteps: runSteps,
 3226 waitForComposite: waitForComposite,
 3227
 3228 // fullscreen api
 3229 setupFullscreen: setupFullscreen,
 3230
 3231 // sRGB converter api
 3232 sRGBToLinear: sRGBToLinear,
 3233 linearToSRGB: linearToSRGB,
 3234
 3235 getHost: getHost,
 3236 getBaseDomain: getBaseDomain,
 3237 runningOnLocalhost: runningOnLocalhost,
 3238 getLocalCrossOrigin: getLocalCrossOrigin,
 3239 getRelativePath: getRelativePath,
 3240 setupImageForCrossOriginTest: setupImageForCrossOriginTest,
 3241
 3242 none: false
 3243};
 3244
 3245Object.defineProperties(API, {
 3246 noTexCoordTextureVertexShader: { value: noTexCoordTextureVertexShader, writable: false },
 3247 simpleTextureVertexShader: { value: simpleTextureVertexShader, writable: false },
 3248 simpleColorFragmentShader: { value: simpleColorFragmentShader, writable: false },
 3249 simpleColorFragmentShaderESSL300: { value: simpleColorFragmentShaderESSL300, writable: false },
 3250 simpleVertexShader: { value: simpleVertexShader, writable: false },
 3251 simpleTextureFragmentShader: { value: simpleTextureFragmentShader, writable: false },
 3252 simpleCubeMapTextureFragmentShader: { value: simpleCubeMapTextureFragmentShader, writable: false },
 3253 simpleVertexColorFragmentShader: { value: simpleVertexColorFragmentShader, writable: false },
 3254 simpleVertexColorVertexShader: { value: simpleVertexColorVertexShader, writable: false }
 3255});
 3256
 3257return API;
 3258
 3259}());

LayoutTests/fast/canvas/webgl/webgl-compressed-texture-astc-expected.txt

 1This test verifies the functionality of the WEBGL_compressed_texture_astc extension, if it is available.
 2
 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 4
 5
 6PASS WebGL context exists
 7Testing binding enum with extension disabled
 8PASS supportedFormats is []
 9
 10PASS No WEBGL_compressed_texture_astc support -- this is legal
 11PASS WEBGL_compressed_texture_astc not listed as supported and getExtension failed -- this is legal
 12
 13PASS successfullyParsed is true
 14
 15TEST COMPLETE
 16

LayoutTests/fast/canvas/webgl/webgl-compressed-texture-astc.html

 1<!--
 2/*
 3** Copyright (c) 2016 The Khronos Group Inc.
 4**
 5** Permission is hereby granted, free of charge, to any person obtaining a
 6** copy of this software and/or associated documentation files (the
 7** "Materials"), to deal in the Materials without restriction, including
 8** without limitation the rights to use, copy, modify, merge, publish,
 9** distribute, sublicense, and/or sell copies of the Materials, and to
 10** permit persons to whom the Materials are furnished to do so, subject to
 11** the following conditions:
 12**
 13** The above copyright notice and this permission notice shall be included
 14** in all copies or substantial portions of the Materials.
 15**
 16** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 17** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 18** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 19** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 20** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 21** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 22** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
 23*/
 24-->
 25
 26<!DOCTYPE html>
 27<html>
 28<head>
 29<meta charset="utf-8">
 30<link rel="stylesheet" href="./resources/js-test-style.css"/>
 31<script src="./resources/js-test-pre.js"></script>
 32<script src="./resources/webgl-test-utils-khr.js"></script>
 33<title>WebGL WEBGL_compressed_texture_astc Conformance Tests</title>
 34<style>
 35img {
 36 border: 1px solid black;
 37 margin-right: 1em;
 38}
 39.testimages {
 40}
 41
 42.testimages br {
 43 clear: both;
 44}
 45
 46.testimages > div {
 47 float: left;
 48 margin: 1em;
 49}
 50</style>
 51</head>
 52<body>
 53<div id="description"></div>
 54<canvas id="canvas" width="8" height="8" style="width: 8px; height: 8px;"></canvas>
 55<div id="console"></div>
 56<script>
 57"use strict";
 58description("This test verifies the functionality of the WEBGL_compressed_texture_astc extension, if it is available.");
 59
 60debug("");
 61
 62// Compressed textures generated with ARM's ASTC encoder
 63// https://github.com/ARM-software/astc-encoder
 64
 65// The data below is printed directly from the astc file,
 66// and the header has been left for clarity reasons.
 67
 68// LDR encoded with the following command line:
 69// 'astcenc -c source.png result.astc {blockSize} -medium'
 70
 71// The image used for LDR compression can be found
 72// at sdk/tests/resources/red-green-hard.png
 73
 74var astc_4x4_argb_ldr = new Uint8Array([
 75 //0x13, 0xab, 0xa1, 0x5c, 0x4, 0x4, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 76 0x42, 0x2, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf,
 77 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 78 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 79 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 80 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 81 0x42, 0x2, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
 82 0x42, 0x2, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xff, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
 83 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 84 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 85 0x42, 0x2, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0x0, 0xff, 0x0, 0xff,
 86 0x42, 0x2, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0xff, 0x0,
 87 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 88 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 89 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 90 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 91 0x42, 0x2, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
 92]);
 93var astc_5x4_argb_ldr = new Uint8Array([
 94 //0x13, 0xab, 0xa1, 0x5c, 0x5, 0x4, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 95 0xc1, 0x2, 0x1, 0x2, 0x1, 0x0, 0x0, 0x80, 0x48, 0x22, 0x89, 0x24, 0x92, 0x48, 0x22, 0x9,
 96 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 97 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 98 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 99 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 100 0xc1, 0x2, 0x1, 0x2, 0x1, 0x0, 0x0, 0x0, 0x0, 0x20, 0x89, 0x24, 0x92, 0x48, 0x22, 0x89,
 101 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 102 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 103 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 104 0xc1, 0x2, 0x1, 0x2, 0x1, 0x0, 0x0, 0x80, 0x48, 0x22, 0x89, 0x24, 0x0, 0x40, 0x0, 0x80,
 105 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 106 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 107 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 108 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 109 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 110 0xc1, 0x2, 0x1, 0x2, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x89, 0x24, 0x92, 0x48, 0x22, 0x89,
 111]);
 112var astc_5x5_argb_ldr = new Uint8Array([
 113 //0x13, 0xab, 0xa1, 0x5c, 0x5, 0x5, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 114 0xf3, 0x0, 0x81, 0xff, 0x7, 0x0, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
 115 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 116 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 117 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 118 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 119 0xf3, 0x0, 0x7f, 0x0, 0xf8, 0x1, 0xe0, 0xff, 0xf1, 0xff, 0xf8, 0x7f, 0x0, 0x0, 0x0, 0x0,
 120 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 121 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 122 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 123 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 124 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 125 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 126 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 127 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 128 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 129 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff,
 130]);
 131var astc_6x5_argb_ldr = new Uint8Array([
 132 //0x13, 0xab, 0xa1, 0x5c, 0x6, 0x5, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 133 0x63, 0x1, 0x81, 0x10, 0x0, 0x0, 0x48, 0x49, 0x29, 0x29, 0x25, 0xa5, 0xa4, 0x94, 0x94, 0x12,
 134 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 135 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 136 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 137 0x63, 0x1, 0x81, 0x10, 0x0, 0x0, 0x48, 0x0, 0x28, 0x0, 0x24, 0x0, 0xa4, 0x94, 0x94, 0x92,
 138 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 139 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 140 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 141 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 142 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 143 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 144 0x63, 0x1, 0x81, 0x10, 0x0, 0x0, 0x0, 0x48, 0x1, 0x28, 0x1, 0xa4, 0x0, 0x94, 0x0, 0x92,
 145]);
 146var astc_6x6_argb_ldr = new Uint8Array([
 147 //0x13, 0xab, 0xa1, 0x5c, 0x6, 0x6, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 148 0x4, 0x1, 0x1, 0xfe, 0xff, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xff, 0x7f,
 149 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 150 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 151 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 152 0x4, 0x1, 0x1, 0xfe, 0xff, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0xff, 0xc3, 0x30, 0xfc,
 153 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 154 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 155 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 156 0x4, 0x1, 0x1, 0xfe, 0xff, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0xe3, 0xf8, 0xff, 0xff,
 157]);
 158var astc_8x5_argb_ldr = new Uint8Array([
 159 //0x13, 0xab, 0xa1, 0x5c, 0x8, 0x5, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 160 0x66, 0x0, 0xc1, 0xff, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
 161 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 162 0x66, 0x0, 0xc1, 0xff, 0x0, 0x0, 0xf0, 0xff, 0xf0, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff,
 163 0x66, 0x0, 0xc1, 0xff, 0x0, 0x0, 0xff, 0xf, 0xff, 0xf, 0xff, 0xf, 0xff, 0xff, 0xff, 0xff,
 164 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 165 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 166 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 167 0x66, 0x0, 0x3f, 0x0, 0x1f, 0x0, 0x3, 0x0, 0x3, 0x0, 0x3, 0x0, 0x3, 0x0, 0x3, 0x0,
 168]);
 169var astc_8x6_argb_ldr = new Uint8Array([
 170 //0x13, 0xab, 0xa1, 0x5c, 0x8, 0x6, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 171 0x54, 0x1, 0x81, 0x20, 0x0, 0x0, 0x70, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x3f,
 172 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 173 0x54, 0x1, 0x81, 0x20, 0x0, 0x0, 0x70, 0x7f, 0x7f, 0xf8, 0x7f, 0x56, 0x3f, 0x72, 0x7f, 0x7f,
 174 0x54, 0x1, 0x81, 0x20, 0x0, 0x0, 0x70, 0x7f, 0x7f, 0x7f, 0x3f, 0x72, 0x78, 0x7f, 0x70, 0x7f,
 175 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 176 0x54, 0x1, 0x81, 0x20, 0x0, 0x0, 0x50, 0x7f, 0x72, 0xfe, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
 177]);
 178var astc_8x8_argb_ldr = new Uint8Array([
 179 //0x13, 0xab, 0xa1, 0x5c, 0x8, 0x8, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 180 0x44, 0x5, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
 181 0x44, 0x5, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
 182 0x44, 0x5, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xfc,
 183 0x44, 0x5, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x3f,
 184]);
 185var astc_10x5_argb_ldr = new Uint8Array([
 186 //0x13, 0xab, 0xa1, 0x5c, 0xa, 0x5, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 187 0x65, 0x1, 0x1, 0xfe, 0xff, 0x1, 0x0, 0x0, 0x0, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
 188 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 189 0x65, 0x1, 0x1, 0xfe, 0xff, 0x1, 0x0, 0x0, 0x0, 0x0, 0xfc, 0xf0, 0xc3, 0xff, 0xff, 0xff,
 190 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 191 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 192 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 193 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 194 0x65, 0x1, 0xff, 0x1, 0x0, 0xfe, 0x1, 0x0, 0x0, 0xc0, 0x7, 0x1f, 0x7c, 0xf0, 0xc1, 0x7,
 195]);
 196var astc_10x6_argb_ldr = new Uint8Array([
 197 //0x13, 0xab, 0xa1, 0x5c, 0xa, 0x6, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 198 0xa4, 0x1, 0x1, 0xfe, 0xff, 0x1, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
 199 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 200 0xa4, 0x1, 0x1, 0xfe, 0xff, 0x1, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xf0, 0xc3, 0xf, 0xff, 0xff,
 201 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 202 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 203 0xa4, 0x1, 0x1, 0xfe, 0xff, 0x1, 0x0, 0x0, 0x0, 0x3e, 0xf8, 0xe0, 0xff, 0xff, 0xff, 0xff,
 204]);
 205var astc_10x8_argb_ldr = new Uint8Array([
 206 //0x13, 0xab, 0xa1, 0x5c, 0xa, 0x8, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 207 0x65, 0x9, 0x69, 0x35, 0x0, 0x8, 0x10, 0x2, 0x0, 0x0, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f,
 208 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 209 0x6, 0x11, 0x69, 0x2d, 0x80, 0x40, 0x2, 0x80, 0x4, 0x0, 0x8, 0x0, 0xff, 0xf, 0xf0, 0xff,
 210 0x44, 0x5, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
 211]);
 212var astc_10x10_argb_ldr = new Uint8Array([
 213 //0x13, 0xab, 0xa1, 0x5c, 0xa, 0xa, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 214 0xa4, 0xc9, 0xc, 0x3, 0x22, 0x0, 0x8, 0x40, 0x8, 0x3f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f,
 215 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 216 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 217 0x45, 0x89, 0x7, 0x35, 0x0, 0x40, 0x10, 0x0, 0x20, 0x0, 0x0, 0x1f, 0x7c, 0xf0, 0xc1, 0xff,
 218]);
 219var astc_12x10_argb_ldr = new Uint8Array([
 220 //0x13, 0xab, 0xa1, 0x5c, 0xc, 0xa, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 221 0x64, 0x8, 0x11, 0x3, 0x22, 0x0, 0x8, 0x40, 0x38, 0xfc, 0xc3, 0xff, 0xff, 0xff, 0xff, 0x7f,
 222 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 223 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 224 0xe5, 0x10, 0x4a, 0x4d, 0x46, 0x7f, 0x0, 0xc0, 0xf, 0x40, 0xf8, 0x1, 0x39, 0xf1, 0x7, 0x0,
 225]);
 226var astc_12x12_argb_ldr = new Uint8Array([
 227 //0x13, 0xab, 0xa1, 0x5c, 0xc, 0xc, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 228 0x64, 0xa8, 0x21, 0x3, 0x22, 0x0, 0x8, 0x40, 0x38, 0xfc, 0xc3, 0xff, 0xff, 0xff, 0xff, 0x7f,
 229 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 230 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 231 0x84, 0xd8, 0xe9, 0x2e, 0x0, 0x0, 0x1, 0x0, 0x80, 0xc0, 0x80, 0x28, 0x2a, 0xab, 0x2a, 0xff,
 232]);
 233
 234// HDR encoded with the following command line:
 235// 'astcenc -c source.hdr result.astc {blockSize} -medium'
 236
 237// The image used for HDR compression can be found
 238// at sdk/tests/resources/red-green-hard.hdr
 239
 240var astc_4x4_argb_hdr = new Uint8Array([
 241 //0x13, 0xab, 0xa1, 0x5c, 0x4, 0x4, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 242 0x42, 0x2, 0x1, 0x82, 0x82, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf,
 243 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 244 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 245 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 246 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 247 0x42, 0x2, 0x81, 0x3, 0x82, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
 248 0x42, 0x2, 0x81, 0x3, 0x82, 0x0, 0x0, 0x0, 0xff, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
 249 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 250 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 251 0x42, 0x2, 0x83, 0x0, 0x0, 0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0,
 252 0x42, 0x2, 0x83, 0x0, 0x0, 0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0x0, 0xff,
 253 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 254 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 255 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 256 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 257 0x42, 0x2, 0x1, 0x82, 0x82, 0x0, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
 258]);
 259var astc_5x4_argb_hdr = new Uint8Array([
 260 //0x13, 0xab, 0xa1, 0x5c, 0x5, 0x4, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 261 0xc1, 0x2, 0x1, 0x42, 0x21, 0x0, 0x0, 0x80, 0x48, 0x22, 0x89, 0x24, 0x92, 0x48, 0x22, 0x9,
 262 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 263 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 264 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 265 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 266 0xc1, 0x2, 0x1, 0x42, 0x21, 0x0, 0x0, 0x0, 0x0, 0x20, 0x89, 0x24, 0x92, 0x48, 0x22, 0x89,
 267 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 268 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 269 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 270 0xc1, 0x2, 0x1, 0x42, 0x21, 0x0, 0x0, 0x80, 0x48, 0x22, 0x89, 0x24, 0x0, 0x40, 0x0, 0x80,
 271 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 272 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 273 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 274 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 275 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 276 0xc1, 0x2, 0x1, 0x42, 0x21, 0x0, 0x0, 0x0, 0x0, 0x0, 0x89, 0x24, 0x92, 0x48, 0x22, 0x89,
 277]);
 278var astc_5x5_argb_hdr = new Uint8Array([
 279 //0x13, 0xab, 0xa1, 0x5c, 0x5, 0x5, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 280 0xf3, 0x0, 0x81, 0xff, 0x7, 0x0, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
 281 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 282 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 283 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 284 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 285 0xf3, 0x0, 0x81, 0xff, 0x7, 0x0, 0x0, 0x0, 0xe, 0x0, 0x7, 0x80, 0xff, 0xff, 0xff, 0xff,
 286 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 287 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 288 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 289 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 290 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 291 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 292 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 293 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 294 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 295 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff,
 296]);
 297var astc_6x5_argb_hdr = new Uint8Array([
 298 //0x13, 0xab, 0xa1, 0x5c, 0x6, 0x5, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 299 0x63, 0x1, 0x81, 0x10, 0x0, 0x0, 0x48, 0x49, 0x29, 0x29, 0x25, 0xa5, 0xa4, 0x94, 0x94, 0x12,
 300 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 301 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 302 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 303 0x63, 0x1, 0x81, 0x10, 0x0, 0x0, 0x48, 0x0, 0x28, 0x0, 0x24, 0x0, 0xa4, 0x94, 0x94, 0x92,
 304 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 305 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 306 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 307 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 308 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 309 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 310 0x63, 0x1, 0x81, 0x10, 0x0, 0x0, 0x0, 0x48, 0x1, 0x28, 0x1, 0xa4, 0x0, 0x94, 0x0, 0x92,
 311]);
 312var astc_6x6_argb_hdr = new Uint8Array([
 313 //0x13, 0xab, 0xa1, 0x5c, 0x6, 0x6, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 314 0x4, 0x1, 0x1, 0xfc, 0xfd, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xff, 0x7f,
 315 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 316 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 317 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 318 0x4, 0x1, 0x1, 0xfc, 0xfd, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0xff, 0xc3, 0x30, 0xfc,
 319 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 320 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 321 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 322 0x4, 0x1, 0x1, 0xfc, 0xfd, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0xe3, 0xf8, 0xff, 0xff,
 323]);
 324var astc_8x5_argb_hdr = new Uint8Array([
 325 //0x13, 0xab, 0xa1, 0x5c, 0x8, 0x5, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 326 0x66, 0x0, 0xc1, 0xff, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
 327 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 328 0x66, 0x0, 0xc1, 0xff, 0x0, 0x0, 0xf0, 0xff, 0xf0, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff,
 329 0x66, 0x0, 0xc1, 0xff, 0x0, 0x0, 0xff, 0xf, 0xff, 0xf, 0xff, 0xf, 0xff, 0xff, 0xff, 0xff,
 330 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 331 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 332 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 333 0x66, 0x0, 0xc1, 0xff, 0x0, 0x0, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff,
 334]);
 335var astc_8x6_argb_hdr = new Uint8Array([
 336 //0x13, 0xab, 0xa1, 0x5c, 0x8, 0x6, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 337 0x54, 0x1, 0x81, 0x20, 0x0, 0x0, 0x70, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x3f,
 338 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 339 0x54, 0x1, 0x81, 0x20, 0x0, 0x0, 0x70, 0x7f, 0x7f, 0xf8, 0x7f, 0x56, 0x3f, 0x72, 0x7f, 0x7f,
 340 0x54, 0x1, 0x81, 0x20, 0x0, 0x0, 0x70, 0x7f, 0x7f, 0x7f, 0x3f, 0x72, 0x78, 0x7f, 0x70, 0x7f,
 341 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 342 0x54, 0x1, 0x81, 0x20, 0x0, 0x0, 0x50, 0x7f, 0x72, 0xfe, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
 343]);
 344var astc_8x8_argb_hdr = new Uint8Array([
 345 //0x13, 0xab, 0xa1, 0x5c, 0x8, 0x8, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 346 0x44, 0x5, 0x81, 0x3, 0x82, 0x0, 0x0, 0x0, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
 347 0x44, 0x5, 0x81, 0x3, 0x82, 0x0, 0x0, 0x0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
 348 0x44, 0x5, 0x1, 0x82, 0x82, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xfc,
 349 0x44, 0x5, 0x1, 0x82, 0x82, 0x0, 0x0, 0x0, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x3f,
 350]);
 351var astc_10x5_argb_hdr = new Uint8Array([
 352 //0x13, 0xab, 0xa1, 0x5c, 0xa, 0x5, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 353 0x65, 0x1, 0x1, 0xfc, 0xfd, 0x1, 0x0, 0x0, 0x0, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
 354 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 355 0x65, 0x1, 0x1, 0xfc, 0xfd, 0x1, 0x0, 0x0, 0x0, 0x0, 0xfc, 0xf0, 0xc3, 0xff, 0xff, 0xff,
 356 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 357 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 358 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 359 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 360 0x65, 0x1, 0x1, 0xfc, 0xfd, 0x1, 0x0, 0x0, 0x0, 0x0, 0xf8, 0xe0, 0x83, 0xf, 0x3e, 0xf8,
 361]);
 362var astc_10x6_argb_hdr = new Uint8Array([
 363 //0x13, 0xab, 0xa1, 0x5c, 0xa, 0x6, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 364 0xa4, 0x1, 0x1, 0xfc, 0xfd, 0x1, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
 365 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 366 0xa4, 0x1, 0x1, 0xfc, 0xfd, 0x1, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xf0, 0xc3, 0xf, 0xff, 0xff,
 367 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 368 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 369 0xa4, 0x1, 0x1, 0xfc, 0xfd, 0x1, 0x0, 0x0, 0x0, 0x3e, 0xf8, 0xe0, 0xff, 0xff, 0xff, 0xff,
 370]);
 371var astc_10x8_argb_hdr = new Uint8Array([
 372 //0x13, 0xab, 0xa1, 0x5c, 0xa, 0x8, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 373 0x65, 0x9, 0x69, 0x35, 0x0, 0x8, 0x10, 0x2, 0x0, 0x0, 0xfc, 0xe0, 0x3, 0x0, 0x0, 0x0,
 374 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 375 0x15, 0x11, 0x69, 0x25, 0x0, 0x84, 0x0, 0x10, 0x0, 0x2, 0x40, 0x88, 0x3f, 0x0, 0x3f, 0x0,
 376 0x44, 0x5, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
 377]);
 378var astc_10x10_argb_hdr = new Uint8Array([
 379 //0x13, 0xab, 0xa1, 0x5c, 0xa, 0xa, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 380 0xa4, 0xc9, 0xc, 0x3, 0x22, 0x0, 0x8, 0x40, 0x8, 0x3f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f,
 381 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 382 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 383 0x45, 0x89, 0x7, 0x35, 0x0, 0x40, 0x0, 0x82, 0x0, 0x0, 0x0, 0xe0, 0x83, 0xf, 0x3e, 0x0,
 384]);
 385var astc_12x10_argb_hdr = new Uint8Array([
 386 //0x13, 0xab, 0xa1, 0x5c, 0xc, 0xa, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 387 0x64, 0x8, 0x11, 0x3, 0x22, 0x0, 0x8, 0x40, 0x38, 0xfc, 0xc3, 0xff, 0xff, 0xff, 0xff, 0x7f,
 388 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 389 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 390 0x44, 0x10, 0x4a, 0x49, 0x46, 0xf, 0x1c, 0x3f, 0x0, 0x28, 0xff, 0x1, 0xc0, 0x3f, 0xc, 0x0,
 391]);
 392var astc_12x12_argb_hdr = new Uint8Array([
 393 //0x13, 0xab, 0xa1, 0x5c, 0xc, 0xc, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
 394 0x64, 0xa8, 0x21, 0x3, 0x22, 0x0, 0x8, 0x40, 0x38, 0xfc, 0xc3, 0xff, 0xff, 0xff, 0xff, 0x7f,
 395 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 396 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
 397 0x4, 0xd8, 0xe9, 0x2e, 0x0, 0x8, 0x1, 0x40, 0x80, 0xc0, 0x81, 0x28, 0x2a, 0x0, 0x0, 0x0,
 398]);
 399
 400// Decoded ASTC textures generated with ARM's ASTC encoder
 401// https://github.com/ARM-software/astc-encoder
 402
 403// As the original image is quite simple to compress,
 404// several decoded images share the same data
 405
 406// LDR decoded with the following command line:
 407// 'astcenc -d source.astc result.tga'
 408var decoded_4x4To10x6_argb_ldr = new Uint8Array([
 409 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 410 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 411 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 412 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 413 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 414 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 415 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 416 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 417 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 418 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 419 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 420 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 421 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 422 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 423 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 424 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 425 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 426 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 427 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 428 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 429 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 430 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 431 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 432 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 433 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 434 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 435 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 436 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 437 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 438 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 439 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 440 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 441 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 442 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 443 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 444 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 445 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 446 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 447 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 448 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 449 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 450 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 451 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 452 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 453 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 454 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 455 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 456 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 457 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 458 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 459 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 460 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 461 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 462 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 463 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 464 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 465 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 466 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 467 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 468 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 469 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 470 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 471 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 472 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 473]);
 474var decoded_10x8_argb_ldr = new Uint8Array([
 475 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 476 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 477 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 478 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xdf, 0x20, 0x0, 0xff, 0x20, 0xdf, 0x0, 0xff,
 479 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 480 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 481 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 482 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 483 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 484 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 485 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 486 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 487 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 488 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 489 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 490 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 491 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 492 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 493 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 494 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 495 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 496 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 497 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 498 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 499 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 500 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 501 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 502 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 503 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 504 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 505 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 506 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 507 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 508 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 509 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 510 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 511 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 512 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 513 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 514 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 515 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 516 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 517 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 518 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 519 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 520 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 521 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 522 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 523 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 524 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 525 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 526 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 527 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 528 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 529 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 530 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 531 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 532 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 533 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 534 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 535 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 536 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 537 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 538 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 539]);
 540var decoded_10x10_argb_ldr = new Uint8Array([
 541 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 542 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 543 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 544 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 545 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 546 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 547 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 548 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 549 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 550 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 551 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 552 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 553 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 554 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 555 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 556 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 557 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 558 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 559 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 560 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 561 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 562 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 563 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 564 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 565 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 566 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 567 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 568 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 569 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 570 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 571 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 572 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 573 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 574 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x20, 0xdf, 0x0, 0xff, 0x20, 0xdf, 0x0, 0xff,
 575 0x20, 0xdf, 0x0, 0xff, 0x20, 0xdf, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 576 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 577 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 578 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 579 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 580 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 581 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 582 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 583 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 584 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 585 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 586 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 587 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 588 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 589 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 590 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 591 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 592 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 593 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 594 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 595 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 596 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 597 0x8f, 0x70, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 598 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 599 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 600 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 601 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 602 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 603 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 604 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 605]);
 606var decoded_12x10_argb_ldr = new Uint8Array([
 607 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 608 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 609 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 610 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 611 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 612 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 613 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 614 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 615 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 616 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 617 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 618 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 619 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 620 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 621 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 622 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 623 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 624 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 625 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 626 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 627 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 628 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 629 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 630 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 631 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 632 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 633 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 634 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 635 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 636 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 637 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 638 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 639 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 640 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 641 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 642 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 643 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 644 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 645 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 646 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 647 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 648 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 649 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 650 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 651 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 652 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 653 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 654 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 655 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 656 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 657 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 658 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 659 0xdf, 0x20, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 660 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 661 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 662 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 663 0x70, 0x8f, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 664 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 665 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 666 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 667 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 668 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 669 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 670 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 671]);
 672var decoded_12x12_argb_ldr = new Uint8Array([
 673 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 674 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 675 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 676 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 677 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 678 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 679 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 680 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 681 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 682 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 683 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 684 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 685 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 686 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 687 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 688 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 689 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 690 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 691 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 692 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 693 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 694 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 695 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 696 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 697 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 698 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 699 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 700 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 701 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 702 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x10, 0xef, 0x0, 0xff, 0x10, 0xef, 0x0, 0xff,
 703 0x10, 0xef, 0x0, 0xff, 0x10, 0xef, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 704 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 705 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 706 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x70, 0x8f, 0x0, 0xff, 0x70, 0x8f, 0x0, 0xff,
 707 0x70, 0x8f, 0x0, 0xff, 0x70, 0x8f, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 708 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 709 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 710 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xcf, 0x30, 0x0, 0xff, 0xcf, 0x30, 0x0, 0xff,
 711 0xcf, 0x30, 0x0, 0xff, 0xcf, 0x30, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 712 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 713 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 714 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 715 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 716 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 717 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 718 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 719 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 720 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 721 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 722 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 723 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 724 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 725 0xbf, 0x40, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 726 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 727 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 728 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 729 0x60, 0x9f, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 730 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 731 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 732 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 733 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 734 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 735 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 736 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 737]);
 738
 739// HDR decoded with the following command line:
 740// 'astcenc -d source.astc result.tga'
 741
 742var decoded_4x4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0, 0xff,
 935 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 936 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 937 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 938 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 939]);
 940var decoded_6x5_argb_hdr = new Uint8Array([
 941 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 942 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 943 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 944 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 945 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 946 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 947 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 948 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0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xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 997 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 998 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 999 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1000 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1001 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1002 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1003 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1004 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1005]);
 1006var decoded_6x6_argb_hdr = new Uint8Array([
 1007 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1008 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1009 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0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 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1093 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1094 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1095 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1096 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1097 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1098 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 1099 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1100 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1101 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1102 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 1103 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1104 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1105 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1106 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 1107 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1108 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1109 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1110 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1111 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1112 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1113 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1114 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1115 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1116 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff,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ff, 0xfe, 0x0, 0x0, 0xff,
 1129 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1130 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1131 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1132 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1133 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1134 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1135 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1136 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1137]);
 1138var decoded_8x6_argb_hdr = new Uint8Array([
 1139 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1140 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1141 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1142 0xff, 0x0, 0x0,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x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1155 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1156 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1157 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1158 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1159 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1160 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1161 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1162 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1163 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1164 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 1165 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1166 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1167 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1168 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 1169 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1170 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1171 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1172 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 1173 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1174 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1175 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1176 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1177 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1178 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff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xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1335 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1336]);
 1337
 1338var decoded_10x8_argb_hdr = new Uint8Array([
 1339 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1340 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1341 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1342 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xdf, 0x20, 0x0, 0xff, 0x20, 0xdf, 0x0, 0xff,
 1343 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1344 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1345 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1346 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1347 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1348 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0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x0, 0xff,
 1361 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1362 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1363 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1364 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 1365 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1366 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1367 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1368 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 1369 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1370 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1371 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1372 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 1373 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, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1458 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1459 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1460 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1461 0x8f, 0x70, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1462 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1463 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1464 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1465 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1466 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1467 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1468 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1469]);
 1470var decoded_12x10_arg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, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1495 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1496 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 1497 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1498 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1499 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1500 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 1501 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1502 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1503 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1504 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 1505 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1506 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1507 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1508 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1509 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1510 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1511 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1512 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1513 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1514 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1515 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1516 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1517 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1518 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1519 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1520 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1521 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1522 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1523 0xdf, 0x20, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1524 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1525 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1526 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1527 0x70, 0x8f, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1528 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1529 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1530 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1531 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1532 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1533 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1534 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1535]);
 1536var decoded_12x12_argb_hdr = new Uint8Array([
 1537 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1538 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1539 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1540 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
 1541 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1542 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1543 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0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x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1556 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1557 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1558 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1559 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1560 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1561 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1562 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
 1563 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1564 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1565 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1566 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x10, 0xef, 0x0, 0xff, 0x10, 0xef, 0x0, 0xff,
 1567 0x10, 0xef, 0x0, 0xff, 0x10, 0xef, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1568 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1569 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1570 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x70, 0x8f, 0x0, 0xff, 0x70, 0x8f, 0x0, 0xff,
 1571 0x70, 0x8f, 0x0, 0xff, 0x70, 0x8f, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1572 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1573 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1574 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xcf, 0x30, 0x0, 0xff, 0xcf, 0x30, 0x0, 0xff,
 1575 0xcf, 0x30, 0x0, 0xff, 0xcf, 0x30, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1576 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1577 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1578 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1579 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1580 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1581 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1582 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1583 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1584 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1585 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1586 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1587 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1588 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1589 0xbf, 0x40, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1590 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1591 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1592 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1593 0x60, 0x9f, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1594 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1595 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1596 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1597 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1598 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1599 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
 1600 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
 1601]);
 1602
 1603var wtu = WebGLTestUtils;
 1604var contextVersion = wtu.getDefault3DContextVersion();
 1605var canvas = document.getElementById("canvas");
 1606var gl = wtu.create3DContext(canvas, {antialias: false});
 1607var program = wtu.setupTexturedQuad(gl);
 1608var extFlag = "WEBGL_compressed_texture_astc";
 1609var ext = null;
 1610var vao = null;
 1611var validFormats = {
 1612
 1613 COMPRESSED_RGBA_ASTC_4x4_KHR : 0x93B0,
 1614 COMPRESSED_RGBA_ASTC_5x4_KHR : 0x93B1,
 1615 COMPRESSED_RGBA_ASTC_5x5_KHR : 0x93B2,
 1616 COMPRESSED_RGBA_ASTC_6x5_KHR : 0x93B3,
 1617 COMPRESSED_RGBA_ASTC_6x6_KHR : 0x93B4,
 1618 COMPRESSED_RGBA_ASTC_8x5_KHR : 0x93B5,
 1619 COMPRESSED_RGBA_ASTC_8x6_KHR : 0x93B6,
 1620 COMPRESSED_RGBA_ASTC_8x8_KHR : 0x93B7,
 1621 COMPRESSED_RGBA_ASTC_10x5_KHR : 0x93B8,
 1622 COMPRESSED_RGBA_ASTC_10x6_KHR : 0x93B9,
 1623 COMPRESSED_RGBA_ASTC_10x8_KHR : 0x93BA,
 1624 COMPRESSED_RGBA_ASTC_10x10_KHR : 0x93BB,
 1625 COMPRESSED_RGBA_ASTC_12x10_KHR : 0x93BC,
 1626 COMPRESSED_RGBA_ASTC_12x12_KHR : 0x93BD,
 1627 COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : 0x93D0,
 1628 COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : 0x93D1,
 1629 COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : 0x93D2,
 1630 COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : 0x93D3,
 1631 COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : 0x93D4,
 1632 COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : 0x93D5,
 1633 COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : 0x93D6,
 1634 COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : 0x93D7,
 1635 COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : 0x93D8,
 1636 COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : 0x93D9,
 1637 COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : 0x93DA,
 1638 COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : 0x93DB,
 1639 COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : 0x93DC,
 1640 COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : 0x93DD
 1641
 1642};
 1643var name;
 1644var supportedFormats;
 1645
 1646if (!gl) {
 1647 testFailed("WebGL context does not exist");
 1648} else {
 1649 testPassed("WebGL context exists");
 1650
 1651 // Run tests with extension disabled
 1652 runTestDisabled();
 1653 debug("");
 1654
 1655 // Query the extension and store globally so shouldBe can access it
 1656 ext = wtu.getExtensionWithKnownPrefixes(gl, extFlag);
 1657 if (!ext) {
 1658 testPassed("No WEBGL_compressed_texture_astc support -- this is legal");
 1659 runSupportedTest(false);
 1660 } else {
 1661 testPassed("Successfully enabled WEBGL_compressed_texture_astc extension");
 1662
 1663 debug("");
 1664 runSupportedTest(true);
 1665 runTestExtension();
 1666 }
 1667}
 1668
 1669function runSupportedTest(extensionEnabled) {
 1670 var name = wtu.getSupportedExtensionWithKnownPrefixes(gl, extFlag);
 1671 if (name !== undefined) {
 1672 if (extensionEnabled) {
 1673 testPassed("WEBGL_compressed_texture_astc listed as supported and getExtension succeeded");
 1674 } else {
 1675 testFailed("WEBGL_compressed_texture_astc listed as supported but getExtension failed");
 1676 }
 1677 } else {
 1678 if (extensionEnabled) {
 1679 testFailed("WEBGL_compressed_texture_astc not listed as supported but getExtension succeeded");
 1680 } else {
 1681 testPassed("WEBGL_compressed_texture_astc not listed as supported and getExtension failed -- this is legal");
 1682 }
 1683 }
 1684}
 1685
 1686
 1687function runTestDisabled() {
 1688 debug("Testing binding enum with extension disabled");
 1689
 1690 supportedFormats = gl.getParameter(gl.COMPRESSED_TEXTURE_FORMATS);
 1691 shouldBe("supportedFormats", "[]");
 1692}
 1693
 1694function runTestExtension() {
 1695 debug("");
 1696 debug("Testing " + extFlag);
 1697
 1698 supportedFormats = gl.getParameter(gl.COMPRESSED_TEXTURE_FORMATS);
 1699 // There should be exactly 28 formats for both WebGL 1.0 and WebGL 2.0.
 1700 shouldBe("supportedFormats.length", "28");
 1701
 1702 console.log(wtu);
 1703
 1704 // check that all 28 formats exist
 1705 testFormatsExist(supportedFormats);
 1706 // check that all format enums exist.
 1707 testCompressionFormatsValidity();
 1708 // check that the specified restrictions fails with
 1709 // an INVALID_VALUE error when not respected
 1710 testASTCFormatsRestrictions();
 1711 // Tests ASTC texture with every format
 1712 testLDRTextures();
 1713 testHDRTextures();
 1714}
 1715
 1716function testFormatsExist(supportedFormats) {
 1717 debug("");
 1718 debug("Testing every supported formats exist");
 1719
 1720 var failed;
 1721 for (var name in validFormats) {
 1722 var format = validFormats[name];
 1723 failed = true;
 1724 for (var ii = 0; ii < supportedFormats.length; ++ii) {
 1725 if (format == supportedFormats[ii]) {
 1726 testPassed("supported format " + formatToString(format) + " exists");
 1727 failed = false;
 1728 break;
 1729 }
 1730 }
 1731 if (failed) {
 1732 testFailed("supported format " + formatToString(format) + " does not exist");
 1733 }
 1734 }
 1735}
 1736
 1737function testCompressionFormatsValidity() {
 1738 debug("");
 1739 debug("Testing every supported formats is valid");
 1740
 1741 for (name in validFormats) {
 1742 var expected = "0x" + validFormats[name].toString(16);
 1743 var actual = "ext['" + name + "']";
 1744 shouldBe(actual, expected);
 1745 }
 1746}
 1747
 1748function testASTCFormatsRestrictions() {
 1749 debug("");
 1750 debug("Testing format restrictions on buffer size");
 1751
 1752 var data = new Uint8Array(17);
 1753
 1754 var tex = gl.createTexture();
 1755 gl.bindTexture(gl.TEXTURE_2D, tex);
 1756 for (var formatId in validFormats) {
 1757 var format = validFormats[formatId];
 1758 var expectedSize = expectedByteLength(16, 16, format, data.length);
 1759 gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, 16, 16, 0, data);
 1760 wtu.glErrorShouldBe(gl, gl.INVALID_VALUE,
 1761 formatToString(format) + " expected size: " + expectedSize);
 1762 }
 1763}
 1764
 1765function testLDRTextures() {
 1766 debug("");
 1767 debug("Testing every LDR texture format compression");
 1768
 1769 var data = [];
 1770 var formats = [];
 1771 var raws = [];
 1772
 1773 data.push(astc_4x4_argb_ldr, astc_5x4_argb_ldr, astc_5x5_argb_ldr,
 1774 astc_6x5_argb_ldr, astc_6x6_argb_ldr, astc_8x5_argb_ldr,
 1775 astc_8x6_argb_ldr, astc_8x8_argb_ldr, astc_10x5_argb_ldr,
 1776 astc_10x6_argb_ldr, astc_10x8_argb_ldr, astc_10x10_argb_ldr,
 1777 astc_12x10_argb_ldr, astc_12x12_argb_ldr);
 1778
 1779 formats.push(ext.COMPRESSED_RGBA_ASTC_4x4_KHR, ext.COMPRESSED_RGBA_ASTC_5x4_KHR,
 1780 ext.COMPRESSED_RGBA_ASTC_5x5_KHR, ext.COMPRESSED_RGBA_ASTC_6x5_KHR,
 1781 ext.COMPRESSED_RGBA_ASTC_6x6_KHR, ext.COMPRESSED_RGBA_ASTC_8x5_KHR,
 1782 ext.COMPRESSED_RGBA_ASTC_8x6_KHR, ext.COMPRESSED_RGBA_ASTC_8x8_KHR,
 1783 ext.COMPRESSED_RGBA_ASTC_10x5_KHR, ext.COMPRESSED_RGBA_ASTC_10x6_KHR,
 1784 ext.COMPRESSED_RGBA_ASTC_10x8_KHR, ext.COMPRESSED_RGBA_ASTC_10x10_KHR,
 1785 ext.COMPRESSED_RGBA_ASTC_12x10_KHR, ext.COMPRESSED_RGBA_ASTC_12x12_KHR);
 1786
 1787 // adds decoded image to use in the compare function
 1788 // certain block size share the same decoded data
 1789 // due to the fact that the test image is quite simple
 1790 for (var i = 0; i < 10; ++i)
 1791 raws.push(decoded_4x4To10x6_argb_ldr);
 1792 raws.push(decoded_10x8_argb_ldr, decoded_10x10_argb_ldr, decoded_12x10_argb_ldr, decoded_12x12_argb_ldr);
 1793
 1794 testASTCTextures(buildTests(data, formats, raws, 'LDR'));
 1795}
 1796
 1797function testHDRTextures() {
 1798 debug("");
 1799 debug("Testing every HDR texture format compression");
 1800
 1801
 1802 var data = [];
 1803 var formats = [];
 1804 var raws = [];
 1805
 1806 data.push(astc_4x4_argb_hdr, astc_5x4_argb_hdr, astc_5x5_argb_hdr,
 1807 astc_6x5_argb_hdr, astc_6x6_argb_hdr, astc_8x5_argb_hdr,
 1808 astc_8x6_argb_hdr, astc_8x8_argb_hdr, astc_10x5_argb_hdr,
 1809 astc_10x6_argb_hdr, astc_10x8_argb_hdr, astc_10x10_argb_hdr,
 1810 astc_12x10_argb_hdr, astc_12x12_argb_hdr);
 1811
 1812 formats.push(ext.COMPRESSED_RGBA_ASTC_4x4_KHR, ext.COMPRESSED_RGBA_ASTC_5x4_KHR,
 1813 ext.COMPRESSED_RGBA_ASTC_5x5_KHR, ext.COMPRESSED_RGBA_ASTC_6x5_KHR,
 1814 ext.COMPRESSED_RGBA_ASTC_6x6_KHR, ext.COMPRESSED_RGBA_ASTC_8x5_KHR,
 1815 ext.COMPRESSED_RGBA_ASTC_8x6_KHR, ext.COMPRESSED_RGBA_ASTC_8x8_KHR,
 1816 ext.COMPRESSED_RGBA_ASTC_10x5_KHR, ext.COMPRESSED_RGBA_ASTC_10x6_KHR,
 1817 ext.COMPRESSED_RGBA_ASTC_10x8_KHR, ext.COMPRESSED_RGBA_ASTC_10x10_KHR,
 1818 ext.COMPRESSED_RGBA_ASTC_12x10_KHR, ext.COMPRESSED_RGBA_ASTC_12x12_KHR);
 1819
 1820 // adds decoded image to use in the compare function
 1821 // certain block size share the same decoded data
 1822 // due to the fact that the test image is quite simple
 1823 raws.push(decoded_4x4_argb_hdr, decoded_5x4_argb_hdr, decoded_5x5_argb_hdr, decoded_6x5_argb_hdr,
 1824 decoded_6x6_argb_hdr, decoded_8x5_argb_hdr, decoded_8x6_argb_hdr, decoded_8x8_argb_hdr,
 1825 decoded_10x5To10x6_argb_hdr, decoded_10x5To10x6_argb_hdr, decoded_10x8_argb_hdr,
 1826 decoded_10x10_argb_hdr, decoded_12x10_argb_hdr, decoded_12x12_argb_hdr);
 1827
 1828 testASTCTextures(buildTests(data, formats, raws, 'HDR'));
 1829}
 1830
 1831function testASTCTextures(tests) {
 1832 debug("<hr/>");
 1833 for (var i = 0; i < tests.length; ++i) {
 1834 testASTCTexture(tests[i], false);
 1835 if (contextVersion >= 2) {
 1836 debug("<br/>");
 1837 testASTCTexture(tests[i], true);
 1838 }
 1839 }
 1840}
 1841
 1842function testASTCTexture(test, useTexStorage) {
 1843 var data = test.data;
 1844 var width = test.width;
 1845 var height = test.height;
 1846 var format = test.format;
 1847 var raw = test.raw;
 1848
 1849 canvas.width = width;
 1850 canvas.height = height;
 1851 gl.viewport(0, 0, width, height);
 1852 debug("");
 1853 debug("testing " + formatToString(format) + " " + width + "x" + height + " (" + test.mode + ")" +
 1854 (useTexStorage ? " via texStorage2D" : " via compressedTexImage2D"));
 1855 debug("");
 1856
 1857 // Texture upload
 1858 var tex = gl.createTexture();
 1859 gl.bindTexture(gl.TEXTURE_2D, tex);
 1860 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
 1861 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
 1862 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
 1863 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
 1864 if (useTexStorage) {
 1865 gl.texStorage2D(gl.TEXTURE_2D, 1, format, width, height);
 1866 wtu.glErrorShouldBe(gl, gl.NO_ERROR, "allocating compressed texture via texStorage2D");
 1867 wtu.clearAndDrawUnitQuad(gl);
 1868 wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing unit quad");
 1869 var clearColor = [0, 0, 0, 0];
 1870 wtu.checkCanvas(gl, clearColor, "texture should be initialized to black");
 1871 gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, format, data);
 1872 wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading compressed texture data via compressedTexSubImage2D");
 1873 } else {
 1874 gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width, height, 0, data);
 1875 wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading compressed texture");
 1876 }
 1877
 1878 wtu.clearAndDrawUnitQuad(gl);
 1879
 1880 // Check that the decoded image is consistent with NEAREST filtering
 1881 compareRect(width, height, test.channels, width, height, raw, data, format, undefined, "NEAREST");
 1882
 1883 // Check that the decoded image is consistent with LINEAR filtering
 1884 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
 1885 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
 1886 wtu.clearAndDrawUnitQuad(gl);
 1887 compareRect(width, height, test.channels, width, height, raw, data, format, undefined, "LINEAR");
 1888
 1889 debug("");
 1890 // Mipmaps handling
 1891 gl.generateMipmap(gl.TEXTURE_2D);
 1892 wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "trying to generate mipmaps from compressed texture");
 1893
 1894 if (!useTexStorage) {
 1895 gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width, height, 1, data);
 1896 wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "non 0 border");
 1897 }
 1898
 1899 debug("");
 1900 gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, format, data);
 1901 wtu.glErrorShouldBe(gl, gl.NO_ERROR, "compressedTexSubImage2D allowed for reloading of complete textures");
 1902}
 1903
 1904function compareRect(
 1905 actualWidth, actualHeight, actualChannels,
 1906 dataWidth, dataHeight, expectedData,
 1907 testData, testFormat, tolerance, filteringMode) {
 1908
 1909 if(typeof(tolerance) == 'undefined') { tolerance = 5; }
 1910 var actual = new Uint8Array(actualWidth * actualHeight * 4);
 1911 gl.readPixels(0, 0, actualWidth, actualHeight, gl.RGBA, gl.UNSIGNED_BYTE, actual);
 1912 flipImage(actual, actualWidth, actualHeight);
 1913
 1914 var div = document.createElement("div");
 1915 div.className = "testimages";
 1916 insertImg(div, "expected", makeImage(
 1917 actualWidth, actualHeight, dataWidth, expectedData,
 1918 actualChannels == 4));
 1919 insertImg(div, "actual", makeImage(
 1920 actualWidth, actualHeight, actualWidth, actual,
 1921 actualChannels == 4));
 1922 div.appendChild(document.createElement('br'));
 1923 document.getElementById("console").appendChild(div);
 1924
 1925 var failed = false;
 1926 for (var yy = 0; yy < actualHeight; ++yy) {
 1927 for (var xx = 0; xx < actualWidth; ++xx) {
 1928 var actualOffset = (yy * actualWidth + xx) * 4;
 1929 var expectedOffset = (yy * dataWidth + xx) * 4;
 1930 var expected = [
 1931 expectedData[expectedOffset + 0],
 1932 expectedData[expectedOffset + 1],
 1933 expectedData[expectedOffset + 2],
 1934 (actualChannels == 3 ? 255 : expectedData[expectedOffset + 3])
 1935 ];
 1936 for (var jj = 0; jj < 4; ++jj) {
 1937 if (Math.abs(actual[actualOffset + jj] - expected[jj]) > tolerance) {
 1938 failed = true;
 1939 var was = actual[actualOffset + 0].toString();
 1940 for (var j = 1; j < 4; ++j) {
 1941 was += "," + actual[actualOffset + j];
 1942 }
 1943 testFailed('at (' + xx + ', ' + yy +
 1944 ') expected: ' + expected + ' was ' + was);
 1945 }
 1946 }
 1947 }
 1948 }
 1949 if (!failed) {
 1950 testPassed("texture rendered correctly with " + filteringMode + " filtering");
 1951 }
 1952}
 1953
 1954// Builds several tests from two arrays
 1955// data gives each Uint8Array encoded data to use
 1956// formats the associate format to decode the data
 1957// raws gives each decoded Uint8Array data for texture comparison
 1958// mode 'LDR' or 'HDR'
 1959function buildTests(data, formats, raws, mode) {
 1960
 1961 var tests = [];
 1962 for (var i = 0; i < data.length; ++i) {
 1963 var test = {
 1964 width: 16,
 1965 height: 16,
 1966 channels: 4,
 1967 data: data[i],
 1968 format: formats[i],
 1969 raw: raws[i],
 1970 mode: mode
 1971 };
 1972 tests.push(test);
 1973 }
 1974
 1975 return tests;
 1976}
 1977
 1978function formatToString(format) {
 1979 for (var p in ext) {
 1980 if (ext[p] == format) {
 1981 return p;
 1982 }
 1983 }
 1984 return "0x" + format.toString(16);
 1985}
 1986
 1987function expectedByteLength(w, h, format) {
 1988
 1989 if (format == ext.COMPRESSED_RGBA_ASTC_4x4_KHR)
 1990 return Math.floor((w + 3) / 4) * Math.floor((h + 3) / 4) * 16;
 1991 else if (format == ext.COMPRESSED_RGBA_ASTC_5x4_KHR)
 1992 return Math.floor((w + 4) / 5) * Math.floor((h + 3) / 4) * 16;
 1993 else if (format == ext.COMPRESSED_RGBA_ASTC_5x5_KHR)
 1994 return Math.floor((w + 4) / 5) * Math.floor((h + 4) / 5) * 16;
 1995 else if (format == ext.COMPRESSED_RGBA_ASTC_6x5_KHR)
 1996 return Math.floor((w + 5) / 6) * Math.floor((h + 4) / 5) * 16;
 1997 else if (format == ext.COMPRESSED_RGBA_ASTC_6x6_KHR)
 1998 return Math.floor((w + 5) / 6) * Math.floor((h + 5) / 6) * 16;
 1999 else if (format == ext.COMPRESSED_RGBA_ASTC_8x5_KHR)
 2000 return Math.floor((w + 7) / 8) * Math.floor((h + 4) / 5) * 16;
 2001 else if (format == ext.COMPRESSED_RGBA_ASTC_8x6_KHR)
 2002 return Math.floor((w + 7) / 8) * Math.floor((h + 5) / 6) * 16;
 2003 else if (format == ext.COMPRESSED_RGBA_ASTC_8x8_KHR)
 2004 return Math.floor((w + 7) / 8) * Math.floor((h + 7) / 8) * 16;
 2005 else if (format == ext.COMPRESSED_RGBA_ASTC_10x5_KHR)
 2006 return Math.floor((w + 9) / 10) * Math.floor((h + 4) / 5) * 16;
 2007 else if (format == ext.COMPRESSED_RGBA_ASTC_10x6_KHR)
 2008 return Math.floor((w + 9) / 10) * Math.floor((h + 5) / 6) * 16;
 2009 else if (format == ext.COMPRESSED_RGBA_ASTC_10x8_KHR)
 2010 return Math.floor((w + 9) / 10) * Math.floor((h + 7) / 8) * 16;
 2011 else if (format == ext.COMPRESSED_RGBA_ASTC_10x10_KHR)
 2012 return Math.floor((w + 9) / 10) * Math.floor((h + 9) / 10) * 16;
 2013 else if (format == ext.COMPRESSED_RGBA_ASTC_12x10_KHR)
 2014 return Math.floor((w + 11) / 12) * Math.floor((h + 9) / 10) * 16;
 2015
 2016 return Math.floor((w + 11) / 12) * Math.floor((h + 11) / 12) * 16;
 2017}
 2018
 2019function insertImg(element, caption, img) {
 2020 var div = document.createElement("div");
 2021 div.appendChild(img);
 2022 var label = document.createElement("div");
 2023 label.appendChild(document.createTextNode(caption));
 2024 div.appendChild(label);
 2025 element.appendChild(div);
 2026}
 2027
 2028function makeImage(imageWidth, imageHeight, dataWidth, data, alpha) {
 2029 var scale = 8;
 2030 var c = document.createElement("canvas");
 2031 c.width = imageWidth * scale;
 2032 c.height = imageHeight * scale;
 2033 var ctx = c.getContext("2d");
 2034 for (var yy = 0; yy < imageHeight; ++yy) {
 2035 for (var xx = 0; xx < imageWidth; ++xx) {
 2036 var offset = (yy * dataWidth + xx) * 4;
 2037 ctx.fillStyle = "rgba(" +
 2038 data[offset + 0] + "," +
 2039 data[offset + 1] + "," +
 2040 data[offset + 2] + "," +
 2041 (alpha ? data[offset + 3] / 255 : 1) + ")";
 2042 ctx.fillRect(xx * scale, yy * scale, scale, scale);
 2043 }
 2044 }
 2045 return wtu.makeImageFromCanvas(c);
 2046}
 2047
 2048// Swaps two cells in an arraybuffer.
 2049// this function is used in the image flipping function
 2050function swapCell(array, i, j) {
 2051 var a = array[i];
 2052 array[i] = array[j];
 2053 array[j] = a;
 2054}
 2055
 2056function flipImage(imgBuffer, w, h) {
 2057 var halfHeight = h / 2;
 2058
 2059 for (var j = 0; j < halfHeight; j++) {
 2060 for (var i = 0; i < w; i++) {
 2061 var beginByte = (j * w + i) * 4;
 2062 var endByte = ((h - j - 1) * w + i) * 4;
 2063
 2064 swapCell(imgBuffer, beginByte, endByte);
 2065 swapCell(imgBuffer, beginByte + 1, endByte + 1);
 2066 swapCell(imgBuffer, beginByte + 2, endByte + 2);
 2067 swapCell(imgBuffer, beginByte + 3, endByte + 3);
 2068 }
 2069 }
 2070}
 2071
 2072debug("");
 2073var successfullyParsed = true;
 2074</script>
 2075<script src="./resources/js-test-post.js"></script>
 2076
 2077</body>
 2078</html>