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

9-Slice stretched areas are wrong in SW

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • javafx
    • None

      Given:

      public class Test extends Application {
          public void start(Stage stage) {
              Region r = new Region();
              r.setStyle(
                      "-fx-border-image-source: url('border-stretch.png');" +
                      "-fx-border-image-slice: 14;" +
                      "-fx-border-image-width: 14;" +
                      "-fx-border-image-repeat: stretch;");
              r.setPrefSize(300, 200);
              r.setLayoutX(50);
              r.setLayoutY(50);
              Scene s = new Scene(new Group(r), 400, 300);
              stage.setScene(s);
              stage.show();
          }
      }

      and given that both border-stretch.png and the Test class are in the default package, you should see different output depending on whether you run with HW (ES2 or D3D) or SW. In the case of ES2 or D3D, a bit of the green corner is included in the stretched gradient, in the case of SW it is simply RED->BLUE in the gradient, which is what was intended.

      I don't know where the bug is -- it could be in the ES2 & D3D hardware pipelines, or it could be in SW and NGRegion (where SW and NGRegion have the same assumptions as to how image drawing works, that is inconsistent with what it should be). In any case, the SW screenshot is what I was expecting to see, and the ES2 screenshot is what I actually observed.

        1. border-stretch.png
          border-stretch.png
          1 kB
        2. ES2.png
          ES2.png
          30 kB
        3. SW.png
          SW.png
          29 kB

            msoch Martin Ĺ och (Inactive)
            rbair Richard Bair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: