Unify Screen adapter ordinal logic

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P5
    • tbd
    • Affects Version/s: jfx22
    • Component/s: 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));
          }
      }

            Assignee:
            Marius Hanl
            Reporter:
            Marius Hanl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: