Name Description Size Coverage
AndroidHardwareBuffer.cpp static 8624 -
AndroidHardwareBuffer.h AndroidHardwareBuffer is a wrapper of AHardwareBuffer. AHardwareBuffer wraps android GraphicBuffer. It is supported since Android O(APIVersion 26). The manager is mainly used for release fences delivery from host side to client side. 4654 -
AnimationHelper.cpp 36327 98 %
AnimationHelper.h This utility class allows reusing code between the webrender and non-webrender compositor-side implementations. It provides utility functions for sampling animations at particular timestamps. 7277 100 %
AnimationInfo.cpp static 41867 90 %
AnimationInfo.h 5794 100 %
AnimationStorageData.h 3981 100 %
apz 92 %
AtomicRefCountedWithFinalize.h Set a callback responsible for recycling this object before it is finalized. 5185 74 %
AxisPhysicsModel.cpp The simulation is advanced forward in time with a fixed time step to ensure that it remains deterministic given variable framerates. To determine the position at any variable time, two samples are interpolated. kFixedtimestep is set to 120hz in order to ensure that every frame in a common 60hz refresh rate display will have at least one physics simulation sample. More accuracy can be obtained by reducing kFixedTimestep to smaller intervals, such as 240hz or 1000hz, at the cost of more CPU cycles. If kFixedTimestep is increased to much longer intervals, interpolation will become less effective at reducing temporal jitter and the simulation will lose accuracy. 3515 100 %
AxisPhysicsModel.h AxisPhysicsModel encapsulates a generic 1-dimensional physically-based motion model. It performs frame-rate independent interpolation and RK4 integration for smooth animation with stable, deterministic behavior. Implementations are expected to subclass and override the Acceleration() method. 3238 75 %
AxisPhysicsMSDModel.cpp Constructs an AxisPhysicsMSDModel with initial values for state. @param aInitialPosition sets the initial position of the simulated spring, in AppUnits. @param aInitialDestination sets the resting position of the simulated spring, in AppUnits. @param aInitialVelocity sets the initial velocity of the simulated spring, in AppUnits / second. Critically-damped and over-damped systems are guaranteed not to overshoot aInitialDestination if this is set to 0; however, it is possible to overshoot and oscillate if not set to 0 or the system is under-damped. @param aSpringConstant sets the strength of the simulated spring. Greater values of mSpringConstant result in a stiffer / stronger spring. @param aDampingRatio controls the amount of dampening force and determines if the system is under-damped, critically-damped, or over-damped. 3570 100 %
AxisPhysicsMSDModel.h AxisPhysicsMSDModel encapsulates a 1-dimensional MSD (Mass-Spring-Damper) model. A unit mass is assumed. 2279 0 %
BSPTree.cpp 4006 100 %
BSPTree.h Represents a layer that might have a non-rectangular geometry. 3971 100 %
BufferTexture.cpp 18945 81 %
BufferTexture.h 4574 100 %
BuildConstants.h Why not just use ifdefs? ifdefs tend to result in code that compiles on one platform but not another. Given the number of build and platform configurations we have, it's best to aim to compile the same on as many platforms as possible, and let the compiler see the constexprs and handle dead-code elision itself. 1149 -
CanvasDrawEventRecorder.cpp 15699 71 %
CanvasDrawEventRecorder.h This is the important state to make sure the other side signals or starts us as soon as data or space is available. We set AboutToWait first and then re-check the condition. If we went straight to Waiting or Stopped then in between the last check and setting the state, the other side could have used all available data or space and never have signaled us because it didn't know we were about to wait, causing a deadlock. While we are in this state, the other side must wait until we resolve the AboutToWait state to one of the other states and then signal or start us if it needs to. 6358 81 %
CanvasRenderer.cpp 3817 89 %
CanvasRenderer.h 4687 67 %
client 74 %
composite 74 %
CompositionRecorder.cpp 2993 0 %
CompositionRecorder.h A captured frame from a |LayerManager|. 2091 0 %
Compositor.cpp aZero = 9161 38 %
Compositor.h Different elements of a web pages are rendered into separate "layers" before they are flattened into the final image that is brought to the screen. See Layers.h for more informations about layers and why we use retained structures. Most of the documentation for layers is directly in the source code in the form of doc comments. An overview can also be found in the the wiki: https://wiki.mozilla.org/Gecko:Overview#Graphics # Main interfaces and abstractions - CompositableClient and CompositableHost (client/CompositableClient.h composite/CompositableHost.h) - TextureClient and TextureHost (client/TextureClient.h composite/TextureHost.h) - TextureSource (composite/TextureHost.h) - Forwarders (ipc/CompositableForwarder.h ipc/ShadowLayers.h) - Compositor (this file) - IPDL protocols (.ipdl files under the gfx/layers/ipc directory) The *Client and Shadowable* classes are always used on the content thread. Forwarders are always used on the content thread. The *Host and Shadow* classes are always used on the compositor thread. Compositors, TextureSource, and Effects are always used on the compositor thread. Most enums and constants are declared in LayersTypes.h and CompositorTypes.h. # Texture transfer Most layer classes own a Compositable plus some extra information like transforms and clip rects. They are platform independent. Compositable classes manipulate Texture objects and are reponsible for things like tiling, buffer rotation or double buffering. Compositables are also platform-independent. Examples of compositable classes are: - ImageClient - CanvasClient - etc. Texture classes (TextureClient and TextureHost) are thin abstractions over platform-dependent texture memory. They are maniplulated by compositables and don't know about buffer rotations and such. The purposes of TextureClient and TextureHost are to synchronize, serialize and deserialize texture data. TextureHosts provide access to TextureSources that are views on the Texture data providing the necessary api for Compositor backend to composite them. Compositable and Texture clients and hosts are created using factory methods. They should only be created by using their constructor in exceptional circumstances. The factory methods are located: TextureClient - CompositableClient::CreateTextureClient TextureHost - TextureHost::CreateTextureHost, which calls a platform-specific function, e.g., CreateTextureHostOGL CompositableClient - in the appropriate subclass, e.g., CanvasClient::CreateCanvasClient CompositableHost - CompositableHost::Create # IPDL If off-main-thread compositing (OMTC) is enabled, compositing is performed in a dedicated thread. In some setups compositing happens in a dedicated process. Documentation may refer to either the compositor thread or the compositor process. See explanations in ShadowLayers.h. # Backend implementations Compositor backends like OpenGL or flavours of D3D live in their own directory under gfx/layers/. To add a new backend, implement at least the following interfaces: - Compositor (ex. CompositorOGL) - TextureHost (ex. SurfaceTextureHost) Depending on the type of data that needs to be serialized, you may need to add specific TextureClient implementations. 15022 22 %
CompositorAnimationStorage.cpp 18303 99 %
CompositorAnimationStorage.h This transform is calculated from frame used for WebRender and used by getOMTAStyle() for OMTA testing. 8013 100 %
CompositorTypes.cpp 1714 0 %
CompositorTypes.h Flags used by texture clients and texture hosts. These are passed from client side to host side when textures and compositables are created. Usually set by the compositableCient, they may be modified by either the compositable or texture clients. 10643 100 %
d3d11 60 %
D3D11ShareHandleImage.cpp 10140 59 %
D3D11ShareHandleImage.h Used for checking if CompositorDevice/ContentDevice is updated. 3667 58 %
D3D11YCbCrImage.cpp 3611 0 %
D3D11YCbCrImage.h 1578 0 %
D3D11ZeroCopyTextureImage.cpp static 6295 69 %
D3D11ZeroCopyTextureImage.h 5001 50 %
DcompSurfaceImage.cpp static 6413 0 %
DcompSurfaceImage.h A texture data wrapping a dcomp surface handle, which is provided by the media foundation media engine. We won't be able to control real texture data because that is protected by the media engine. 4357 0 %
DirectionUtils.h GFX_DIRECTIONUTILS_H 1698 100 %
DMABUFSurfaceImage.cpp MOZ_LOGGING 2739 0 %
DMABUFSurfaceImage.h 1087 0 %
Effects.cpp 1017 0 %
Effects.h Effects and effect chains are used by the compositor API (see Compositor.h). An effect chain represents a rendering method, for example some shader and the data required for that shader to run. An effect is some component of the chain and its data. An effect chain consists of a primary effect - how the 'texture' memory should be interpreted (RGBA, BGRX, YCBCR, etc.) - and any number of secondary effects - any way in which rendering can be changed, e.g., applying a mask layer. During the rendering process, an effect chain is created by the layer being rendered and the primary effect is added by the compositable host. Secondary effects may be added by the layer or compositable. The effect chain is passed to the compositor by the compositable host as a parameter to DrawQuad. 7529 77 %
Fence.cpp 613 0 %
Fence.h 1044 33 %
FrameMetrics.cpp static 13599 66 %
FrameMetrics.h Metrics about a scroll frame that are sent to the compositor and used by APZ. This is used for two main purposes: (1) Sending information about a scroll frame to the compositor and APZ as part of a layers or WebRender transaction. (2) Storing information about a scroll frame in APZ that persists between transactions. TODO: Separate these two uses into two distinct structures. A related class, RepaintRequest, is used for sending information about a scroll frame back from the compositor to the main thread when requesting a repaint of the scroll frame's contents. 43791 100 %
GLImages.cpp NOT continuous 4418 0 %
GLImages.h 3742 0 %
GpuFence.h MOZILLA_GFX_GpuFence_H 610 0 %
GpuFenceMTLSharedEvent.cpp static 1166 -
GpuFenceMTLSharedEvent.h MOZILLA_GFX_GpuFenceMTLSharedEvent_H 1239 -
GPUVideoImage.h 4507 70 %
ImageContainer.cpp 42587 53 %
ImageContainer.h Forward declarations for Image derivatives. 34906 89 %
ImageDataSerializer.cpp 14285 66 %
ImageDataSerializer.h 4432 -
ImageTypes.h The PLANAR_YCBCR format creates a PlanarYCbCrImage. All backends should support this format, because the Ogg video decoder depends on it. The maximum image width and height is 16384. 3257 -
IMFYCbCrImage.cpp static 4249 0 %
IMFYCbCrImage.h 1263 0 %
ipc 75 %
IPDLActor.h 1372 93 %
LayersTypes.cpp static 2937 59 %
LayersTypes.h 17404 95 %
LayerUserData.h Base class for userdata objects attached to layers and layer managers. We define it here in a separate header so clients only need to include this header for their class definitions, rather than pulling in Layers.h. Everything else in Layers.h should be forward-declarable. 754 100 %
layerviewer -
MacIOSurfaceHelpers.cpp Extract and separate the CbCr planes 10766 -
MacIOSurfaceHelpers.h 1049 -
MacIOSurfaceImage.cpp 12308 -
MacIOSurfaceImage.h 2858 -
MemoryPressureObserver.cpp 2154 92 %
MemoryPressureObserver.h 1694 -
moz.build 16659 -
NativeLayer.cpp 3898 0 %
NativeLayer.h 13991 0 %
NativeLayerCA.h 21478 -
NativeLayerCA.mm static 72734 -
NativeLayerCommandQueue.cpp 784 0 %
NativeLayerCommandQueue.h 937 -
NativeLayerMacSurfaceHandler.h 10838 -
NativeLayerMacSurfaceHandler.mm 9682 -
NativeLayerRemoteChild.h 673 -
NativeLayerRemoteMac.h 3964 -
NativeLayerRemoteMac.mm 8815 -
NativeLayerRemoteParent.h 917 -
NativeLayerRootRemoteMacChild.h 4446 -
NativeLayerRootRemoteMacChild.mm 7442 -
NativeLayerRootRemoteMacParent.h 2382 -
NativeLayerRootRemoteMacParent.mm 7358 -
NativeLayerWayland.cpp TODO: - Better layers update mechanism - update only in changed layes and updated properties. - Create cache of mapped layers? - Fix messages from SurfacePoolWayland() mPendingEntries num xxx mPoolSizeLimit 25 Are we leaking pending entries? - Implemented screenshotter - Presentation feedback - Fullscreen - handle differently - Attach dmabuf feedback to dmabuf surfaces to get formats for direct scanout - Don't use for tooltips/small menus etc. Testing: Mochitest test speeds Fractional Scale SW/HW rendering + VSync 49654 0 %
NativeLayerWayland.h 15143 0 %
OOPCanvasRenderer.h This renderer works with WebGL running in the host process. It does not perform any graphics operations itself -- it is the client-side representation. It forwards WebGL composition to the remote process. 1479 -
opengl 0 %
PersistentBufferProvider.cpp aUseRemoteTexture 23326 77 %
PersistentBufferProvider.h A PersistentBufferProvider is for users which require the temporary use of a DrawTarget to draw into. When they're done drawing they return the DrawTarget, when they later need to continue drawing they get a DrawTarget from the provider again, the provider will guarantee the contents of the previously returned DrawTarget is persisted into the one newly returned. 10185 79 %
ProfilerScreenshots.cpp aScreenshotDataURL 4912 91 %
ProfilerScreenshots.h Can be used to submit screenshots from the compositor to the profiler. Screenshots have a fixed bounding size. The user of this class will usually scale down the window contents first, ideally on the GPU, then read back the small scaled down image into main memory, and then call SubmitScreenshot to pass the data to the profiler. This class encodes each screenshot to a JPEG data URL, on a separate thread. This class manages that thread and recycles memory buffers. Users of ProfilerScreenshots should have one ProfilerScreenshot instance per window, as a unique window id is created by the constructor. 4372 100 %
RecordedCanvasEventImpl.h 28822 79 %
RemoteTextureMap.cpp aResourceWrapper 51114 65 %
RemoteTextureMap.h 19324 82 %
RepaintRequest.cpp 895 0 %
RepaintRequest.h 12822 99 %
SampleTime.cpp static 1940 65 %
SampleTime.h When compositing frames, there is usually a "sample time" associated with the frame, which may be derived from vsync or controlled by a test. This class encapsulates that and tracks where the sample time comes from, as the desired behaviour may vary based on the time source. 2182 -
ScreenshotGrabber.cpp The actual implementation of screenshot grabbing. The ScreenshotGrabberImpl object is destroyed if the profiler is disabled and MaybeGrabScreenshot notices it. 7552 84 %
ScreenshotGrabber.h Used by various renderers / layer managers to grab snapshots from the window and submit them to the Gecko profiler. Doesn't do any work if the profiler is not running or the "screenshots" feature is not enabled. Screenshots are scaled down to fit within a fixed size, and read back to main memory using async readback. Scaling is done in multiple scale-by-0.5x steps using DownscaleTarget::CopyFrom, and readback is done using AsyncReadbackBuffers. 4217 92 %
ScrollableLayerGuid.cpp 2623 44 %
ScrollableLayerGuid.h This class allows us to uniquely identify a scrollable layer. The mLayersId identifies the layer tree (corresponding to a child process and/or tab) that the scrollable layer belongs to. The mPresShellId is a temporal identifier (corresponding to the document loaded that contains the scrollable layer, which may change over time). The mScrollId corresponds to the actual frame that is scrollable. 3132 -
ScrollbarData.h It stores data for scroll thumb layer or container layers. 4551 100 %
ShareableCanvasRenderer.cpp 6290 72 %
ShareableCanvasRenderer.h 1527 0 %
SourceSurfaceSharedData.cpp If defined, this makes SourceSurfaceSharedData::Finalize memory protect the underlying shared buffer in the producing process (the content or UI process). Given flushing the page table is expensive, and its utility is predominantly diagnostic (in case of overrun), turn it off by default. 8795 73 %
SourceSurfaceSharedData.h This class is used to wrap shared (as in process) data buffers allocated by a SourceSurfaceSharedData object. It may live in the same process or a different process from the actual SourceSurfaceSharedData object. If it is in the same process, mBuf is the same object as that in the surface. It is a useful abstraction over just using the surface directly, because it can have a different lifetime from the surface; if the surface gets freed, consumers may continue accessing the data in the buffer. Releasing the original surface is a signal which feeds into SharedSurfacesParent to decide to release the SourceSurfaceSharedDataWrapper. If it is in a different process, mBuf is a new SharedMemory object which mapped in the given shared memory handle as read only memory. 10645 96 %
SurfacePool.h 2235 0 %
SurfacePoolCA.h 12795 -
SurfacePoolCA.mm static 18617 -
SurfacePoolWayland.cpp MOZ_LOGGING 12238 0 %
SurfacePoolWayland.h 5008 0 %
SyncObject.cpp static 1204 92 %
SyncObject.h 1886 100 %
TextureSourceProvider.cpp 529 50 %
TextureSourceProvider.h 2199 14 %
TextureWrapperImage.cpp 1503 58 %
TextureWrapperImage.h 1253 100 %
TransactionIdAllocator.h Allocate a unique id number for the current refresh tick, can only be called while IsInRefresh(). If too many id's are allocated without being returned then the refresh driver will suspend until they catch up. This "throttling" behaviour can be skipped by passing aThrottle=false. Otherwise call sites should generally be passing aThrottle=true. 3109 100 %
TreeTraversal.h Returned by |aPostAction| and |aPreAction| in ForEachNode, indicates the behavior to follow either action: TraversalFlag::Skip - the node's children are not traversed. If this flag is returned by |aPreAction|, |aPostAction| is skipped for the current node, as well. TraversalFlag::Continue - traversal continues normally. TraversalFlag::Abort - traversal stops immediately. 8202 100 %
wr 87 %
ZoomConstraints.cpp 699 0 %
ZoomConstraints.h GFX_ZOOMCONSTRAINTS_H 1913 70 %