Bug 4445 - Optimizations to KCanvas
Summary: Optimizations to KCanvas
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Enhancement
Assignee: Tobias Lidskog
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-15 13:41 PDT by Tobias Lidskog
Modified: 2005-08-16 02:14 PDT (History)
0 users

See Also:


Attachments
KCanvasContainer optimizations (2.29 KB, patch)
2005-08-15 13:44 PDT, Tobias Lidskog
eric: review-
Details | Formatted Diff | Diff
kCanvasItem optimizations (1.61 KB, patch)
2005-08-15 16:03 PDT, Tobias Lidskog
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.