On Wed, 30 Jun 2021 04:00:54 GMT, Jayathirth D V <j...@openjdk.org> wrote:

>> src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m line 286:
>> 
>>> 284:     if (layer == NULL || ctx == NULL) {
>>> 285:         J2dTraceLn(J2D_TRACE_VERBOSE, "MTLLayer_blit : Layer or 
>>> Context is null");
>>> 286:         [layer stopDisplayLink];
>> 
>> What happens if we exit before this "blitTexture" is called? Do not we need 
>> to stop(w/o possibility to restart it) that thread on toolkit shutdown or 
>> something like this?
>
> At this point if we exit, we just return and unlock MTLRenderQueue for 
> backbuffer rendering. And when it is done we again start CVDisplayLink in 
> MTLRenderQueue which in turn calls setNeedsDisplay to get callback to 
> MTLLayer.display().
> 
> This scenario is same as returning from CGLLayer.blitTexture() when textureID 
> is 0. Appkit thread will be running in the background and we dont stop it.

No, I meant if we dispose the frame/exist from the app/etc before 
"Java_sun_java2d_metal_MTLLayer_blitTexture" method is executed but after we 
call "startDisplayLink", when we will call the stopDisplayLink in this case?

-------------

PR: https://git.openjdk.java.net/jdk17/pull/175

Reply via email to