Confirmed users
44
edits
| Mattwoodrow (talk | contribs) No edit summary | Mattwoodrow (talk | contribs)  | ||
| Line 5: | Line 5: | ||
| = Basic Outline = | = Basic Outline = | ||
| There are 3 main components to DLBI: Frame invalidation, display list invalidation and layer tree invalidation. | |||
| == Frame Invalidation ==  | |||
| Code lives in layout/generic/nsIFrame.h and layout/generic/nsFrame.cpp | |||
| This is used when a frame has a major change that will affect rendering (such as a style change) and all display items belonging to this frame should redraw their content. | |||
| nsIFrame::InvalidateFrame() marks the frame as invalid. You can also specify a rect using nsIFrame::InvalidateFrameWithRect, but note that this is a minimum, the display items created by this frame can still choose to invalidate further. | |||
| == Display List Invalidation == | |||
| Compute the area of a ThebesLayer by comparing the current display list being drawn into the layer against the previous display list. | |||
| Code lives in layout/base/FrameLayerBuilder.cpp, primarily in FrameLayerBuilder::InvalidateForLayerChange(). The nsDisplayItemGeometry classes in layout/base/nsDisplayListInvalidation.h, and layout/base/nsDisplayList.h - nsDisplayItem::AllocateGeometry(), nsDisplayItem::ComputeInvalidationRegion. | |||
| Every display item is asked to allocate a geometry object that is retained between paints and then used to check for display item changes. | |||
| When painting, it checks if it has been added or removed from the layer and invalidates the bounds of the display item if so. | |||
| Items that exist between paints are asked to check for size changes using nsDisplayItem::ComputeInvalidationRegion and will compute the changed area (if any). | |||
| == Layer Tree Invalidation == | |||
| Code lives in gfx/layers/LayerTreeInvalidation.{h,cpp}. | |||
| Computes changes in layer trees and reports the invalid area. | |||
| Used to find changes in inactive layer trees, compute widget dirty rects (BasicLayers only) and report MozAfterPaint events. | |||
| = Potential Problems = | = Potential Problems = | ||