Fix animated

This commit is contained in:
tarsin committed 2022-07-25 09:28:40 +08:00
1 parent 500163fe1a
commit 80a20f25b9
7 files changed
+38 -66

No files matched your search

@@ -216,14 +216,6 @@ public final class Image {
return delay <= 10 ? 100 : delay;
}
/**
* Return frame count. 1 for non-animation image
*/
public int getFrameCount() {
checkRecycled();
return nativeFrameCount(mNativePtr, mFormat);
}
/**
* Return is the image opaque
*/
@@ -46,7 +46,6 @@ public final class ImageBitmap implements Animatable, Runnable {
private final int mFormat;
private final boolean mIsOpaque;
private final int mByteCount;
private final int mFrameCount;
private final Set<WeakReference<Callback>> mCallbackSet = new LinkedHashSet<>();
@Nullable
private Image mImage;
@@ -62,9 +61,8 @@ public final class ImageBitmap implements Animatable, Runnable {
mFormat = image.getFormat();
mIsOpaque = image.isOpaque();
mByteCount = image.getByteCount();
mFrameCount = image.getFrameCount();
if (mFrameCount > 1) {
if (mFormat == 1) {
// For animated image, save image object
mImage = image;
} else {
@@ -78,7 +76,6 @@ public final class ImageBitmap implements Animatable, Runnable {
mBitmap = bitmap;
mIsOpaque = !bitmap.hasAlpha();
mByteCount = bitmap.getRowBytes() * bitmap.getHeight();
mFrameCount = 1;
}
/**
@@ -238,13 +235,6 @@ public final class ImageBitmap implements Animatable, Runnable {
return mImage != null;
}
/**
* Return image frame count
*/
public int getFrameCount() {
return mFrameCount;
}
/**
* Draw image to canvas
*/