Name Description Size
BasicRenderingContext2D.h BasicRenderingContext2D 6587
CacheInvalidator.cpp 1293
CacheInvalidator.h 4538
CanvasGradient.h 1984
CanvasImageCache.cpp Used for images specific to this one canvas. Required due to CORS security. 10601
CanvasImageCache.h Notify that image element aImage was drawn to aCanvas element using the first frame of aRequest's image. The data for the surface is in aSurface, and the image size is in aSize. aIntrinsicSize is the size the surface is intended to be rendered at. 1914
CanvasPath.h CanvasPath_h 3108
CanvasPattern.h 2005
CanvasRenderingContext2D.cpp Memory reporter stuff 181184
CanvasRenderingContext2D.h CanvasRenderingContext2D 37547
CanvasRenderingContextHelper.cpp 8812
CanvasRenderingContextHelper.h Povides common RenderingContext functionality used by both OffscreenCanvas and HTMLCanvasElement. 2561
CanvasUtils.cpp 9972
CanvasUtils.h Float validation stuff 5407
crashtests 62
ImageBitmap.cpp This class observes shutdown notifications and sends that notification to the worker thread if the image bitmap is on a worker thread. 54902
ImageBitmap.h ImageBitmap is an opaque handler to several kinds of image-like objects from HTMLImageElement, HTMLVideoElement, HTMLCanvasElement, ImageData to CanvasRenderingContext2D and Image Blob. An ImageBitmap could be painted to a canvas element. Generally, an ImageBitmap only keeps a reference to its source object's buffer, but if the source object is an ImageData, an Blob or a HTMLCanvasElement with WebGL rendering context, the ImageBitmap copy the source object's buffer. 8957
ImageBitmapRenderingContext.cpp 7527
ImageBitmapRenderingContext.h The purpose of ImageBitmapRenderingContext is to provide a faster and efficient way to display ImageBitmap. Simply call TransferFromImageBitmap() then we'll transfer the surface of ImageBitmap to this context and then to use it to display. See more details in spec: https://wiki.whatwg.org/wiki/OffscreenCanvas 3128
ImageBitmapSource.h 850
ImageData.cpp 4444
ImageData.h 2421
ImageUtils.cpp 6764
ImageUtils.h ImageUtils is a wrapper around layers::Image. It provides three unified methods to all sub-classes of layers::Image, which are: (1) GetFormat() converts the image's format into ImageBitmapFormat enum. (2) GetBufferLength() returns the number of bytes that are used to store the image's underlying raw data. In theory, the functionalities of this class could be merged into the interface of layers::Image. However, this is designed as a isolated wrapper because we don't want to pollute the layers::Image's interface with methods that are only meaningful to the ImageBitmap. 1837
moz.build 6179
MurmurHash3.cpp 8477
MurmurHash3.h 842
nsICanvasRenderingContextInternal.h 7765
OffscreenCanvas.cpp static 10729
OffscreenCanvas.h 5158
test 202
TextMetrics.h 1067
TexUnpackBlob.cpp 29051
TexUnpackBlob.h 5405
WebGL1Context.cpp static 1008
WebGL1Context.h 915
WebGL2Context.cpp static 5699
WebGL2Context.h 20175
WebGL2ContextBuffers.cpp 5629
WebGL2ContextFramebuffers.cpp 8107
WebGL2ContextMRTs.cpp 5088
WebGL2ContextPrograms.cpp 834
WebGL2ContextQueries.cpp We fake ANY_SAMPLES_PASSED and ANY_SAMPLES_PASSED_CONSERVATIVE with SAMPLES_PASSED on desktop. OpenGL ES 3.0 spec 4.1.6: If the target of the query is ANY_SAMPLES_PASSED_CONSERVATIVE, an implementation may choose to use a less precise version of the test which can additionally set the samples-boolean state to TRUE in some other implementation-dependent cases. 4664
WebGL2ContextRenderbuffers.cpp 2762
WebGL2ContextSamplers.cpp 3396
WebGL2ContextState.cpp GLboolean 6848
WebGL2ContextSync.cpp 4293
WebGL2ContextTextures.cpp virtual 1449
WebGL2ContextTransformFeedback.cpp 3968
WebGL2ContextUniforms.cpp 8647
WebGL2ContextVAOs.cpp 633
WebGLActiveInfo.cpp 5541
WebGLActiveInfo.h GLES 2.0.25, p33: This command will return as much information about active attributes as possible. If no information is available, length will be set to zero and name will be an empty string. This situation could arise if GetActiveAttrib is issued after a failed link. It's the same for GetActiveUniform. 2906
WebGLBuffer.cpp 11940
WebGLBuffer.h 2819
WebGLContext.cpp 80868
WebGLContext.h 81637
WebGLContextBuffers.cpp 11991
WebGLContextDraw.cpp 34272
WebGLContextExtensions.cpp static 17091
WebGLContextFramebufferOperations.cpp 6179
WebGLContextGL.cpp 70665
WebGLContextLossHandler.cpp 2668
WebGLContextLossHandler.h 1226
WebGLContextState.cpp 19754
WebGLContextTextures.cpp virtual 11105
WebGLContextUtils.cpp ES2 section 2.5 "GL Errors" states that implementations can have multiple 'flags', as errors might be caught in different parts of a distributed implementation. We're signing up as a distributed implementation here, with separate flags for WebGL and the underlying GLContext. 24285
WebGLContextUtils.h Return the displayable name for the texture function that is the source for validation. 3113
WebGLContextValidate.cpp 23794
WebGLContextVertexArray.cpp 1543
WebGLContextVertices.cpp 11479
WebGLExtensionBlendMinMax.cpp 887
WebGLExtensionColorBufferFloat.cpp 1841
WebGLExtensionColorBufferHalfFloat.cpp 2042
WebGLExtensionCompressedTextureASTC.cpp 3475
WebGLExtensionCompressedTextureBPTC.cpp 1520
WebGLExtensionCompressedTextureES3.cpp 2358
WebGLExtensionCompressedTextureETC1.cpp 1256
WebGLExtensionCompressedTexturePVRTC.cpp 1407
WebGLExtensionCompressedTextureRGTC.cpp 1488
WebGLExtensionCompressedTextureS3TC_SRGB.cpp 1995
WebGLExtensionCompressedTextureS3TC.cpp 1917
WebGLExtensionDebugRendererInfo.cpp 755
WebGLExtensionDebugShaders.cpp 1364
WebGLExtensionDepthTexture.cpp 2044
WebGLExtensionDisjointTimerQuery.cpp 3904
WebGLExtensionDrawBuffers.cpp 1566
WebGLExtensionElementIndexUint.cpp 770
WebGLExtensionEXTColorBufferFloat.cpp static 1446
WebGLExtensionFragDepth.cpp 1137
WebGLExtensionInstancedArrays.cpp 2298
WebGLExtensionLoseContext.cpp 899
WebGLExtensionMOZDebug.cpp 2479
WebGLExtensions.cpp 4110
WebGLExtensions.h 12784
WebGLExtensionShaderTextureLod.cpp 1249
WebGLExtensionSRGB.cpp 2057
WebGLExtensionStandardDerivatives.cpp 787
WebGLExtensionTextureFilterAnisotropic.cpp 823
WebGLExtensionTextureFloat.cpp 3467
WebGLExtensionTextureFloatLinear.cpp 1342
WebGLExtensionTextureHalfFloat.cpp 3827
WebGLExtensionTextureHalfFloatLinear.cpp 1207
WebGLExtensionVertexArray.cpp 1431
WebGLFormats.cpp 58972
WebGLFormats.h 10500
WebGLFramebuffer.cpp 52423
WebGLFramebuffer.h 8258
WebGLInternalFormatsTable.h 4646
WebGLMemoryTracker.cpp static 7274
WebGLMemoryTracker.h 1938
WebGLObjectModel.cpp 699
WebGLObjectModel.h 10608
WebGLProgram.cpp If `name`: "foo[3]" Then returns true, with `out_baseName`: "foo" `out_isArray`: true `out_index`: 3 If `name`: "foo" Then returns true, with `out_baseName`: "foo" `out_isArray`: false `out_index`: 0 52679
WebGLProgram.h 7792
WebGLQuery.cpp 5317
WebGLQuery.h 1882
WebGLRenderbuffer.cpp 8839
WebGLRenderbuffer.h 2296
WebGLSampler.cpp 4172
WebGLSampler.h 1403
WebGLShader.cpp 10393
WebGLShader.h 3197
WebGLShaderPrecisionFormat.cpp 745
WebGLShaderPrecisionFormat.h 1389
WebGLShaderValidator.cpp 15503
WebGLShaderValidator.h 2083
WebGLStrongTypes.h Usage: =========== To create a new type from a set of GLenums do the following: STRONG_GLENUM_BEGIN(TypeName) STRONG_GLENUM_VALUE(ENUM1), STRONG_GLENUM_VALUE(ENUM2), ... STRONG_GLENUM_END() where TypeName is the name you want to give the type. Now simply use TypeName instead of GLenum. The enum values must be given without GL_ prefix. ~~~~~~~~~~~~~~~~ Important Notes: ~~~~~~~~~~~~~~~~ Boolean operators (==, !=) are provided in an effort to prevent some mistakes when using constants. For example we want to make sure that GL_ENUM_X is a valid value for the type in code like: if (myNewType == STRONG_GLENUM_VALUE(SOME_ENUM)) ... The operators will assert that STRONG_GLENUM_VALUE(SOME_ENUM) is a value that myNewType can have. ---- A get() method is provided to allow access to the underlying GLenum. This method should ideally only be called when passing parameters to the gl->fXXXX functions, and be used very minimally everywhere else. Definitely XXX - DO NOT DO - XXX: if (myNewType.get() == STRONG_GLENUM_VALUE(SOME_ENUM)) ... As that undermines the debug checks that were implemented in the ==, and != operators. If you see code like this it should be treated with suspicion. Background: =========== This macro is the first step in an effort to make the WebGL code safer. Many of the different functions take GLenum as their parameter which leads to bugs because of subtle differences in the enums purpose. For example there are two types of 'texture targets'. One is the texture binding locations: GL_TEXTURE_2D GL_TEXTURE_CUBE_MAP Yet, this is not the same as texture image targets: GL_TEXTURE_2D GL_TEXTURE_CUBE_MAP_POSITIVE_X GL_TEXTURE_CUBE_MAP_NEGATIVE_X GL_TEXTURE_CUBE_MAP_POSITIVE_Y ... This subtle distinction has already led to many bugs in the texture code because of invalid assumptions about what type goes where. The macro below is an attempt at fixing this by providing a small wrapper around GLenum that validates its values. Comparison between STRONG_GLENUM's vs. enum classes =================================================== The present STRONG_GLENUM's differ from ordinary enum classes in that they assert at runtime that their values are legal, and in that they allow implicit conversion from integers to STRONG_GLENUM's but disallow implicit conversion from STRONG_GLENUM's to integers (enum classes are the opposite). When to use GLenum's vs. STRONG_GLENUM's vs. enum classes ========================================================= Rule of thumb: * For unchecked GLenum constants, such as WebGL method parameters that haven't been validated yet, use GLenum. * For already-validated GLenum constants, use STRONG_GLENUM's. * For custom constants that aren't GL enum values, use enum classes. 16201
WebGLSync.cpp 1567
WebGLSync.h 1345
WebGLTexelConversions.cpp @class WebGLImageConverter This class is just a helper to implement WebGLContext::ConvertImage below. Design comments: WebGLContext::ConvertImage has to handle hundreds of format conversion paths. It is important to minimize executable code size here. Instead of passing around a large number of function parameters hundreds of times, we create a WebGLImageConverter object once, storing these parameters, and then we call the run() method on it. 17511
WebGLTexelConversions.h Copyright (C) 2010 Apple Inc. All rights reserved. Copyright (C) 2010 Google Inc. All rights reserved. Copyright (C) 2010 Mozilla Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 46368
WebGLTexture.cpp static 34909
WebGLTexture.h 12169
WebGLTextureUpload.cpp This file handles: TexStorage2D(texTarget, levels, internalFormat, width, height) TexStorage3D(texTarget, levels, intenralFormat, width, height, depth) TexImage2D(texImageTarget, level, internalFormat, width, height, border, unpackFormat, unpackType, data) TexImage3D(texImageTarget, level, internalFormat, width, height, depth, border, unpackFormat, unpackType, data) TexSubImage2D(texImageTarget, level, xOffset, yOffset, width, height, unpackFormat, unpackType, data) TexSubImage3D(texImageTarget, level, xOffset, yOffset, zOffset, width, height, depth, unpackFormat, unpackType, data) CompressedTexImage2D(texImageTarget, level, internalFormat, width, height, border, imageSize, data) CompressedTexImage3D(texImageTarget, level, internalFormat, width, height, depth, border, imageSize, data) CompressedTexSubImage2D(texImageTarget, level, xOffset, yOffset, width, height, sizedUnpackFormat, imageSize, data) CompressedTexSubImage3D(texImageTarget, level, xOffset, yOffset, zOffset, width, height, depth, sizedUnpackFormat, imageSize, data) CopyTexImage2D(texImageTarget, level, internalFormat, x, y, width, height, border) CopyTexImage3D - "Because the framebuffer is inhererntly two-dimensional, there is no CopyTexImage3D command." CopyTexSubImage2D(texImageTarget, level, xOffset, yOffset, x, y, width, height) CopyTexSubImage3D(texImageTarget, level, xOffset, yOffset, zOffset, x, y, width, height) 73167
WebGLTransformFeedback.cpp 5252
WebGLTransformFeedback.h 2302
WebGLTypes.h Implementing WebGL (or OpenGL ES 2.0) on top of desktop OpenGL requires emulating the vertex attrib 0 array when it's not enabled. Indeed, OpenGL ES 2.0 allows drawing without vertex attrib 0 array enabled, but desktop OpenGL does not allow that. 6795
WebGLUniformLocation.cpp GLES 2.0.25, Section 2.10, p38 When loading `N` elements starting at an arbitrary position `k` in a uniform declared as an array, elements `k` through `k + N - 1` in the array will be replaced with the new values. Values for any array element that exceeds the highest array element index used, as reported by `GetActiveUniform`, will be ignored by GL. 7447
WebGLUniformLocation.h 2275
WebGLValidateStrings.cpp "), nsString()}; // Final empty string for // "found nothing". const nsString lineCommentEndings[] = {NS_LITERAL_STRING("\\\n"), NS_LITERAL_STRING("\n"), nsString()}; const nsString blockCommentEndings[] = {NS_LITERAL_STRING("\n"), NS_LITERAL_STRING(" 5890
WebGLValidateStrings.h Copyright (C) 2011 Apple Inc. All rights reserved. Copyright (C) 2011 Mozilla Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1833
WebGLVertexArray.cpp 2228
WebGLVertexArray.h 1877
WebGLVertexArrayFake.cpp 1496
WebGLVertexArrayFake.h 776
WebGLVertexArrayGL.cpp 934
WebGLVertexArrayGL.h 737
WebGLVertexArrayObject.cpp 1182
WebGLVertexArrayObject.h This class implements the DOM bindings for WebGL 2 VAO. This exists to so the object returned from gl.createVertexArray() is an instance of WebGLVertexArrayObject (to match the WebGL 2 spec.) 1202
WebGLVertexAttribData.cpp 2841
WebGLVertexAttribData.h 1943