react-native-fast-image 8.30.0 → 8.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -87,6 +87,8 @@ final class FastImageApngRenderer {
|
|
|
87
87
|
// How many times the file says it plays (0: forever).
|
|
88
88
|
private final int plays;
|
|
89
89
|
private volatile boolean paused = false;
|
|
90
|
+
// Once a frame has been rendered (on the decoder's thread).
|
|
91
|
+
private volatile boolean rendered = false;
|
|
90
92
|
|
|
91
93
|
ApngDrawable(Loader loader, int plays) {
|
|
92
94
|
super(loader);
|
|
@@ -110,7 +112,10 @@ final class FastImageApngRenderer {
|
|
|
110
112
|
// while paused.
|
|
111
113
|
setAutoPlay(!paused);
|
|
112
114
|
if (paused) {
|
|
113
|
-
|
|
115
|
+
// Before the first frame, onStart pauses once it's rendered:
|
|
116
|
+
// the decoder's start clears a pause, then skips rendering if
|
|
117
|
+
// one came in meanwhile, which left the view blank.
|
|
118
|
+
if (rendered) pause();
|
|
114
119
|
} else {
|
|
115
120
|
resume();
|
|
116
121
|
}
|
|
@@ -130,6 +135,12 @@ final class FastImageApngRenderer {
|
|
|
130
135
|
super.start();
|
|
131
136
|
}
|
|
132
137
|
|
|
138
|
+
@Override
|
|
139
|
+
public void onRender(ByteBuffer byteBuffer) {
|
|
140
|
+
super.onRender(byteBuffer);
|
|
141
|
+
rendered = true;
|
|
142
|
+
}
|
|
143
|
+
|
|
133
144
|
// On its decoder thread, once starting has drawn the first frame:
|
|
134
145
|
// starting clears a pause made before it got there, so pause again.
|
|
135
146
|
@Override
|