71 Commits

Author SHA1 Message Date
Levi McCallum
6f37bb40d9 Allow layouts to be accessible in context 2016-02-10 14:39:46 -08:00
Levi McCallum
499c3331ce Optimize insertion/deletion node calculation & expose inserted/deleted subnodes to transition context 2016-02-10 11:44:13 -08:00
Levi McCallum
e57761ffbe Fix pending layout reference causing nil references 2016-02-10 11:44:13 -08:00
Levi McCallum
8737e242f8 Extract measurement and transition into different methods based on feedback 2016-02-10 11:44:12 -08:00
Levi McCallum
8bfa3e4012 Remove ivar 2016-02-10 11:44:12 -08:00
Levi McCallum
5cf5cb8452 Delegate layout frame calculation to sublayout method 2016-02-10 11:44:12 -08:00
Levi McCallum
3b1a32c413 Clean up implicit hierarchy management to enable custom animation 2016-02-10 11:44:11 -08:00
Levi McCallum
9dc358196a Basic implementation of transitioning API for layout specs 2016-02-10 11:44:10 -08:00
Scott Goodson
9e87813425 Micro-optimizations in ASDisplayNode that help reduce overhead when recursing large hierarchies. 2016-02-05 21:43:14 -08:00
Huy Nguyen
fda9efafa6 Add timestamp to notifications of rendering engine and avoid race conditions in ASRangeControllerBeta
- Accurately remove notification observer
2016-02-04 15:44:44 -08:00
Huy Nguyen
69e674c1c8 Range controller registers to rendering engine and extern to full range if needed 2016-02-02 01:23:04 -08:00
Levi McCallum
d168ec78ce Implement simple, in-order add/remove subnode support when changing layout specs 2016-02-01 17:49:48 -08:00
Levi McCallum
9f25b54f9e Support insertion on first layout of display node 2016-02-01 17:49:48 -08:00
Levi McCallum
3abe6d9181 Simplify measure call structure 2016-02-01 17:49:47 -08:00
Garrett Moon
d7d36c0a6b Addressing Scott's comments 2016-01-27 21:08:04 -08:00
Garrett Moon
01c1680904 Switch to instance methods of draw and display
This patch switches to instance methods of draw and display for
ASTextNode and ASImageNode to attempt to increase their performance.

It also fixes some thread safety issues in ASImageNode which appear
to have been regressions (though probably not hit very often).

And it sets up work for allowing modification of CGContexts before
and after a node's contents are drawn.
2016-01-27 20:08:02 -08:00
Levi McCallum
ee23830318 Remove setNeedsDataFetch queuing, as interfaceState always performs fetch on re-enter 2016-01-27 18:25:39 -08:00
Levi McCallum
ec7a3599bd Add setNeedsDataFetch method to queue off screen fetchData calls 2016-01-27 14:52:37 -08:00
Matej Knopp
0a45bd9596 [_ASAsyncTransaction] implement operation priority
Signed-off-by: Matej Knopp <matej.knopp@gmail.com>
2016-01-26 15:31:40 +01:00
Scott Goodson
0feaa2a368 Improvements to the efficiency of recursivelySetInterfaceState: and the beta range controller. 2016-01-10 02:40:47 -08:00
Scott Goodson
984fe43997 [ASRangeController] Inspect delegate's ASInterfaceState to delay preloading beyond viewport until visible. 2016-01-03 19:14:07 -08:00
Scott Goodson
44feece701 Implement node-backing for ASTableView and ASCollectionView, with a strong back-pointer in these cases. 2015-12-26 23:05:34 -08:00
Scott Goodson
a2cf2a88e6 Overhaul header files / includes to eliminate circular references that Xcode 7 is angry about. 2015-12-25 19:22:00 -08:00
Scott Goodson
928c440b4c Several small optimizations, especially to _ASPendingState and other hot paths. 2015-12-23 16:38:33 -08:00
Scott Goodson
b8602d1073 Fix ASBasicImageDownloader tests - prevent use of init / new instead of +sharedImageDownloader. 2015-12-20 15:42:57 -08:00
Scott Goodson
97bb05d326 Order-of-magnitude speedup in handling of "disable visibility notifications"
Before, it was expensive to check this value, even though it was rarely set.
Now the cost is moved to setting the value, and is made very cheap to check with _hierarchyState.
2015-12-20 12:47:42 -08:00
Scott Goodson
872b3588d8 Complete merge of working window removal with ASHierarchyState changes in master. 2015-12-11 22:15:13 -08:00
Scott Goodson
840884272d Introduced ASHierarchyState. Created ASDisplayNode+FrameworkPrivate.h. Fixed deadlock. 2015-12-05 22:20:16 -08:00
Scott Goodson
254f55b758 Add locking for ASInterfaceState. Misc. cleanup. 2015-11-29 14:57:43 -08:00
Scott Goodson
936730d46b ASInterfaceStateVisible is now being driven by a new ASRangeHandlerVisible. 2015-11-29 13:24:42 -08:00
Scott Goodson
ff0e94b4e1 Introduce ASInterfaceState on ASDisplayNode.
Later, this will be added to ASViewController.  Right now it is not hooked up to drive anything.
It will become the codepath that drives calls like -fetchData and -clearContents.
2015-11-28 18:22:03 -08:00
Scott Goodson
2a0b9c8e14 Substantially improve behavior of nested Table & Collection Nodes
This ensures memory cleanup happens correctly and introduces a new test project
to support developing new features while stressing tough use cases for correctness.
2015-11-14 15:25:35 -08:00
Huy Nguyen
cd31f884dd Move ASDisplayNodePerformBlockOnMainThread to ASInternalHelpers 2015-10-29 16:09:36 +02:00
Huy Nguyen
5a2fea7c1d Use bounds and position to layout subnodes, instead of frame because it is not safe in case the transform property constains a non-identity transform. 2015-10-07 21:54:48 +03:00
Scott Goodson
a58844379c Implementation of Synchronous Concurrency features for AsyncDisplayKit 2.0
This provides internal features on _ASAsyncTransaction and ASDisplayNode to facilitate
implementing public API that allows clients to choose if they would prefer to block
on the completion of unfinished rendering, rather than allow a placeholder state to
become visible.

The internal features are:
-[_ASAsyncTransaction waitUntilComplete]
-[ASDisplayNode recursivelyEnsureDisplay]

Also provided are two such implementations:
-[ASCellNode setNeverShowPlaceholders:], which integrates with both Tables and Collections
-[ASViewController setNeverShowPlaceholders:], which should work with Nav and Tab controllers.

Lastly, on ASDisplayNode, a new property .shouldBypassEnsureDisplay allows individual node types
to exempt themselves from blocking the main thread on their display.

By implementing the feature at the ASCellNode level rather than ASTableView & ASCollectionView,
developers can retain fine-grained control on display characteristics.  For example, certain
cell types may be appropriate to display to the user with placeholders, whereas others may not.

Follow-up work will include unit tests, revisiting names, and the header locations of definitions.
2015-09-27 19:14:36 -07:00
rcancro
2f3562fa09 scott's comments 2015-09-15 09:11:19 -07:00
rcancro
01be5acece added a callback for initWithViewBlock/initWithLayerBlock 2015-09-14 20:36:08 -07:00
Ethan Nagel
8ea40a0265 Merge branch 'master' into ASDisplayNode-init-perf
Conflicts:
	AsyncDisplayKit/ASDisplayNode.mm
	AsyncDisplayKit/Private/ASDisplayNodeInternal.h
2015-09-09 22:17:49 -07:00
rcancro
5786bc1b5b Fixed infinite recursion in finalLayoutable, removed child properties from ASLayoutSpecs 2015-09-08 09:50:47 -07:00
rcancro
cbaf178950 Hide ASLayoutOptions from the user 2015-09-08 09:50:47 -07:00
Ethan Nagel
5dabd20b54 Merge branch 'master' into ASDisplayNode-init-perf
Conflicts:
	AsyncDisplayKit/ASDisplayNode.mm
2015-08-17 11:46:29 -07:00
Ethan Nagel
176e4962bf Perform one-time initializations in +initialize when possible 2015-08-14 14:41:13 -07:00
Huy Nguyen
1313c11519 preferredFrameSize should be used even if neither -layoutSpecThatFits: nor -calculateSizeThatFits: is overridden by subclassses. 2015-08-13 07:53:00 +03:00
appleguy
d401b0e5f6 Merge pull request #593 from shannonma/merge_fork
Fixes for ASTextNode test, setNeedsDisplay and font loading failures
2015-08-08 18:55:00 -07:00
Huy Nguyen
56768a837a - Support internal relayout, that is a relayout caused by internal layout changes, like subnodes re-arrangement and/or subnodes' size change. The constrained size applied to root node is unchanged.
- Update Kittens example to show how internal relayout is done.
2015-08-02 17:18:45 +03:00
Shannon Ma
15133fdbf7 setNeedsDisplay must be called on main 2015-07-31 12:11:19 -07:00
Huy Nguyen
e1fd58268c Clean up #468:
- -layoutSpecThatFits: must return an ASLayoutSpec.
- Move ASDisplayNode's -measureWithSizeRange: redeclaration to ASDisplayNode.h.
- Rename ASStackLayoutChild.h to ASStackLayoutDefines.h.
- Rename ASStaticLayoutSpecDimension.h to ASRelativeSize.h.
- Don't import ASLayout.h in other headers to prevent circular inclusions.
- Explain use cases of ASLayout's initializers.
- Clean up ASInternalHelpers.h.
2015-07-10 19:41:17 +07:00
Huy Nguyen
51f1ed819f - ASDisplayNode now caches calculated layout requested by layout specs.
- constrainedSizeForCalculatedLayout is of type ASSizeRange.
- calculatedLayout is better explained.
- Since ASLayout is cached and reused, its position property is mutable.
2015-07-06 22:08:01 +07:00
Huy Nguyen
dd29a890df Still support -calculateLayoutThatFits: (and manual layout), for backward compatibility. 2015-06-28 20:31:32 +07:00
Huy Nguyen
90a78684c9 Revert to using ASDisplayNodeSubclassOverridesSelector, to minimize changes and provide a bit of convenience within ASDisplayNode. 2015-06-25 11:34:36 +07:00