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

Unify Screen adapter ordinal logic

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P5 P5
    • tbd
    • jfx22
    • javafx
    • generic
    • generic

      After JDK-8283401 was fixed, we now have 2 place with the same logic.
      See also this comment on the PR: https://github.com/openjdk/jfx/pull/1200#issuecomment-1671954361

      Location 1 in QuantumToolkit:
      GraphicsPipeline pipeline = GraphicsPipeline.getPipeline();
      for (Screen screen : Screen.getScreens()) {
          screen.setAdapterOrdinal(pipeline.getAdapterOrdinal(screen));
      }

      Location 2 in D3DPipeline:
      for (Screen screen : Screen.getScreens()) {
          screen.setAdapterOrdinal(getAdapterOrdinal(screen));
      }

      Idea:
      Static method inside Screen.

      public static void assignAdapterOrdinals() {
          GraphicsPipeline pipeline = GraphicsPipeline.getPipeline();
          for (Screen screen : Screen.getScreens()) {
              screen.setAdapterOrdinal(pipeline.getAdapterOrdinal(screen));
          }
      }

            mhanl Marius Hanl
            mhanl Marius Hanl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: