Pause JS DisplayLink if nothing to process.

Reviewed By: @jspahrsummers

Differential Revision: D2489107
This commit is contained in:
Alexey Lang
2015-09-29 05:26:01 -07:00
committed by facebook-github-bot-4
parent 4c74f01b85
commit e727fc817b
5 changed files with 76 additions and 10 deletions

View File

@@ -71,6 +71,7 @@
@synthesize bridge = _bridge;
@synthesize paused = _paused;
@synthesize pauseCallback = _pauseCallback;
RCT_EXPORT_MODULE()
@@ -120,7 +121,7 @@ RCT_EXPORT_MODULE()
- (void)stopTimers
{
_paused = YES;
self.paused = YES;
}
- (void)startTimers
@@ -129,7 +130,17 @@ RCT_EXPORT_MODULE()
return;
}
_paused = NO;
self.paused = NO;
}
- (void)setPaused:(BOOL)paused
{
if (_paused != paused) {
_paused = paused;
if (_pauseCallback) {
_pauseCallback();
}
}
}
- (void)didUpdateFrame:(__unused RCTFrameUpdate *)update