This repository was archived by the owner on Apr 29, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-22
lines changed Expand file tree Collapse file tree 3 files changed +13
-22
lines changed Original file line number Diff line number Diff line change @@ -363,24 +363,15 @@ bool _hasFrameDurationPassed(TimeSpan timestamp) {
363
363
}
364
364
365
365
void _decodeNextFrameAndSchedule ( ) {
366
- this . _codec . getNextFrame ( ) . Then ( frame => {
367
- this . _nextFrame = frame ;
366
+ var frame = this . _codec . getNextFrame ( ) ;
367
+ this . _nextFrame = frame ;
368
368
369
- if ( this . _codec . frameCount == 1 ) {
370
- this . _emitFrame ( new ImageInfo ( image : this . _nextFrame . image , scale : this . _scale ) ) ;
371
- return ;
372
- }
369
+ if ( this . _codec . frameCount == 1 ) {
370
+ this . _emitFrame ( new ImageInfo ( image : this . _nextFrame . image , scale : this . _scale ) ) ;
371
+ return ;
372
+ }
373
373
374
- SchedulerBinding . instance . scheduleFrameCallback ( this . _handleAppFrame ) ;
375
- } ,
376
- ex => {
377
- this . reportError (
378
- context : "resolving an image frame" ,
379
- exception : ex ,
380
- informationCollector : this . _informationCollector ,
381
- silent : true
382
- ) ;
383
- } ) ;
374
+ SchedulerBinding . instance . scheduleFrameCallback ( this . _handleAppFrame ) ;
384
375
}
385
376
386
377
void _emitFrame ( ImageInfo imageInfo ) {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public class FrameInfo {
12
12
public interface Codec : IDisposable {
13
13
int frameCount { get ; }
14
14
int repetitionCount { get ; }
15
- IPromise < FrameInfo > getNextFrame ( ) ;
15
+ FrameInfo getNextFrame ( ) ;
16
16
}
17
17
18
18
public class ImageCodec : Codec {
@@ -31,13 +31,13 @@ public int repetitionCount {
31
31
get { return 0 ; }
32
32
}
33
33
34
- public IPromise < FrameInfo > getNextFrame ( ) {
34
+ public FrameInfo getNextFrame ( ) {
35
35
D . assert ( this . _image != null ) ;
36
36
37
- return Promise < FrameInfo > . Resolved ( new FrameInfo {
37
+ return new FrameInfo {
38
38
duration = TimeSpan . Zero ,
39
39
image = this . _image
40
- } ) ;
40
+ } ;
41
41
}
42
42
43
43
public void Dispose ( ) {
Original file line number Diff line number Diff line change @@ -116,15 +116,15 @@ void _nextFrame() {
116
116
}
117
117
}
118
118
119
- public IPromise < FrameInfo > getNextFrame ( ) {
119
+ public FrameInfo getNextFrame ( ) {
120
120
this . _nextFrame ( ) ;
121
121
this . _texture . LoadRawTextureData ( this . _frameData . gifFrame . bytes ) ;
122
122
this . _texture . Apply ( ) ;
123
123
this . _frameData . frameInfo = new FrameInfo ( ) {
124
124
image = this . _image ,
125
125
duration = TimeSpan . FromMilliseconds ( this . _frameData . gifFrame . delay )
126
126
} ;
127
- return Promise < FrameInfo > . Resolved ( this . _frameData . frameInfo ) ;
127
+ return this . _frameData . frameInfo ;
128
128
}
129
129
130
130
public void Dispose ( ) {
You can’t perform that action at this time.
0 commit comments