SVG:CoveredRegions: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 6: Line 6:


When we need to invalidate an SVG element, we normally just ask the nsSVGOuterSVGFrame to invalidate its covered region. But we need to adjust the region to account for filter effects on the element and its ancestors; this is done using nsSVGUtils::FindFilterInvalidation, which propagates the dirty rect up through the ancestors, adjusting the rect as we go for each ancestor with a filter. When we change the covered region to include leaf filter effects, FindFilterInvalidation will need to skip adjust for the filter on the frame that's being invalidated.
When we need to invalidate an SVG element, we normally just ask the nsSVGOuterSVGFrame to invalidate its covered region. But we need to adjust the region to account for filter effects on the element and its ancestors; this is done using nsSVGUtils::FindFilterInvalidation, which propagates the dirty rect up through the ancestors, adjusting the rect as we go for each ancestor with a filter. When we change the covered region to include leaf filter effects, FindFilterInvalidation will need to skip adjust for the filter on the frame that's being invalidated.
== Lazy caching ==
We don't cache covered regions on all elements.
TODO: Document exactly why not in convincing detail.
Proposal: would lazy caching help? During painting we would calculate and store covered regions, and




Line 43: Line 52:


Whatever name is used, it would probably be a good idea to add the word "Canvas" in there to distinguish between BBox bounds and canvas bounds. Really they are partially computed canvas bounds, so maybe Get/Update/InvalidatePCCBounds would be best? It would certainly stop people jumping to the wrong conclusions about what these functions do, and would hopefully be easy te accurately remember what these functions do for those that have encountered them before and read their documenting comments.
Whatever name is used, it would probably be a good idea to add the word "Canvas" in there to distinguish between BBox bounds and canvas bounds. Really they are partially computed canvas bounds, so maybe Get/Update/InvalidatePCCBounds would be best? It would certainly stop people jumping to the wrong conclusions about what these functions do, and would hopefully be easy te accurately remember what these functions do for those that have encountered them before and read their documenting comments.
Or perhaps just GetInvalidationRect? Since that's what we're using it for. Well, ignoring getBoundingClientRect.


UpdateCoveredRegion(PRBool aInvalidateCanvas = PR_TRUE);
UpdateCoveredRegion(PRBool aInvalidateCanvas = PR_TRUE);
Confirmed users, Bureaucrats and Sysops emeriti
969

edits

Navigation menu