|
|
|
|
|
|
new UIWidgetsErrorDetails( |
|
|
|
exception: ex, |
|
|
|
library: "image resource service", |
|
|
|
context: "by a synchronously-called image error listener" |
|
|
|
context: "when reporting an error to an image listener" |
|
|
|
) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
this._scale = scale; |
|
|
|
this._informationCollector = informationCollector; |
|
|
|
|
|
|
|
this._framesEmitted = 0; |
|
|
|
this._timer = null; |
|
|
|
|
|
|
|
codec.Then((Action<Codec>) this._handleCodecReady, ex => { |
|
|
|
this.reportError( |
|
|
|
context: "resolving an image codec", |
|
|
|
|
|
|
FrameInfo _nextFrame; |
|
|
|
TimeSpan? _shownTimestamp; |
|
|
|
TimeSpan? _frameDuration; |
|
|
|
int _framesEmitted; |
|
|
|
int _framesEmitted = 0; |
|
|
|
|
|
|
|
bool _frameCallbackScheduled = false; |
|
|
|
this._decodeNextFrameAndSchedule(); |
|
|
|
if (this.hasListeners) { |
|
|
|
this._decodeNextFrameAndSchedule(); |
|
|
|
} |
|
|
|
this._frameCallbackScheduled = false; |
|
|
|
if (!this.hasListeners) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
TimeSpan delay = this._frameDuration.Value - (timestamp - this._shownTimestamp.Value); |
|
|
|
delay = new TimeSpan((long) (delay.Ticks * SchedulerBinding.instance.timeDilation)); |
|
|
|
this._timer = Window.instance.run(delay, |
|
|
|
() => { SchedulerBinding.instance.scheduleFrameCallback(this._handleAppFrame); }); |
|
|
|
this._timer = Window.instance.run(delay, this._scheduleAppFrame); |
|
|
|
} |
|
|
|
|
|
|
|
bool _isFirstFrame() { |
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
this._scheduleAppFrame(); |
|
|
|
} |
|
|
|
|
|
|
|
void _scheduleAppFrame() { |
|
|
|
if (this._frameCallbackScheduled) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
this._frameCallbackScheduled = true; |
|
|
|
SchedulerBinding.instance.scheduleFrameCallback(this._handleAppFrame); |
|
|
|
} |
|
|
|
|
|
|
|