changeset 1820:923b26ed6ea4

Automated merge with ssh://jfxsrc.us.oracle.com//javafx/8.0/MASTER/jfx/rt
author kcr
date Fri, 19 Oct 2012 05:00:04 -0700
parents dafaa830d4d0 609ede4dbba0
children 99a390cd0ec5
files
diffstat 4 files changed, 7 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-common/src/com/sun/javafx/tk/ImageLoader.java	Thu Oct 18 14:33:46 2012 -0700
+++ b/javafx-ui-common/src/com/sun/javafx/tk/ImageLoader.java	Fri Oct 19 05:00:04 2012 -0700
@@ -29,7 +29,6 @@
 public interface ImageLoader {
     public boolean getError();
     public int getFrameCount();
-    public PlatformImage[] getFrames();
     public PlatformImage getFrame(int index);
     public int getFrameDelay(int index);
     public int getWidth();
--- a/javafx-ui-common/src/javafx/scene/image/Image.java	Thu Oct 18 14:33:46 2012 -0700
+++ b/javafx-ui-common/src/javafx/scene/image/Image.java	Fri Oct 19 05:00:04 2012 -0700
@@ -752,7 +752,7 @@
     // Generates the animation Timeline for multiframe images.
     private void makeAnimationTimeline(ImageLoader loader) {
         // create and start the animation thread.
-        final PlatformImage[] frames = loader.getFrames();
+        final int frameCount = loader.getFrameCount();
 
         timeline = new Timeline();
         timeline.setCycleCount(Timeline.INDEFINITE);
@@ -760,16 +760,18 @@
         final ObservableList<KeyFrame> keyFrames = timeline.getKeyFrames();
 
         int duration = 0;
-        for (int i = 0; i < frames.length; ++i) {
-            keyFrames.add(createPlatformImageSetKeyFrame(duration, frames[i]));
+        for (int i = 0; i < frameCount; ++i) {
+            keyFrames.add(createPlatformImageSetKeyFrame(duration, loader.getFrame(i)));
             duration = duration + loader.getFrameDelay(i);
         }
+        
+        PlatformImage zeroFrame = loader.getFrame(0);
 
         // Note: we need one extra frame in the timeline to define how long
         // the last frame is shown, the wrap around is "instantaneous"
-        keyFrames.add(createPlatformImageSetKeyFrame(duration, frames[0]));
+        keyFrames.add(createPlatformImageSetKeyFrame(duration, zeroFrame));
 
-        setPlatformImageWH(frames[0], loader.getWidth(), loader.getHeight());
+        setPlatformImageWH(zeroFrame, loader.getWidth(), loader.getHeight());
         timeline.play();
     }
 
--- a/test-stub-toolkit/src/com/sun/javafx/pgstub/StubImageLoader.java	Thu Oct 18 14:33:46 2012 -0700
+++ b/test-stub-toolkit/src/com/sun/javafx/pgstub/StubImageLoader.java	Fri Oct 19 05:00:04 2012 -0700
@@ -74,11 +74,6 @@
     }
 
     @Override
-    public PlatformImage[] getFrames() {
-        return frames;
-    }
-
-    @Override
     public PlatformImage getFrame(final int i) {
         return frames[i];
     }
--- a/test-stub-toolkit/src/com/sun/javafx/pgstub/StubImageLoaderFactory.java	Thu Oct 18 14:33:46 2012 -0700
+++ b/test-stub-toolkit/src/com/sun/javafx/pgstub/StubImageLoaderFactory.java	Fri Oct 19 05:00:04 2012 -0700
@@ -51,11 +51,6 @@
                 }
 
                 @Override
-                public PlatformImage[] getFrames() {
-                    throw new IllegalStateException();
-                }
-
-                @Override
                 public PlatformImage getFrame(int i) {
                     throw new IllegalStateException();
                 }