RFR: 8286271: [java.desktop] Replace ternary operators with java.lang.Math min/max

SWinxy duke at openjdk.java.net
Fri May 6 03:50:31 UTC 2022


Delete `sun.java2d.marlin.FloatMath` class in favor of methods in `java.lang.Math`. The methods in `Math.java` are intrinsics and can gain from significant speedups. Hand-written min/max operations are also replaced with calls. 5 uses of `ceil` and 2 uses of `floor` were replaced.
This should not cause any rendering differences from the different algorithms being used, as they theoretically will end up at the same outcomes.

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

Commit messages:
 - Use Math.min and Math.max in more places
 - Use java.lang.Math in Marlin renderer

Changes: https://git.openjdk.java.net/jdk/pull/7097/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7097&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8286271
  Stats: 682 lines in 54 files changed: 0 ins; 529 del; 153 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7097.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7097/head:pull/7097

PR: https://git.openjdk.java.net/jdk/pull/7097



More information about the client-libs-dev mailing list