mirror of https://github.com/BOINC/boinc.git
SCR: Mac: continue replacing deprecated Mac APIs
This commit is contained in:
parent
b05926822c
commit
bcaf986854
|
@ -48,6 +48,7 @@ void setGFXDefaultPeriod(double value);
|
|||
void setGFXSciencePeriod(double value);
|
||||
void setGGFXChangePeriod(double value);
|
||||
double getDTime();
|
||||
void doBoinc_Sleep(double seconds);
|
||||
void print_to_log_file(const char *format, ...);
|
||||
void strip_cr(char *buf);
|
||||
void PrintBacktrace(void);
|
||||
|
|
|
@ -57,4 +57,5 @@ void setGFXSciencePeriod(double value);
|
|||
void setGGFXChangePeriod(double value);
|
||||
bool validateNumericString(CFStringRef s);
|
||||
double getDTime();
|
||||
void doBoinc_Sleep(double seconds);
|
||||
extern void print_to_log_file(const char *format, ...);
|
||||
|
|
|
@ -244,7 +244,7 @@ int signof(float x) {
|
|||
NSPoint imagePosition;
|
||||
char *msg;
|
||||
CFStringRef cf_msg;
|
||||
AbsoluteTime timeToUnblock, frameStartTime = UpTime();
|
||||
double timeToBlock, frameStartTime = getDTime();
|
||||
kern_return_t kernResult = kIOReturnError;
|
||||
UInt64 params;
|
||||
IOByteCount rcnt = sizeof(UInt64);
|
||||
|
@ -490,8 +490,10 @@ int signof(float x) {
|
|||
[ self setAnimationTimeInterval:(1.0/newFrequency) ];
|
||||
// setAnimationTimeInterval does not seem to be working, so we
|
||||
// throttle the screensaver directly here.
|
||||
timeToUnblock = AddDurationToAbsolute(durationSecond/newFrequency, frameStartTime);
|
||||
MPDelayUntil(&timeToUnblock);
|
||||
timeToBlock = (1.0/newFrequency) - (getDTime() - frameStartTime);
|
||||
if (timeToBlock > 0.0) {
|
||||
doBoinc_Sleep(timeToBlock);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -222,6 +222,11 @@ double getDTime() {
|
|||
}
|
||||
|
||||
|
||||
void doBoinc_Sleep(double seconds) {
|
||||
boinc_sleep(seconds);
|
||||
}
|
||||
|
||||
|
||||
CScreensaver::CScreensaver() {
|
||||
struct ss_periods periods;
|
||||
|
||||
|
|
Loading…
Reference in New Issue