We accumulate the local rect of primitives to get a local rect for each Picture, and then the screen bounding rect of each primitive.
Most of the time (there are exceptions) we don't actually need the screen space bounding rect of each primitive, but we spend a lot of time calculating them.
Instead, we could possibly calculate it for the enclosing Picture, and then:
- If it's completely visible, no need to calculate primitive rects - trivial accept all child prims.
- It it's completely clipped, no need to calculate primitive rects - trivial reject all child prims.
- If it's partially visible, calculate individual primitive screen rects, if it makes sense to.
This could save a significant amount of CPU time.