Name Description Size
ActiveLayerTracker.cpp This tracks the state of a frame that may need active layers due to ongoing content changes or style changes that indicate animation. When no changes of *any* kind are detected after 75-100ms we remove this object. Because we only track all kinds of activity with a single nsExpirationTracker, it's possible a frame might remain active somewhat spuriously if different kinds of changes kept happening, but that almost certainly doesn't matter. 16013
ActiveLayerTracker.h This class receives various notifications about style changes and content changes that affect layerization decisions, and implements the heuristics that drive those decisions. It manages per-frame state to support those heuristics. 3822
BorderCache.h mozilla_BorderCache_h_ 1773
BorderConsts.h mozilla_BorderConsts_h_ 807
crashtests
DashedCornerFinder.cpp 12685
DashedCornerFinder.h 9710
DisplayItemClip.cpp 17950
DisplayItemClip.h An DisplayItemClip represents the intersection of an optional rectangle with a list of rounded rectangles (which is often empty), all in appunits. It can represent everything CSS clipping can do to an element (except for SVG clip-path), including no clipping at all. 7251
DisplayItemClipChain.cpp static 3083
DisplayItemClipChain.h A DisplayItemClipChain is a linked list of DisplayItemClips where each clip is associated with an active scrolled root that describes what the clip moves with. We use a chain instead of just one intersected clip due to async scrolling: A clip that moves along with a display item can be fused to the item's contents when drawing the layer contents, but all other clips in the chain need to be kept separate so that they can be applied at composition time, after any async scroll offsets have been applied. The clip chain is created during display list construction by the builder's DisplayListClipState. The clip chain order is determined by the active scrolled root order. For every DisplayItemClipChain object |clipChain|, the following holds: !clipChain->mParent || ActiveScrolledRoot::IsAncestor(clipChain->mParent->mASR, clipChain->mASR). The clip chain can skip over active scrolled roots. That just means that there is no clip that moves with the skipped ASR in this chain. 3769
DisplayListClipState.cpp 5740
DisplayListClipState.h All clip coordinates are in appunits relative to the reference frame for the display item we're building. 10501
DottedCornerFinder.cpp 16951
DottedCornerFinder.h 14086
HitTestInfo.cpp 2151
HitTestInfo.h A helper class that manages compositor hit testing information. 1547
MatrixStack.h MatrixStack stores a stack of matrices and keeps track of the accumulated transform matrix. 1556
moz.build 1782
nsCSSRendering.cpp utility functions for drawing borders and backgrounds 197076
nsCSSRendering.h utility functions for drawing borders and backgrounds 40392
nsCSSRenderingBorders.cpp nsCSSRendering::PaintBorder nsCSSRendering::PaintOutline -> DrawBorders DrawBorders -> Ability to use specialized approach? |- Draw using specialized function |- separate corners? |- dashed side mask | -> can border be drawn in 1 pass? (e.g., solid border same color all around) |- DrawBorderSides with all 4 sides -> more than 1 pass? |- for each corner |- clip to DoCornerClipSubPath |- for each side adjacent to corner |- clip to GetSideClipSubPath |- DrawBorderSides with one side |- for each side |- GetSideClipWithoutCornersRect |- DrawDashedOrDottedSide || DrawBorderSides with one side 139463
nsCSSRenderingBorders.h Helper class that handles border rendering. aDrawTarget -- the DrawTarget to which the border should be rendered outsideRect -- the rectangle on the outer edge of the border For any parameter where an array of side values is passed in, they are in top, right, bottom, left order. borderStyles -- one border style enum per side borderWidths -- one border width per side borderRadii -- a RectCornerRadii struct describing the w/h for each rounded corner. If the corner doesn't have a border radius, 0,0 should be given for it. borderColors -- one nscolor per side skipSides -- a bit mask specifying which sides, if any, to skip backgroundColor -- the background color of the element. Used in calculating colors for 2-tone borders, such as inset and outset gapRect - a rectangle that should be clipped out to leave a gap in a border, or nullptr if none. 12876
nsCSSRenderingGradients.cpp utility functions for drawing borders and backgrounds 56083
nsCSSRenderingGradients.h Prepare a nsCSSGradientRenderer for a gradient for an element. aIntrinsicSize - the size of the source gradient. 7535
nsDisplayItemTypes.h It's useful to be able to dynamically check the type of certain items. Every subclass of nsDisplayItem must have a new type added here for the purposes of easy comparison and matching of items in different display lists. 2193
nsDisplayItemTypesList.h 6908
nsDisplayList.cpp structures that represent things to be painted (ordered in z-order), used during painting and hit testing 325169
nsDisplayList.h structures that represent things to be painted (ordered in z-order), used during painting and hit testing 243951
nsDisplayListArenaTypes.h a list of all types that can be allocated in the display list's nsPresArena, for preprocessing 718
nsDisplayListInvalidation.cpp 4594
nsDisplayListInvalidation.h This stores the geometry of an nsDisplayItem, and the area that will be affected when painting the item. It is used to retain information about display items so they can be compared against new display items in the next paint. 7312
nsImageRenderer.cpp utility code for drawing images as CSS borders, backgrounds, and shapes. 40947
nsImageRenderer.h This is a small wrapper class to encapsulate image drawing that can draw an StyleImage image, which may internally be a real image, a sub image, or a CSS gradient, etc... @note Always call the member functions in the order of PrepareImage(), SetSize(), and Draw*(). 12077
PaintTracker.cpp 441
PaintTracker.h 826
RetainedDisplayListBuilder.cpp Code for doing display list building for a modified subset of the window, and then merging it into the existing display list (for the full window). The approach primarily hinges on the observation that the 'true' ordering of display items is represented by a DAG (only items that intersect in 2d space have a defined ordering). Our display list is just one of a many possible linear representations of this ordering. Each time a frame changes (gets a new ComputedStyle, or has a size/position change), we schedule a paint (as we do currently), but also reord the frame that changed. When the next paint occurs we union the overflow areas (in screen space) of the changed frames, and compute a rect/region that contains all changed items. We then build a display list just for this subset of the screen and merge it into the display list from last paint. Any items that exist in one list and not the other must not have a defined ordering in the DAG, since they need to intersect to have an ordering and we would have built both in the new list if they intersected. Given that, we can align items that appear in both lists, and any items that appear between matched items can be inserted into the merged list in any order. Frames that are a stacking context, containing blocks for position:fixed descendants, and don't have any continuations (see CanStoreDisplayListBuildingRect) trigger recursion into the algorithm with separate retaining decisions made. RDL defines the concept of an AnimatedGeometryRoot (AGR), the nearest ancestor frame which can be moved asynchronously on the compositor thread. These are currently nsDisplayItems which return true from CanMoveAsync (animated nsDisplayTransform and nsDisplayStickyPosition) and ActiveScrolledRoots. For each context that we run the retaining algorithm, there can only be mutations to one AnimatedGeometryRoot. This is because we are unable to reason about intersections of items that might then move relative to each other without RDL running again. If there are mutations to multiple AnimatedGeometryRoots, then we bail out and rebuild all the items in the context. Otherwise, when mutations are restricted to a single AGR, we pre-process the old display list and mark the frames for all existing (unmodified!) items that belong to a different AGR and ensure that we rebuild those items for correct sorting with the modified ones. 64853
RetainedDisplayListBuilder.h RetainedDisplayListData contains frame invalidation information. Currently this is implemented as a map of frame pointers to flags. 9002
RetainedDisplayListHelpers.h 5552
TransformClipNode.h TransformClipNode stores a transformation matrix and a post-transform clip rect. They can be used to transform and clip a display item inside a flattened nsDisplayTransform to the coordinate space of that nsDisplayTransform. 4143
WindowRenderer.cpp StartFrameTimeRecording, together with StopFrameTimeRecording enable recording of frame intervals. To allow concurrent consumers, a cyclic array is used which serves all consumers, practically stateless with regard to consumers. To save resources, the buffer is allocated on first call to StartFrameTimeRecording and recording is paused if no consumer which called StartFrameTimeRecording is able to get valid results (because the cyclic buffer was overwritten since that call). To determine availability of the data upon StopFrameTimeRecording: - mRecording.mNextIndex increases on each RecordFrame, and never resets. - Cyclic buffer position is realized as mNextIndex % bufferSize. - StartFrameTimeRecording returns mNextIndex. When StopFrameTimeRecording is called, the required start index is passed as an arg, and we're able to calculate the required length. If this length is bigger than bufferSize, it means data was overwritten. otherwise, we can return the entire sequence. - To determine if we need to pause, mLatestStartIndex is updated to mNextIndex on each call to StartFrameTimeRecording. If this index gets overwritten, it means that all earlier start indices obtained via StartFrameTimeRecording were also overwritten, hence, no point in recording, so pause. - mCurrentRunStartIndex indicates the oldest index of the recording after which the recording was not paused. If StopFrameTimeRecording is invoked with a start index older than this, it means that some frames were not recorded, so data is invalid. 9305
WindowRenderer.h Record (and return) frame-intervals and paint-times for frames which were presented between calling StartFrameTimeRecording and StopFrameTimeRecording. - Uses a cyclic buffer and serves concurrent consumers, so if Stop is called too late (elements were overwritten since Start), result is considered invalid and hence empty.) - Buffer is capable of holding 10 seconds @ 60fps (or more if frames were less frequent). Can be changed (up to 1 hour) via pref: toolkit.framesRecording.bufferSize. - Note: the first frame-interval may be longer than expected because last frame might have been presented some time before calling StartFrameTimeRecording. 9745