Skip to content

Commit

Permalink
Cache the second image.
Browse files Browse the repository at this point in the history
  • Loading branch information
tberthel committed Feb 5, 2025
1 parent c732bae commit f28fffa
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,19 @@ public AllBinaryAndroidImageRotationAnimationFactory(final Image image, final in
this.angleIncrement = angleIncrement;
}

private Image secondImage = null;

@Override
public Animation getInstance(final int instanceId) throws Exception
{
final Image scaledImage = animationFactoryImageScaleUtil.createImage(this.getImage(),
this.animationFactoryInitializationVisitor.width, this.animationFactoryInitializationVisitor.height,
this.scaleProperties.scaleWidth, this.scaleProperties.scaleHeight);
final Image copyOfScaledImage = ImageCopyUtil.getInstance().createImage(scaledImage);
//final Image scaledImage = this.getImage();
//final Image copyOfScaledImage = ImageCopyUtil.getInstance().createImage(scaledImage);
// final Image copyOfScaledImage = ImageCopyUtil.getInstance().createImage(scaledImage);
Image copyOfScaledImage = secondImage;
if(copyOfScaledImage == null) {
secondImage = copyOfScaledImage = ImageCopyUtil.getInstance().createImage(scaledImage);
}

if (this.animationFactoryInitializationVisitor.dx != 0 || this.animationFactoryInitializationVisitor.dy != 0) {

Expand Down

0 comments on commit f28fffa

Please sign in to comment.