This commit adds a class hierarchy for storing paint server information
in the display tree. It allows the rendering code for patterns to be
moved out of SPPaintServer and into the /display subdirectory, and allows
patterns to be rendered without accessing the corresponding SPPaintServer.
Smaller changes:
* Fix indentation in display/CMakeLists.txt.
* Add a defensive-coding null check to NRStyle.
This commit rewrites DrawingPattern and related code to reduce
memory usage when rendering patterns.
The main change is to only draw the visible area of patterns.
This involves tracking this information through the DrawingItem
hierarchy and NRStyle so it actually reaches DrawingPattern.
Visibility is determined both by the area being rendered and the
size of the object with the pattern. Then, using a periodically-
wrapped cache, only the part of the pattern tile that is visible
and hasn't been drawn before is actually drawn. NRStyle was
modified to always communicate with DrawingPattern, rather than
cache its pattern when first generated, because more pattern could
need to be drawn at any time.
Caveats: Pattern tiles continue to live outside the cache system,
invisible content is never discarded, and oversampling is disabled
to avoid the exponential growth of tile sizes for nested patterns.
Change the rendering strategy of SPPattern to the same as SPHatch.
That is, instead of creating and tearing down display tree on every
render, create persistent display tree instead.
* This required significant modifications to SPPattern in order to
reliably keep the display tree up-to-date with the object tree.
Most of the complications come from the fact patterns can
reference other patterns, forming href chains.
* The display key system also had to be reworked to avoid key
collisions.
* Fixed a bug in SPStyle resulting in missing updates when a paint
server becomes invalid.
* Removed a no-longer necessary hack from the attribute dialog.
On its own, this commit may result in higher memory usage due to
the increased caching. This is fixed by the next commit.