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

TranslateTransition takes too much CPU on Mac

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8u40
    • javafx
    • Mac OS X

      Run this sample program :
      "import javafx.animation.TranslateTransition;
      import javafx.application.Application;
      import static javafx.application.Application.launch;
      import javafx.scene.Scene;
      import javafx.scene.control.Label;
      import javafx.scene.layout.BorderPane;
      import javafx.stage.Stage;
      import javafx.util.Duration;


      public class testTranslate extends Application {

          @Override
          public void start(Stage primaryStage) {

              Label test = new Label("This is a test");
              TranslateTransition transition = new TranslateTransition(Duration.seconds(10), test);
              transition.setFromX(0);
              transition.setToX(1000);
              transition.setCycleCount(-1);
              transition.play();
              BorderPane pane = new BorderPane(test);
              pane.setMinWidth(1000);

              primaryStage.setTitle("Hello World!");
              primaryStage.setScene(new Scene(pane));
              primaryStage.show();
          }

          /**
           * @param args the command line arguments
           */
          public static void main(String[] args) {
              launch(args);
          }

      }
      "

      If you run it on Windows and open the task manager, you will see that your process do not take too much CPU percentage (0 or 1 at most).

      Then run the same program under Mac, open the task manager and you will find that 8% of your CPU is constantly taken for the animation.

            Unassigned Unassigned
            shadzic Samir Hadzic
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Imported: