Skip to content

Commit

Permalink
support suppressing automatic display link activation
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimon Tsinteris committed May 8, 2014
1 parent 462a48f commit 88a74e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 0 additions & 4 deletions pop.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,6 @@
GCC_PREFIX_HEADER = "$(PRODUCT_NAME)/$(PRODUCT_NAME)-Prefix.pch";
INFOPLIST_FILE = "POP/pop-Info.plist";
PRODUCT_NAME = pop;
PUBLIC_HEADERS_FOLDER_PATH = ../Headers/POP;
};
name = Debug;
};
Expand All @@ -1201,7 +1200,6 @@
GCC_PREFIX_HEADER = "$(PRODUCT_NAME)/$(PRODUCT_NAME)-Prefix.pch";
INFOPLIST_FILE = "POP/pop-Info.plist";
PRODUCT_NAME = pop;
PUBLIC_HEADERS_FOLDER_PATH = ../Headers/POP;
};
name = GCOV;
};
Expand All @@ -1216,7 +1214,6 @@
GCC_PREFIX_HEADER = "$(PRODUCT_NAME)/$(PRODUCT_NAME)-Prefix.pch";
INFOPLIST_FILE = "POP/pop-Info.plist";
PRODUCT_NAME = pop;
PUBLIC_HEADERS_FOLDER_PATH = ../Headers/POP;
};
name = Release;
};
Expand All @@ -1231,7 +1228,6 @@
GCC_PREFIX_HEADER = "$(PRODUCT_NAME)/$(PRODUCT_NAME)-Prefix.pch";
INFOPLIST_FILE = "POP/pop-Info.plist";
PRODUCT_NAME = pop;
PUBLIC_HEADERS_FOLDER_PATH = ../Headers/POP;
};
name = Profile;
};
Expand Down
3 changes: 2 additions & 1 deletion pop/POPAnimator.mm
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ @interface POPAnimator ()
CFTimeInterval _slowMotionLastTime;
CFTimeInterval _slowMotionAccumulator;
OSSpinLock _lock;
BOOL _disableDisplayLink;
}
@end

Expand All @@ -110,7 +111,7 @@ static CVReturn displayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
// call while holding lock
static void updateDisplayLink(POPAnimator *self)
{
BOOL paused = 0 == self->_observers.count && self->_list.empty();
BOOL paused = (0 == self->_observers.count && self->_list.empty()) || self->_disableDisplayLink;

#if TARGET_OS_IPHONE
if (paused != self->_displayLink.paused) {
Expand Down
5 changes: 5 additions & 0 deletions pop/POPAnimatorPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
+ (void)setDisableBackgroundThread:(BOOL)flag;
#endif

/**
Used for externally driven animator instances.
*/
@property (assign, nonatomic) BOOL disableDisplayLink;

/**
Exposed for unit testing.
*/
Expand Down

0 comments on commit 88a74e3

Please sign in to comment.