On Wed, 30 Jun 2021 11:36:18 GMT, Ajit Ghaisas <aghai...@openjdk.org> wrote:

>> Final blit operation in MTLLayer.blitTexture() is driven by CVDisplayLink in 
>> Metal.
>> In this test case we are hitting an invalid condition because of which we 
>> exit from MTLLayer.blitTexture(), but we are not stopping the CVDisplayLink. 
>> This is causing the CVDisplayLink callback to run in loop. Fix is to stop 
>> CVDisplayLink when we return without completing final blit operation in 
>> MTLLayer.blitTexture().
>> 
>> Sanity and performance analysis is green. More details in JBS.
>
> src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m line 88:
> 
>> 86: 
>> 87:     if (self.nextDrawableCount != 0) {
>> 88:         [self stopDisplayLink];
> 
> Please check invoking stopDisplayLink at this place.  If a Drawable is not 
> available, we should return from here but recheck after 16ms. A drawable 
> might be made available on subsequent attempts.
> 
> Stopping DisplayLink at other invalid cases makes sense.

@aghaisas Thanks for the review. Redraw of static content is driven by 
setNeedsDisplay, because we stop CVDisplayLink once final blit is done. Also 
with preliminary testing i see that we are not hitting this condition at all 
after CVDisplayLink is enabled. We still have a verification task under 
https://bugs.openjdk.java.net/browse/JDK-8258583 . Stopping or not stopping 
CVDisplayLink at this place is not causing any change. I will go ahead and 
remove stopDisplayLink at this place, in future if we hit this code because of 
some boundary condition we can enable it and verify.

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

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

Reply via email to