Closed hervegirod closed 11 years ago
You mean because of deep Swing hierarchies? That makes sense. I'd like to see if there's any performance penalty for doing the matrix manipulation in Java.
Yes, we had a problem when using JTable for example. We changed the code ourselves, but unfortunately we still use the version before you did a huge refactoring so I don't think that the patch would be helpful to you. However the code is there, we just changed the create() method of the GLGraphics2D class which is used whenever Swing opens a new child: http://j661.svn.sourceforge.net/viewvc/j661/j661/trunk/src/ogl/glg2d/GLGraphics2D.java?revision=2602&view=markup
We did not find any performance penalty in our use cases (huge Swing hierarchies), but it may depend on the use case. However we use pretty much any kind of standard Swing widgets. We also have custom widgets which draw vector graphic content on them.
And the dispose() also of course, sorry for not mentioning it. But there is maybe a simpler way to do the same thing.
I'm glad to see you thought through the use of OpenGL stencils for non-rectangular clips. This is something I hadn't looked at yet.
ah yes,I forgot about that.
I fixed the matrix issue with 5058cf967305d872cfd6b47f021a163459ffa49d. Thanks for reporting it.
There is a limit of 30 in the matrix stack in most OpenGL implementations. When using Swing its current to go outside this limit, which will trigger this error. I suggest using a loadMatrix instead, and perform the matrix composition in the Java world