Bug 4445

Summary: Optimizations to KCanvas
Product: WebKit Reporter: Tobias Lidskog <tobiaslidskog>
Component: SVGAssignee: Tobias Lidskog <tobiaslidskog>
Status: RESOLVED FIXED    
Severity: Enhancement    
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
KCanvasContainer optimizations
eric: review-
kCanvasItem optimizations eric: review+

Description Tobias Lidskog 2005-08-15 13:41:00 PDT
Some minor changes can be made to KCanvasContainer to optimize bounding box calculation and hit 
testing.
Comment 1 Tobias Lidskog 2005-08-15 13:44:49 PDT
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
Comment 2 Tobias Lidskog 2005-08-15 16:00:29 PDT
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.
Comment 3 Tobias Lidskog 2005-08-15 16:03:59 PDT
Created attachment 3413 [details]
kCanvasItem optimizations

add caching of stroked bounding box, since it's more expensive to calculate
Comment 4 Eric Seidel (no email) 2005-08-16 00:20:44 PDT
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 5 Eric Seidel (no email) 2005-08-16 00:21:53 PDT
Comment on attachment 3410 [details]
KCanvasContainer optimizations

Do you have any way of showing that this is actually faster?
Comment 6 Eric Seidel (no email) 2005-08-16 02:14:03 PDT
Commited item optimizations.  Please file a separate bug for the remaining container optimizations.