RESOLVED FIXED 204721
Disable LocalCurrentGraphicsContext when doing DisplayList recording
https://bugs.webkit.org/show_bug.cgi?id=204721
Summary Disable LocalCurrentGraphicsContext when doing DisplayList recording
Tim Horton
Reported 2019-11-30 14:54:15 PST
Disable LocalCurrentGraphicsContext when doing DisplayList recording
Attachments
Patch (2.32 KB, patch)
2019-11-30 14:54 PST, Tim Horton
no flags
Patch (2.50 KB, patch)
2019-12-01 19:10 PST, Tim Horton
no flags
Tim Horton
Comment 1 2019-11-30 14:54:25 PST
Tim Horton
Comment 2 2019-11-30 14:55:25 PST
Also fixed some deprecated API usage while I was there
Tim Horton
Comment 3 2019-11-30 15:20:13 PST
Comment on attachment 384549 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=384549&action=review > Source/WebCore/platform/mac/LocalCurrentGraphicsContext.mm:36 > + m_savedNSGraphicsContext = 0; Uh... don't know why 0, I just copied from below. I'll make it `nil`.
Tim Horton
Comment 4 2019-11-30 15:20:24 PST
Also not sure why this doesn't use RetainPtr
Simon Fraser (smfr)
Comment 5 2019-12-01 08:40:17 PST
Comment on attachment 384549 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=384549&action=review >> Source/WebCore/platform/mac/LocalCurrentGraphicsContext.mm:36 >> + m_savedNSGraphicsContext = 0; > > Uh... don't know why 0, I just copied from below. I'll make it `nil`. Should probably WTFLogAlways() or LOG(DisplayLists, ) here to tell us we've done something wrong.
Tim Horton
Comment 6 2019-12-01 14:45:07 PST
We’re not doing anything wrong. Ideally we would log when someone /reads/ it, but that’s code outside of our control.
Tim Horton
Comment 7 2019-12-01 14:46:03 PST
Unless you think we should change every callsite to not create a LocalCurrentGraphicsContext in the display list case, but that seems like too much.
Sam Weinig
Comment 8 2019-12-01 15:46:13 PST
Comment on attachment 384549 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=384549&action=review >>> Source/WebCore/platform/mac/LocalCurrentGraphicsContext.mm:36 >>> + m_savedNSGraphicsContext = 0; >> >> Uh... don't know why 0, I just copied from below. I'll make it `nil`. > > Should probably WTFLogAlways() or LOG(DisplayLists, ) here to tell us we've done something wrong. Wouldn't we want to ASSERT() when using DisplayList, so as to not miss subtle issues? If we are going to have to implement functionality that depends on a global graphics context another way, is there really any point in supporting both ways?
Sam Weinig
Comment 9 2019-12-01 15:48:31 PST
(In reply to Tim Horton from comment #7) > Unless you think we should change every callsite to not create a > LocalCurrentGraphicsContext in the display list case, but that seems like > too much. What is the point(In reply to Sam Weinig from comment #8) > Comment on attachment 384549 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=384549&action=review > > >>> Source/WebCore/platform/mac/LocalCurrentGraphicsContext.mm:36 > >>> + m_savedNSGraphicsContext = 0; > >> > >> Uh... don't know why 0, I just copied from below. I'll make it `nil`. > > > > Should probably WTFLogAlways() or LOG(DisplayLists, ) here to tell us we've done something wrong. > > Wouldn't we want to ASSERT() when using DisplayList, so as to not miss > subtle issues? If we are going to have to implement functionality that > depends on a global graphics context another way, is there really any point > in supporting both ways? Or rather, what is the point of keeping LocalCurrentGraphicsContext if we will have to find alternate implementations for anything that uses it?
Tim Horton
Comment 10 2019-12-01 19:06:50 PST
(In reply to Sam Weinig from comment #8) > Comment on attachment 384549 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=384549&action=review > > >>> Source/WebCore/platform/mac/LocalCurrentGraphicsContext.mm:36 > >>> + m_savedNSGraphicsContext = 0; > >> > >> Uh... don't know why 0, I just copied from below. I'll make it `nil`. > > > > Should probably WTFLogAlways() or LOG(DisplayLists, ) here to tell us we've done something wrong. > > Wouldn't we want to ASSERT() when using DisplayList, so as to not miss > subtle issues? If we are going to have to implement functionality that > depends on a global graphics context another way, is there really any point > in supporting both ways? For the time being, we definitely need to support both ways, since we don't have a solution for things (e.g. form controls) that depend on the global context. Later, I agree! But for now, we can't just rip out the LocalCurrentGraphicsContext invocations, nor can we leave them in unconditionally (because the DL GraphicsContext asserts when you try to get the platformContext). Since I can't do the ideal thing (log when the bad thing actually happens -- when we read), I'll do the thing that smfr suggested so that we don't forget to address this later.
Tim Horton
Comment 11 2019-12-01 19:10:25 PST
WebKit Commit Bot
Comment 12 2019-12-01 19:32:33 PST
Comment on attachment 384590 [details] Patch Clearing flags on attachment: 384590 Committed r252977: <https://trac.webkit.org/changeset/252977>
WebKit Commit Bot
Comment 13 2019-12-01 19:32:35 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 14 2019-12-01 19:33:19 PST
Note You need to log in before you can comment on or make changes to this bug.