On Mon, 19 Sep 2022 20:14:24 GMT, Harshitha Onkar <hon...@openjdk.org> wrote:

> I was also thinking if we can - may be precompute & store all the corner 
> values in a `HashMap` for all the scale values that we can expect?

It depends on how often this value is being computed and how complicated the 
computation is. Since we request the current transform value anyways on every 
paint i do not see how accessing the HashMap would be more beneficial than the 
simple floating point multiplication and a rounding up the result. Just make 
the static final constant storing the default corner size and a local variable 
that stores the calculated current corner. You can try to use HashMap but i 
doubt it will make much difference performance wise. It is not a complex 
calculation. I might be wrong so you can try both ways and check for the 
performance impact.

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

PR: https://git.openjdk.org/jdk/pull/10274

Reply via email to