TextRegionUtil region cache collisions for short strings

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

TextRegionUtil region cache collisions for short strings

Cyannide
I'm using com.jogamp.graph.curve.opengl.TextRegionUtil.java to render text and came across this for "OP" and "P1". Once "P1" becomes visible (and is rendered first) all instances of "OP" get rendered as "P1" because of a cache collision. I replaced the CharSequence.hashCode() with FNV1a hash since it performs well with short strings.

Should I submit a patch for it? Is there a preferred hash function that should be used instead of FNV?
Reply | Threaded
Open this post in threaded view
|

Re: TextRegionUtil region cache collisions for short strings

gouessej
Administrator
Hi

Please fill a bug report and make a pull request. I'll study your code and let you know whether it can be integrated in JOGL. Of course, a unit test would be welcome too.
Julien Gouesse | Personal blog | Website