Name Description Size Coverage
CacheInvalidator.cpp 1295 84 %
CacheInvalidator.h 4491 95 %
CanvasGradient.cpp 507 100 %
CanvasGradient.h 1722 90 %
CanvasImageCache.cpp Used for images specific to this one canvas. Required due to CORS security. 12359 94 %
CanvasImageCache.h Notify that image element aImage was drawn to aContext canvas 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. 2447 -
CanvasPath.h CanvasPath_h 3657 100 %
CanvasPattern.cpp 851 100 %
CanvasPattern.h 1769 100 %
CanvasRenderingContext2D.cpp Memory reporter stuff 251827 79 %
CanvasRenderingContext2D.h CanvasRenderingContext2D 43798 93 %
CanvasRenderingContextHelper.cpp webgl2: 10765 89 %
CanvasRenderingContextHelper.h Povides common RenderingContext functionality used by both OffscreenCanvas and HTMLCanvasElement. 3539 -
CanvasUtils.cpp 28174 81 %
CanvasUtils.h Float validation stuff 6675 100 %
ClientWebGLContext.cpp 229802 87 %
ClientWebGLContext.h 86897 95 %
ClientWebGLExtensions.cpp 10152 89 %
ClientWebGLExtensions.h 15842 65 %
crashtests -
DmdStdContainers.h 2330 100 %
DrawTargetWebgl.cpp 267041 77 %
DrawTargetWebgl.h 36735 91 %
DrawTargetWebglInternal.h 16785 93 %
FilterNodeWebgl.cpp 36310 43 %
FilterNodeWebgl.h FilterNodeWebgl wraps a FilterNodeSoftware for most operations that are not yet accelerated. To provide acceleration, this must be subclassed to override an optimized implementation for particular operations. 13275 63 %
GeneratePlaceholderCanvasData.h This function tries to generate random data for placeholder canvas by sampling RANDOM_BYTES_TO_SAMPLE bytes and then returning it. If it fails, returns nullptr. @return uint8_t* output buffer 3243 88 %
gtest 100 %
HostWebGLContext.cpp static 6043 70 %
HostWebGLContext.h Host endpoint of a WebGLContext. HostWebGLContext owns a WebGLContext that it uses to execute commands sent from its ClientWebGLContext. A HostWebGLContext continuously issues a Task to the Compositor thread that causes it to drain its queue of commands. It also maintains a map of WebGL objects (e.g. ObjectIdMap<WebGLShader>) that it uses associate them with their cross-process IDs. This class is not an implementation of the nsICanvasRenderingContextInternal DOM class. That is the ClientWebGLContext. 27161 93 %
ImageBitmap.cpp This class observes shutdown notifications and sends that notification to the worker thread if the image bitmap is on a worker thread. 81029 71 %
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. 10309 86 %
ImageBitmapRenderingContext.cpp 9723 85 %
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 4059 45 %
ImageBitmapSource.h 882 -
ImageData.cpp 5560 97 %
ImageData.h 2794 100 %
ImageUtils.cpp 7037 73 %
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. 1869 -
IsEnumCase.h 690 100 %
metrics.yaml 4162 -
moz.build 6229 -
MurmurHash3.cpp 8458 53 %
MurmurHash3.h 840 -
nsICanvasRenderingContextInternal.cpp 8976 87 %
nsICanvasRenderingContextInternal.h 8518 67 %
OffscreenCanvas.cpp static 23317 74 %
OffscreenCanvas.h 6959 83 %
OffscreenCanvasDisplayHelper.cpp 20666 60 %
OffscreenCanvasDisplayHelper.h 4081 73 %
OffscreenCanvasRenderingContext2D.cpp 4146 86 %
OffscreenCanvasRenderingContext2D.h 1755 100 %
ParamTraits_IsEnumCase.h `IsEnumCase(T) -> bool` guarantees that we never have false negatives or false positives due to adding or removing enum cases to enums, and forgetting to update their serializations. Also, it allows enums to be non-continguous, unlike ContiguousEnumSerializer. 1297 100 %
ParamTraits_STL.h 3691 98 %
ParamTraits_TiedFields.h 1303 100 %
PWebGL.ipdl Represents the connection between a WebGLChild actor that issues WebGL command from the content process, and a WebGLParent in the compositor process that runs the commands. 5270 -
QueueParamTraits.h QueueParamTraits provide the user with a way to implement PCQ argument (de)serialization. It uses a PcqView, which permits the system to abandon all changes to the underlying PCQ if any operation fails. The transactional nature of PCQ operations make the ideal behavior a bit complex. Since the PCQ has a fixed amount of memory available to it, TryInsert operations operations are expected to sometimes fail and be re-issued later. We want these failures to be inexpensive. The same goes for TryRemove, which fails when there isn't enough data in the queue yet for them to complete. Their expected interface is: template<> struct QueueParamTraits<typename RemoveCVR<Arg>::Type> { // Write data from aArg into the PCQ. static QueueStatus Write(ProducerView& aProducerView, const Arg& aArg) {...}; // Read data from the PCQ into aArg, or just skip the data if aArg is null. static QueueStatus Read(ConsumerView& aConsumerView, Arg* aArg) {...} }; 24596 92 %
SanitizeRenderer.cpp Narrow renderer string space down to representative replacements. E.g. "GeForce RTX 3090" => "GeForce GTX 980" For example strings: https://hackmd.io/Ductv3pQTMej74gbveD4yw 11696 67 %
SourceSurfaceWebgl.cpp 7968 72 %
SourceSurfaceWebgl.h MOZILLA_GFX_SOURCESURFACEWEBGL_H_ 2902 100 %
test -
TextMetrics.h 3221 82 %
TexUnpackBlob.cpp 43394 79 %
TexUnpackBlob.h 5077 100 %
TiedFields.h TiedFields(T&) -> std::tuple<Fields&...> TiedFields(const T&) -> std::tuple<const Fields&...> You can also overload TiedFields without adding T::MutTiedFields: template<> inline auto TiedFields<gfx::IntSize>(gfx::IntSize& a) { return std::tie(a.width, a.height); } 7692 90 %
TupleUtils.h 1926 100 %
WebGL2Context.cpp virtual 5215 72 %
WebGL2Context.h Implemented in WebGLContext void VertexAttribDivisor(GLuint index, GLuint divisor); void DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount); void DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, WebGLintptr offset, GLsizei instanceCount); 6328 100 %
WebGL2ContextBuffers.cpp 6010 92 %
WebGL2ContextFramebuffers.cpp 7733 87 %
WebGL2ContextMRTs.cpp 4452 70 %
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. 3295 71 %
WebGL2ContextRenderbuffers.cpp 2253 68 %
WebGL2ContextSamplers.cpp 2989 98 %
WebGL2ContextState.cpp GLboolean 3667 97 %
WebGL2ContextSync.cpp 3209 72 %
WebGL2ContextTransformFeedback.cpp 2792 96 %
WebGL2ContextUniforms.cpp 3400 84 %
WebGLBuffer.cpp 13550 85 %
WebGLBuffer.h 2488 100 %
WebGLChild.cpp 6301 81 %
WebGLChild.h 1992 89 %
WebGLCommandQueue.h 8022 92 %
WebGLContext.cpp 94548 81 %
WebGLContext.h 51229 91 %
WebGLContextBuffers.cpp 8237 94 %
WebGLContextDraw.cpp 43334 84 %
WebGLContextExtensions.cpp 22016 94 %
WebGLContextFramebufferOperations.cpp 6355 98 %
WebGLContextGL.cpp 46611 86 %
WebGLContextLossHandler.cpp 1335 95 %
WebGLContextLossHandler.h 904 -
WebGLContextState.cpp 12941 86 %
WebGLContextTextures.cpp virtual 7443 98 %
WebGLContextUtils.cpp static 18382 35 %
WebGLContextUtils.h Return the displayable name for the texture function that is the source for validation. 1835 -
WebGLContextValidate.cpp 21118 75 %
WebGLContextVertexArray.cpp 1131 100 %
WebGLContextVertices.cpp 8652 95 %
WebGLExtensions.cpp 35362 92 %
WebGLExtensions.h 8658 85 %
WebGLFormats.cpp 62165 98 %
WebGLFormats.h 10747 94 %
WebGLFramebuffer.cpp 55068 86 %
WebGLFramebuffer.h 7787 85 %
WebGLInternalFormatsTable.h 4646 -
WebGLIpdl.h 15465 87 %
WebGLMemoryTracker.cpp 5366 10 %
WebGLMemoryTracker.h 679 100 %
WebGLMethodDispatcher.h 7017 96 %
WebGLObjectModel.h 1828 50 %
WebGLParent.cpp 14279 70 %
WebGLParent.h 5427 100 %
WebGLProgram.cpp 37505 92 %
WebGLProgram.h 5455 74 %
WebGLQuery.cpp 3778 68 %
WebGLQuery.h 1255 100 %
WebGLQueueParamTraits.h 8000 100 %
WebGLRenderbuffer.cpp 8418 74 %
WebGLRenderbuffer.h 1755 67 %
WebGLSampler.cpp 3932 92 %
WebGLSampler.h 963 100 %
WebGLShader.cpp 5947 64 %
WebGLShader.h 1908 100 %
WebGLShaderValidator.cpp 15352 85 %
WebGLShaderValidator.h 2079 100 %
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. 16137 100 %
WebGLSync.cpp 2092 100 %
WebGLSync.h 1900 100 %
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. 21172 79 %
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. 48836 70 %
WebGLTexture.cpp static 36175 95 %
WebGLTexture.h 11309 100 %
WebGLTextureUpload.cpp 63516 87 %
WebGLTextureUpload.h 1873 -
WebGLTransformFeedback.cpp 4612 86 %
WebGLTransformFeedback.h 1925 100 %
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. 37321 93 %
WebGLValidateStrings.cpp GLSL ES 3.00 p17: - Comments are delimited by / * and * /, or by // and a newline. - '//' style comments include the initial '//' marker and continue up to, but not including, the terminating newline. - '/ * ... * /' comments include both the start and end marker. - The begin comment delimiters (/ * or //) are not recognized as comment delimiters inside of a comment, hence comments cannot be nested. - Comments are treated syntactically as a single space. 4848 50 %
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. 1884 -
WebGLVertexArray.cpp 2139 86 %
WebGLVertexArray.h 3685 95 %
WebGLVertexArrayFake.cpp 2187 71 %
WebGLVertexArrayFake.h 690 0 %
WebGLVertexArrayGL.cpp 902 100 %
WebGLVertexArrayGL.h 693 100 %
XRWebGLLayer.cpp static 9169 0 %
XRWebGLLayer.h 2893 0 %