On Tue, 16 Feb 2021 15:42:51 GMT, Kevin Rushforth <k...@openjdk.org> wrote:

>> This is a good starting point, but it will need additional work, possibly in 
>> the native D3D code as well as on the Java side, to fully cleanup and 
>> recreate all of the resources after the device is recreated. As discussed 
>> offline, I'll take a stab at this using your PR as a starting point.
>> 
>> I ran some tests this afternoon. It does detect that the devide was removed, 
>> and the disposes and recreates the device, but then it has problem drawing 
>> anything with a texture; it throws an exception and there are rendering 
>> artifacts:
>> 
>> KCR: create resource factor for screen 0
>> D3DContext::testCooperativeLevel
>> D3DContext::testCooperativeLevel
>> D3DContext::testCooperativeLevel
>> D3DContext::testCooperativeLevel
>> D3DContext::testCooperativeLevel
>> KCR: D3DERR_DEVICEREMOVED
>> KCR: dispose graphics pipeline
>> KCR: instance is null: reinitialize D3DPipeline
>> Exception in thread "JavaFX Application Thread" 
>> java.lang.NullPointerException: Cannot invoke 
>> "com.sun.prism.GraphicsPipeline.is3DSupported()" because the return value of 
>> "com.sun.prism.GraphicsPipeline.getPipeline()" is null
>>      at 
>> javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.isSupported(QuantumToolkit.java:1209)
>>      at 
>> javafx.graphics/com.sun.javafx.application.PlatformImpl.isSupportedImpl(PlatformImpl.java:979)
>>      at 
>> javafx.graphics/com.sun.javafx.application.PlatformImpl.isSupported(PlatformImpl.java:646)
>>      at 
>> javafx.graphics/javafx.application.Platform.isSupported(Platform.java:262)
>>      at 
>> javafx.graphics/com.sun.javafx.scene.input.PickResultChooser.processOffer(PickResultChooser.java:182)
>>      at 
>> javafx.graphics/com.sun.javafx.scene.input.PickResultChooser.offer(PickResultChooser.java:143)
>>      at javafx.graphics/javafx.scene.Node.intersects(Node.java:5229)
>>      at javafx.graphics/javafx.scene.Node$1.intersects(Node.java:553)
>>      at 
>> javafx.graphics/com.sun.javafx.scene.NodeHelper.intersects(NodeHelper.java:258)
>>      at 
>> javafx.graphics/javafx.scene.layout.Region.doPickNodeLocal(Region.java:3227)
>>         ...
>>      at javafx.graphics/javafx.scene.Scene.pick(Scene.java:2031)
>>      at 
>> javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3810)
>>      at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1851)
>>      at 
>> javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2584)
>>      at 
>> javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:409)
>>      at 
>> javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:299)
>>      at 
>> java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
>>      at 
>> javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:447)
>>      at 
>> javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:413)
>>      at 
>> javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:446)
>>      at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:556)
>>      at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:942)
>>      at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native 
>> Method)
>>      at 
>> javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
>>      at java.base/java.lang.Thread.run(Thread.java:832)
>> ...
>> KCR: create resource factor for screen 0
>> D3DContext::testCooperativeLevel
>> D3DContext::testCooperativeLevel
>> KCR: dispose graphics pipeline
>> ![HelloFontSize](https://user-images.githubusercontent.com/34689748/107589656-568bf000-6bbb-11eb-9c0d-bea50b190d4d.png)
>
> I created PR #403 using this as a starting point, so I am moving this PR back 
> to draft (and it probably can be closed).

I just created the final PR #430 to fix this bug. As a result, I'm closing this 
PR

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

PR: https://git.openjdk.java.net/jfx/pull/315

Reply via email to