Some minor changes can be made to KCanvasContainer to optimize bounding box calculation and hit testing.
Created attachment 3410 [details] KCanvasContainer optimizations This patch also fixes two bugs in KCanvasContainer::collisions 1) the recursive loop return without examining all nodes (fixed in kde svn) 2) hit test for fill rect uses bounding box for path including stroke
Updated bug title Will include a few more kcanvas optimizations for review in this bug. Layout tests need to be updated, but I'd rather do that once all changes have been reviewed to make merging easier.
Created attachment 3413 [details] kCanvasItem optimizations add caching of stroked bounding box, since it's more expensive to calculate
Comment on attachment 3413 [details] kCanvasItem optimizations The code could be simpler. + if(d->path && canvas() && canvas()->renderingDevice()) + { + result = bboxPath(true); + } and then an if, storing result in the appropriate place, followed by the return... I'll fix it when landing.
Comment on attachment 3410 [details] KCanvasContainer optimizations Do you have any way of showing that this is actually faster?
Commited item optimizations. Please file a separate bug for the remaining container optimizations.