Commit Graph

3364 Commits

Author SHA1 Message Date
Gareth Reese
4060f40d32 Added preview images for single file URLs. Unfortunately doesn't seem possible for HLS video. 2016-03-02 13:53:19 +00:00
Scott Goodson
783c2b03c7 [_ASAsyncTransaction] Reduce locking overhead by removing C++ stack-allocated MutexLocker objects.
Support assertion to log specific return value for pthread_mutex_destroy failures.
2016-03-01 22:06:46 -08:00
appleguy
f4925a107c Merge pull request #1302 from nguyenhuy/fix_collection_data_controller
[ASCollectionDataController] Remove unncessary batch layout calls for supplementary nodes.
2016-03-01 18:16:27 -08:00
appleguy
8f0777e7e5 Merge pull request #1305 from garrettmoon/fixRecursivelyEnsureDisplay
[ASDisplayNode] recursivelyEnsureDisplay should trigger display even if a stale contents exists (re-display)
2016-03-01 17:43:28 -08:00
Garrett Moon
2cee9bfca8 Just because we have contents, doesn't mean we don't want to display 2016-03-01 17:41:29 -08:00
appleguy
47d2981487 Merge pull request #1304 from garrettmoon/betterSkipClearContents
[ASDisplayNode] Coalesce -clearContents onto the next runloop, so it can be skipped if re-added to hierarchy in move operation.
2016-03-01 17:38:36 -08:00
appleguy
130e81fe88 Merge pull request #1303 from maicki/ImageDeallocationPerformanceImprovements
[ASNetworkImageNode] Dispatch deallocation of UIImage in clearFetchedData: to background thread
2016-03-01 17:12:37 -08:00
Michael Schneider
6e69c312d6 Dispatch deallocation of UIImage on background thread
Destruction of bigger images in ASNetworkImageNode on the main thread can be expensive and can take some time, so we dispatch onto a background queue to actually dealloc.
2016-03-01 17:04:38 -08:00
Garrett Moon
057c431dfb Thanks @scottg, this is a better more generalized solution. 2016-03-01 16:46:03 -08:00
Garrett Moon
eba6afc36b Revert "Don't clear contents when moving between nodes"
This reverts commit 6d1732fcbd.
2016-03-01 16:45:36 -08:00
Huy Nguyen
1dffc20e4d Address documentation of ASCellNodeVisibilityEvent 2016-03-01 15:56:08 -08:00
Huy Nguyen
5ecc9b16a9 Remove unncessary batch layout calls in ASCollectionDataController
- These calls cause supplementary nodes to be allocated and laid out, but not inserted afterward. So the nodes are thrown away.
- Next time when it is the right time to allocate these nodes, it is the second allocation request and triggers assertion in ASIndexedNodeContext #1296.
2016-03-01 15:42:53 -08:00
Luke Zhao
818c5bab9c only adjust constraint size if the datasource doesn't implement ConstrainedSizeForNode 2016-03-01 13:16:10 -08:00
appleguy
c3f7197bf3 Merge pull request #1300 from garrettmoon/skipClearContentsOnNodeMove
[ASDisplayNode] Don't clear contents when moving between parent nodes.
2016-03-01 12:03:32 -08:00
appleguy
99e3f45f46 Merge pull request #1297 from maicki/FixRangeModeCrash
[ASViewController] Fix crash accessing automaticallyAdjustRangeModeBasedOnViewEvents
2016-03-01 11:44:21 -08:00
appleguy
b6abb347e3 Merge pull request #1299 from rcancro/rendererBug
[ASTextNode] Fix bug with constrained size when rendering text the second time
2016-03-01 11:38:43 -08:00
Garrett Moon
6d1732fcbd Don't clear contents when moving between nodes 2016-03-01 09:57:07 -08:00
rcancro
d4bced1fb5 Fix bug when rendering text the second time
A text node's renderer is often invalidated. Save the renderer's constrained size locally so we can use it when creating a new renderer after invalidation.
2016-03-01 08:57:43 -08:00
Michael Schneider
def96ea726 Fix crash accessing automaticallyAdjustRangeModeBasedOnViewEvents property in ASViewController 2016-03-01 06:10:59 -08:00
Gareth Reese
6318db45c8 Updated the Videos sample app to cover the API changes 2016-03-01 13:06:29 +00:00
Gareth Reese
f9c8c043a1 First working version for HLS streams 2016-03-01 12:08:09 +00:00
Gareth Reese
75f615b223 Rearranged the method order to put the construction in one place and moved construction of the playerNode to -constructPlayerNode for DRY 2016-03-01 10:25:45 +00:00
appleguy
e9fcfefbdd Merge pull request #1294 from vivqu/batch_fetch
[ASCollectionView] Account for contentInset when calculating ASScrollDirection
2016-02-29 22:31:40 -08:00
Huy Nguyen
c64f23725f Update ASCellNode visibility API 2016-02-29 20:26:16 -08:00
appleguy
afed74f9e0 Merge pull request #1293 from maicki/UpdateInterfaceOnVisibilityChange
[ASInterfaceState] Ensure cell visibility is updated if overall Table or Collection becomes invisible.
2016-02-29 19:50:30 -08:00
Vivian Qu
31b576ebcd Address comment 2016-02-29 17:49:26 -08:00
Vivian Qu
d28c3c27c6 Account for contentInset when calculating ASScrollDirection 2016-02-29 17:10:39 -08:00
Michael Schneider
084e6f82c1 Trigger updating interfaceState for cells in case ASTableView or ASCollectionView becomes visible or invisible 2016-02-29 17:04:25 -08:00
appleguy
07ad27c7f6 Merge pull request #1291 from nguyenhuy/container_object
[ASDataController] Performance tuning for array enumeration, etc.
2016-02-29 14:24:17 -08:00
appleguy
f123ed87a1 Merge pull request #1282 from maicki/UpdateCurrentRangeModeAPI
[ASRangeController] API to update current range mode for the next range update
2016-02-29 14:20:44 -08:00
Huy Nguyen
6d463daac7 ASDataController improvements
- _populateFromDataSourceWithSectionIndexSet doesn't accept a mutanle array but allocate one itself.
- Remove _populateFromEntireDataSourceWithMutableContexts.
- ASIndexedNodeContext executes its block, nil out the block and return the result.
2016-02-29 14:03:40 -08:00
Michael Schneider
568aa6c2fb Update automatic range mode at the beginning of the update pass to consider new information in a possible next pass 2016-02-29 11:39:50 -08:00
Michael Schneider
b2eaf83264 Ignore call to updateCurrentRangeWithMode: to prevent trigger view creation before node was loaded 2016-02-29 11:39:50 -08:00
Michael Schneider
aca5b14c2b Move automatic range update to a private API 2016-02-29 11:39:50 -08:00
Michael Schneider
760f4ada91 Add API to ASViewController to automatically adjust the range mode of the containing node based on view events 2016-02-29 11:39:50 -08:00
Michael Schneider
60889f555e Add API to update the current range mode of a table or collection view range controller 2016-02-29 11:39:49 -08:00
Huy Nguyen
b098d80796 Performance improvements in ASDataController based on @Adlai-Holler comments in #1288 2016-02-29 11:36:48 -08:00
appleguy
ab920aa360 Merge pull request #1290 from nguyenhuy/container_object
Follow-up on #1288
2016-02-29 11:05:59 -08:00
Huy Nguyen
eadb6cbb0a Fix wrong memory attribute for indexPath attribute in ASIndexedNodeContext 2016-02-29 09:33:53 -08:00
appleguy
2a89c1d3d6 Merge pull request #1288 from nguyenhuy/container_object
[ASDataController] Introduce ASIndexedNodeContext for efficiency and simplicity in managing nodes, indexPaths, and their constraints.
2016-02-29 01:10:38 -08:00
Huy Nguyen
54cde1a3db Introduce ASIndexedNodeContext
- It is a container object that holds enough information to construct and measure a cell node
- All information is gathered on main thread. This allows ASDataController to capture the correct state of its data source before going to background.
2016-02-29 01:00:16 -08:00
Scott Goodson
5e35ef7938 [ASDisplayNode] Ensure display is triggered properly even before layers are onscreen (in display range). 2016-02-29 00:46:45 -08:00
appleguy
875ce9fc7b Merge pull request #1287 from facebook/ArrayCopyOptimization
[ASDisplayNode] Optimize -setNeedsDisplay, deep mutable array copies.
2016-02-28 22:17:51 -08:00
Scott Goodson
eac85b6c9a [ASDisplayNode] Optimize -setNeedsDisplay, deep mutable array copies.
These optimizations are surprisingly impactful.  -setNeedsDisplay being called
for every node triggered cancelAsyncDisplay, locking, and memory management overhead
that is completely avoidable because Core Animation triggers first display automatically.

The mutable array copy optimizations reduced this key cost by over 10x, from 52ms to 5ms
on an iPad Air 2 / A8X with a real-world test case.
2016-02-28 20:54:56 -08:00
appleguy
3671f5cbc5 Merge pull request #1283 from Adlai-Holler/AHPendingStateLocking
[ASPendingStateController] Relinquish Lock Before Applying Pending States
2016-02-26 23:53:08 -08:00
Adlai Holler
324b633b0f [ASPendingStateController] Don't hold lock while flushing 2016-02-26 23:14:58 -08:00
appleguy
fd3eca9091 Merge pull request #1281 from ejensen/VideoNodeAssetCast
[ASVideoNode] AVAsset type cast safety
2016-02-26 22:50:44 -08:00
appleguy
f2900cbee7 Merge pull request #1276 from maicki/improve-astextcellnode
[ASTextCellNode] Add several new APIs for customizability of this simple cell component.
2016-02-26 22:50:20 -08:00
Eric Jensen
cb1579e8af Check the AVAsset's type before casting to an AVURLAsset 2016-02-26 11:00:27 -08:00
Michael Schneider
45c616d916 Improve ASTextCellNode customization 2016-02-26 06:31:09 -08:00