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

Animation performance depends on window size in Debian

XMLWordPrintable

    • x86_64
    • linux_debian_3.0

      ADDITIONAL SYSTEM INFORMATION :
      Debian 10

      A DESCRIPTION OF THE PROBLEM :
      We have a intel HD Graphics 500 (Xorg says i915, DRI driver i965) with Debian.
      xorg.conf:
      Section "Device"
      Identifier "Configured Video Device"
      Driver "intel"
      Option "DRI" "3"
      Option "TearFree" "true"
      Option "AccelMethod" "sna"
      EndSection

      Xorg.log:
      [ 18.488] (II) Module intel: vendor="X.Org Foundation"
      [ 18.488] compiled for 1.20.1, module version = 2.99.917
      [ 18.488] Module class: X.Org Video Driver
      [ 18.488] ABI class: X.Org Video Driver, version 24.0
      [ 18.488] (II) intel: Driver for Intel(R) Integrated Graphics Chipsets:
      i810, i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G,
      915G, E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM,
      Pineview G, 965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33,
      GM45, 4 Series, G45/G43, Q45/Q43, G41, B43
      [ 18.505] (II) intel(0): Using Kernel Mode Setting driver: i915, version 1.6.0 20200917
      [ 18.505] (II) intel(0): SNA compiled: xserver-xorg-video-intel 2:2.99.917+git20180925-2 (Andreas Boll <aboll@debian.org>)
      [ 18.505] (II) intel(0): SNA compiled for use with valgrind
      [ 18.519] (--) intel(0): Integrated Graphics Chipset: Intel(R) HD Graphics 500
      [ 18.520] (--) intel(0): CPU: x86, sse2, sse3, ssse3, sse4.1, sse4.2; using a maximum of 2 threads
      [ 18.520] (II) intel(0): Creating default Display subsection in Screen section
      "Default Screen" for depth/fbbpp 24/32
      [ 18.520] (==) intel(0): Depth 24, (--) framebuffer bpp 32
      [ 18.520] (==) intel(0): RGB weight 888
      [ 18.520] (==) intel(0): Default visual is TrueColor
      [ 18.520] (**) intel(0): Option "DRI" "3"
      [ 18.522] (II) intel(0): Output eDP1 using monitor section Configured Monitor
      [ 18.522] (**) intel(0): Found backlight control interface intel_backlight (type 'raw') for output eDP1
      [ 18.522] (II) intel(0): Enabled output eDP1
      [ 18.522] (II) intel(0): Output DP1 has no monitor section
      [ 18.523] (II) intel(0): Enabled output DP1
      [ 18.523] (--) intel(0): Using a maximum size of 256x256 for hardware cursors
      [ 18.523] (II) intel(0): Output VIRTUAL1 has no monitor section
      [ 18.523] (II) intel(0): Enabled output VIRTUAL1
      [ 18.523] (--) intel(0): Output eDP1 using initial mode 1366x768 on pipe 0
      [ 18.523] (==) intel(0): TearFree disabled
      [ 18.523] (==) intel(0): Using gamma correction (1.0, 1.0, 1.0)
      [ 18.528] (**) intel(0): Display dimensions: (211, 158) mm
      [ 18.528] (**) intel(0): DPI set to (164, 123)
      [ 18.528] (II) Loading sub module "dri3"
      [ 18.528] (II) LoadModule: "dri3"
      [ 18.528] (II) Module "dri3" already built-in
      [ 18.528] (II) Loading sub module "dri2"
      [ 18.528] (II) LoadModule: "dri2"
      [ 18.528] (II) Module "dri2" already built-in
      [ 18.528] (II) Loading sub module "present"
      [ 18.528] (II) LoadModule: "present"
      [ 18.528] (II) Module "present" already built-in
      [ 18.532] (II) intel(0): SNA initialized with Broxton (gen9) backend
      [ 18.532] (==) intel(0): Backing store enabled
      [ 18.532] (==) intel(0): Silken mouse enabled
      [ 18.533] (II) intel(0): HW Cursor enabled
      [ 18.534] (==) intel(0): Display hotplug detection enabled
      [ 18.535] (II) intel(0): [DRI2] Setup complete
      [ 18.535] (II) intel(0): [DRI2] DRI driver: i965
      [ 18.535] (II) intel(0): [DRI2] VDPAU driver: va_gl
      [ 18.535] (II) intel(0): direct rendering: DRI2 DRI3 enabled
      [ 18.535] (II) intel(0): hardware support for Present enabled
      [ 18.535] (II) Initializing extension Generic Event Extension
      [ 18.536] (II) Initializing extension SHAPE
      [ 18.536] (II) Initializing extension MIT-SHM
      [ 18.537] (II) Initializing extension XInputExtension
      [ 18.539] (II) Initializing extension XTEST
      [ 18.540] (II) Initializing extension BIG-REQUESTS
      [ 18.540] (II) Initializing extension SYNC
      [ 18.542] (II) Initializing extension XKEYBOARD
      [ 18.543] (II) Initializing extension XC-MISC
      [ 18.543] (II) Initializing extension SECURITY
      [ 18.545] (II) Initializing extension XFIXES
      [ 18.545] (II) Initializing extension RENDER
      [ 18.546] (II) Initializing extension RANDR
      [ 18.547] (II) Initializing extension COMPOSITE
      [ 18.558] (II) Initializing extension DAMAGE
      [ 18.558] (II) Initializing extension MIT-SCREEN-SAVER
      [ 18.559] (II) Initializing extension DOUBLE-BUFFER
      [ 18.559] (II) Initializing extension RECORD
      [ 18.560] (II) Initializing extension DPMS
      [ 18.560] (II) Initializing extension Present
      [ 18.565] (II) Initializing extension DRI3
      [ 18.565] (II) Initializing extension X-Resource
      [ 18.566] (II) Initializing extension XVideo
      [ 18.566] (II) Initializing extension XVideo-MotionCompensation
      [ 18.566] (II) Initializing extension SELinux
      [ 18.566] (II) SELinux: Disabled on system
      [ 18.566] (II) Initializing extension GLX
      [ 18.630] (II) AIGLX: Loaded and initialized i965
      [ 18.630] (II) GLX: Initialized DRI2 GL provider for screen 0
      [ 18.630] (II) Initializing extension XFree86-VidModeExtension
      [ 18.630] (II) Initializing extension XFree86-DGA
      [ 18.631] (II) Initializing extension XFree86-DRI
      [ 18.631] (II) Initializing extension DRI2

      The bigger the JavaFx window size the more CPU the java process consumes with the same animation running.

      Is this normal? Is there something wrong with our setup?
      I have written a small example to test the animations and gif.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the example with minimized and maximized window and watch the CPU load

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      CPU load is constant for animations and independet from window size
      ACTUAL -
      The bigger the window the more CPU is used

      ---------- BEGIN SOURCE ----------
      package tester;

      import javafx.animation.Animation;
      import javafx.animation.Interpolator;
      import javafx.animation.RotateTransition;
      import javafx.application.Application;
      import javafx.scene.CacheHint;
      import javafx.scene.Node;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.ProgressBar;
      import javafx.scene.control.ProgressIndicator;
      import javafx.scene.image.Image;
      import javafx.scene.image.ImageView;
      import javafx.scene.layout.HBox;
      import javafx.scene.layout.Priority;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;
      import javafx.util.Duration;

      public class AnimationTester extends Application
      {
        public static void main(String[] args)
        {
          Application.launch(AnimationTester.class, args);
        }

        private VBox parent;

        @Override
        public void start(Stage primaryStage) throws Exception
        {
          primaryStage.setScene(createScene());
      // primaryStage.setFullScreen(true);
          primaryStage.show();
          primaryStage.sizeToScene();
          primaryStage.centerOnScreen();
        }

        private Scene createScene()
        {
          parent = new VBox();
          createContent();
          return new Scene(parent);
        }

        private void createContent()
        {
          parent.getChildren().clear();
          parent.getChildren().addAll(createProgress(), createRotation(), createRotation(), createGIF(), createGIF());
        }

        private Node createGIF()
        {
          Image gif = new Image(getClass().getResource("ICON_LABELER_RUNNING.gif").toExternalForm());
          ImageView icon = new ImageView();
      // icon.setStyle("-fx-background-color: blue");
          return createStartStop(icon, () -> icon.setImage(gif), () -> icon.setImage(null));
        }

        private Node recreateContent()
        {
          Button btn = new Button("neue instanzen");
          btn.setOnAction(e -> createContent());
          return btn;
        }

        private Node createRotation()
        {
          Image image = new Image(getClass().getResource("ICON_LABELER_RUNNING.png").toExternalForm());
          ImageView icon = new ImageView(image);
          RotateTransition rotation = new RotateTransition();
          icon.setCacheHint(CacheHint.ROTATE);
          icon.setCache(true);
          
      // rotation.setRate(0.5);
      // rotation.setByAngle(360);
      // rotation.setAxis(Rotate.Z_AXIS);
          rotation.setInterpolator(Interpolator.LINEAR);
          rotation.setDuration(Duration.seconds(3));
      // rotation.setFromAngle(0d);
          rotation.setToAngle(360d);
          rotation.setCycleCount(Animation.INDEFINITE);
      // rotation.setAutoReverse(true);

          rotation.setNode(icon);
          return createStartStop(icon, rotation::play, rotation::pause);
        }

        private Node createProgress()
        {
          ProgressBar bar = new ProgressBar(0);
          return createStartStop(bar, () -> bar.setProgress(ProgressIndicator.INDETERMINATE_PROGRESS),
                                 () -> bar.setProgress(0));
        }

        private Node createStartStop(Node node, Runnable start, Runnable stop)
        {
          Button btnStart = new Button("Start");
          btnStart.setOnAction(e -> start.run());
          Button btnStop = new Button("Stop");
          btnStop.setOnAction(e -> stop.run());
          HBox.setHgrow(node, Priority.ALWAYS);
          HBox b = new HBox(node, new VBox(btnStart, btnStop));
          b.setSpacing(20);
          return b;
        }
      }

      ---------- END SOURCE ----------

      FREQUENCY : always


            kcr Kevin Rushforth
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: