Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8361095

Clarify the purpose of Region.clipRound and clipScale

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 11, 17, 25, 26
    • client-libs
    • 2d

      There are two methods in sun.java2d.pipe.Region: clipRound and clipScale. Each method has a slightly different rounding logic, yet there's no clear indication in which situations one method should be used over the other.

      This came up in code review for JDK-8349188 [1]

      “Please double-check whether you need to use Region.clipScale() instead.

      “I actually do not remember when to use one over the other. Maybe if you find a review request for the patch where these methods were added, you can confirm which one should be used. I checked the current source, and it seems that we randomly use one or the other, which seems incorrect."

      “Probably these discussions may help:
      https://mail.openjdk.org/pipermail/2d-dev/2016-July/007152.html
      https://mail.openjdk.org/pipermail/2d-dev/2016-October/007764.html
      https://mail.openjdk.org/pipermail/2d-dev/2016-October/007772.html (it has a long discussion thread).”


      [1] https://github.com/openjdk/jdk/pull/26025#discussion_r2173117608

            rmahajan Rajat Mahajan
            aivanov Alexey Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: