There are various canvas drawing functions in CanvasRenderingContext2DBase that end similarly: ``` if (isEntireBackingStoreDirty()) didDraw(std::nullopt); else if (repaintEntireCanvas) didDrawEntireCanvas(); else didDraw(... some rect calculation ...); ``` We can factor out the commonality.
<rdar://problem/84834950>
Created attachment 442904 [details] Patch
Comment on attachment 442904 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=442904&action=review > Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:1065 > + return path.fastBoundingRect(); I suppose this is the case where computing the rect is expensive? (thus the lambda)
(In reply to Antti Koivisto from comment #3) > > Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:1065 > > + return path.fastBoundingRect(); > > I suppose this is the case where computing the rect is expensive? (thus the > lambda) I imagine so. I didn't measure. But I know Simon was careful previously not to compute it if not needed.
Tools/Scripts/svn-apply failed to apply attachment 442904 [details] to trunk. Please resolve the conflicts and upload a new patch.
Created attachment 443371 [details] Patch for landing
Created attachment 443374 [details] Patch for landing
Committed r285334 (243897@main): <https://commits.webkit.org/243897@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 443374 [details].