<AWT Dev> RFR: 8263363: Minor cleanup of Lanai code - unused code removal and comments correction [v3]
aghaisas at openjdk.java.net
Tue Apr 27 14:35:36 UTC 2021
On Fri, 9 Apr 2021 07:21:57 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
>> This is the only place where we use MTLContext.invalidateCurrentContext() - which when processed in MTLRenderQueue - clears some native stuff and nulls out both mtlc and dstOps pointers maintained in MTLRenderQueue.m. I think, this will be important once we get rid of SET_SCRATCH_SURFACE under JDK-8263309.
> But why you need to invalidate context here? Why do you need "clears some native stuff and nulls out both mtlc and dstOps pointers maintained in MTLRenderQueue.m"?
> In OGL the getCGLConfigInfo() change the state of the OGL state due to "makeCurrentContext", this is why we need to update the lava level state to "invalid", otherwise we will get a mismatch between the state in the native and java state.
I see that MTLContext.invalidateCurrentContext() is not needed here. Also, as this is the only place it is used, we can remove the method altogether.
More information about the awt-dev