[Webkit-unassigned] [Bug 211274] Refactor LocalCurrentGraphicsContext to save/restore NSGraphicsContext

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 1 12:10:42 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=211274

--- Comment #1 from Darin Adler <darin at apple.com> ---
I don’t think we should add a new class. The first step would be to use this as-is:

    LocalCurrentGraphicsContext savedContext(*graphicsContext);

Then the question is whether we want to optimize to remove the unneeded calls to GraphicsContext::save/restore that LocalCurrentGraphicsContext does for us. There are two separate reasons save/restore are not needed:

1) we don’t make any changes to the context while using it

2) this temporary context is going to be deallocated after we are doing using it before anyone else uses it

But despite that, I am not sure the optimization is needed. If we wanted to optimize we would either need to make a separate class only used in cases like this, or have some way to tell the constructor either about (1) or about (2).

I would use it as-is and not worry about the modest additional cost of the calls to save/restore, but I can see going further if you like.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200501/e6a37c19/attachment.htm>


More information about the webkit-unassigned mailing list