[OpenJDK 2D-Dev] [13] Review Request: 6933331 (d3d/ogl) java.lang.IllegalStateException: Buffers have not been created

Philip Race philip.race at oracle.com
Wed May 15 00:34:58 UTC 2019


Ah yes .. I see. So this looks fine.
I assume you did some testing but I can't imagine what problems
this fix would cause.

-phil.

On 5/14/19, 4:25 PM, Sergey Bylokhov wrote:
> I have dropped the "checkSize" parameter from revalidate() method, it 
> was always "true"
>
> On 14/05/2019 16:20, Philip Race wrote:
>> Why is it not still using checkSize for that case, like this :-
>>
>> if (checkSize && ((getWidth() != width || getHeight() != height))
>> 4256 || drawBuffer == null) {
>> 4257 // component has been resized or the peer was recreated;
>> 4258 // recreate the backbuffers
>>
>>
>> -phil
>>
>> On 5/14/19, 3:15 PM, Sergey Bylokhov wrote:
>>> Hello.
>>> Please review the fix for JDK 13.
>>>
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-6933331
>>> Fix: http://cr.openjdk.java.net/~serb/6933331/webrev.00
>>>
>>> While working on enabling LCD rendering on macOS via BufferStrategy 
>>> rendering, I was able to find this bug, which was previously mainly 
>>> reported on Windows where we use this code path. Usually the problem 
>>> described as an intermittent exception after "changing display 
>>> resolutions", and I think that the root cause is that in such 
>>> intermittent situations we will recreate the peer of the component 
>>> when we cannot update the  GraphicConfig information on the fly in 
>>> the java.awt.Component.java:
>>> =========
>>> void setGraphicsConfiguration(GraphicsConfiguration gc) {
>>> 1155         synchronized(getTreeLock()) {
>>> 1156             if (updateGraphicsData(gc)) {
>>> 1157                 removeNotify();
>>> 1158                 addNotify();
>>> 1159             }
>>> 1160         }
>>> 1161     }
>>> =========
>>>
>>> The bug can be easily reproduced if we will enable buffer strategy 
>>> for the Window, and then dispose of the Window, and show again. In 
>>> this case, the Window will drop internal buffers used by the 
>>> bufferstrategy in the removeNotify() method, and we will get an 
>>> exception when later the buffer strategy will try to use them.
>>>
>>> As a solution, I suggest recreating the backbuffers in the 
>>> bufferStrategy if the old buffer was disposed of.
>>>
>
>


More information about the 2d-dev mailing list