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

A simple animation is jerky

XMLWordPrintable

      When I have a simple animation of a circle moving across the screen I get "jerks" about every 0.5 seconds.

      Here is the code:

      import javafx.animation.Interpolator;
      import javafx.animation.TranslateTransition;
      import javafx.application.Application;
      import javafx.scene.Group;
      import javafx.scene.Scene;
      import javafx.scene.paint.Color;
      import javafx.scene.shape.Circle;
      import javafx.stage.Stage;
      import javafx.util.Duration;
       
      public class SmoothMovementTest extends Application {
          @Override
          public void start(Stage stage) throws Exception {
              Group root = new Group();
              Scene scene = new Scene(root, 800, 400, Color.WHITE);
              stage.setScene(scene);
       
              Circle circle = new Circle(50.0, Color.RED);
              circle.setCenterX(50.0);
              circle.setCenterY(200.0);
              root.getChildren().add(circle);
       
              TranslateTransition transition = new TranslateTransition(new Duration(5000.0), circle);
              transition.setToX(700.0);
              transition.setAutoReverse(true);
              transition.setCycleCount(10);
              transition.setInterpolator(Interpolator.LINEAR);
       
              stage.setVisible(true);
       
              transition.playFromStart();
          }
       
          public static void main(String[] args) {
              Application.launch(args);
          }
      }

      and here is some debug info:

      Prism pipeline init order: d3d j2d
      Using openpisces for shapes, t2k for text rasterization
      Using dirty region optimizations
      Prism pipeline name = com.sun.prism.d3d.D3DPipeline
      (X)(1) D3D loading native lib
      prism-d3d loaded.
      [I] OS Version = OS_WINXP Pro
      (I) CheckAdaptersInfo
      (I) ------------------
      (I) Adapter Ordinal : 0
      (I) Adapter Handle : 0x10001
      (I) Description : NVIDIA GeForce 8400 GS
      (I) GDI Name, Driver : \\.\DISPLAY1, nv4_disp.dll
      (I) Vendor Id : 0x10de
      (I) Device Id : 0x06e4
      (I) SubSys Id : 0x0
      (I) Driver Version : 6.14.11.8250
      [I] GUID : {D7B71E3E-45A4-11CF-8A43-0B2000C2CB35}
      (I) D3DPPLM::CheckDeviceCaps: adapter 0: Passed
      (I) ------------------
      (I) Adapter Ordinal : 1
      (I) Adapter Handle : 0x10003
      (I) Description : NVIDIA GeForce 8400 GS
      (I) GDI Name, Driver : \\.\DISPLAY3, nv4_disp.dll
      (I) Vendor Id : 0x10de
      (I) Device Id : 0x06e4
      (I) SubSys Id : 0x0
      (I) Driver Version : 6.14.11.8250
      [I] GUID : {D7B71E3E-45A4-11CF-8A43-0B2000C2CB35}
      (I) D3DPPLM::CheckDeviceCaps: adapter 1: Passed
      (I) ------------------
      (X)d3dEnabled =true
      (X) Got class = class com.sun.prism.d3d.D3DPipeline
      D3DPipeline:getInstance(), d3dEnabled=true
      Initialized prism pipeline: com.sun.prism.d3d.D3DPipeline
      JavaFX: using com.sun.javafx.tk.quantum.QuantumToolkit
      RESIZE: 811590258988782 w: 800 h: 400
      (I) D3DContext::InitContext device 0
      (I) D3DContext::ConfigureContext device 0
      (I) D3DContext::ConfigureContext: successfully created device: 0
      (I) D3DContext::InitDevice: device 0
      (I) D3DContext::InitDevice: successfully initialized device 0
      QuantumRenderer: shutdown
      (E) call to JavaD3DResourceFactoryDummy

            morris Morris Meyer (Inactive)
            ndarcy Nick D'Arcy
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: