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

Rendering cached nodes with sub-pixel translation is blurry

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 8, openjfx11, openjfx16
    • Fix Version/s: tbd
    • Component/s: javafx
    • Labels:

      Description

      This is a follow-on to JDK-8211294.

      To reproduce the bug, run the attached test program. This test program renders three controls with or without node caching enabled. The top two controls are deliberately rendered with fractional values of layoutX and layoutY. When caching is enabled, you can see that the text in those controls is blurry. When caching is disabled, the text is not blurry.

      Rendering a shape or control into a cache and then rendering that cached image should match rendering that shape or control directly. This should be true the first time it is rendered, and should remain true as long as the transform is unchanged (or differs only by a translation delta of a whole pixel value) from when the cache was rendered into.

      This is currently broken for rendering text if the translation is not on a pixel boundary, and is the main reason that the snap-to-pixel bug in JDK-8211294 led to such noticeable blurriness.

       See https://git.openjdk.java.net/jfx/pull/308 for some discussion on this.

        Attachments

        1. Blur.java
          1 kB
        2. CacheDisabled.png
          CacheDisabled.png
          5 kB
        3. CacheEnabled.png
          CacheEnabled.png
          7 kB

          Issue Links

            Activity

              People

              Assignee:
              kcr Kevin Rushforth
              Reporter:
              kcr Kevin Rushforth
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: