Summary: | [Qt] Path: Fast approximation of stroke bounding rects | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Andreas Kling <kling> | ||||||
Component: | WebCore Misc. | Assignee: | QtWebKit Unassigned <webkit-qt-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | ariya.hidayat | ||||||
Priority: | P2 | Keywords: | Performance, Qt, QtTriaged | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Bug Depends on: | 44018 | ||||||||
Bug Blocks: | |||||||||
Attachments: |
|
Description
Andreas Kling
2010-08-14 13:39:09 PDT
Example page that spends a lot of time in Qt's strokeBoundingRect(): http://sebleedelisle.com/demos/html5landscape.html Created attachment 64425 [details]
Proposed patch
(In reply to comment #1) > Example page that spends a lot of time in Qt's strokeBoundingRect(): > http://sebleedelisle.com/demos/html5landscape.html Speed improvement for this page with the proposed patch: 18.6% About the patch, if we want to narrow down the returned rect further, I suppose the lineWidth could be divided by 2. Comment on attachment 64425 [details]
Proposed patch
Very nice!
Comment on attachment 64425 [details] Proposed patch Clearing flags on attachment: 64425 Committed r65374: <http://trac.webkit.org/changeset/65374> All reviewed patches have been landed. Closing bug. http://trac.webkit.org/changeset/65374 might have broken Qt Linux Release (In reply to comment #7) > http://trac.webkit.org/changeset/65374 might have broken Qt Linux Release Gaaahhh, that's what I get for compiling without SVG support.. http://trac.webkit.org/changeset/65374 broke a bunch of SVG tests. Reopening. Created attachment 64609 [details]
Proposed patch v2
Move the (Qt-specific) logic in CRC2D::stroke() this time so as not to affect SVG.
Comment on attachment 64609 [details]
Proposed patch v2
WebCore/html/canvas/CanvasRenderingContext2D.cpp:833
+ boundingRect.inflate(state().m_miterLimit + state().m_lineWidth);
This means we still ignore the CanvasStrokeStyleApplier, not sure how severe it would be.
A workaround is to expand the boundingRect by the stroke width, sadly this does not take into account miter join.
Clearing the review flag while this is being thought off.
Comment on attachment 64609 [details]
Proposed patch v2
LGTM. re=me
Comment on attachment 64609 [details] Proposed patch v2 Clearing flags on attachment: 64609 Committed r65525: <http://trac.webkit.org/changeset/65525> All reviewed patches have been landed. Closing bug. |