Commit Graph
575 Commits
Author SHA1 Message Date
Adlai Holler 03ea249dbd Replace ASDynamicCast and DynamicCastStrict macros with inline template functions 2019-03-05 10:37:30 -08:00
Xavier Deloge 2a9379248b _ASCollectionViewCell - The point isn't converted before to send to node, impossible to touch button into the node hierarchy (#1362)
* Revert node call, useless, the node has a ASDisplayView, and this view forward on the node in first.

* Use convertPoint to convert the given point in hittest & pointInside methods.
Keep the standard usage if the node didn't rasterized a view.

* Removed isNodeLoaded, finally it's useless in this case
In these methods, we are on the mainThread, we can create the view if the view is not created.
2019-03-05 09:00:38 -08:00
Adlai Holler 17dbd8e1e5 Optimize _assertSubnodeState (#1352)
* Optimize _assertSubnodeState

This method is actually pretty painful in today's world. In one iPad mini trace, the first page of nodes spent 6.6ms in this call, just in time profiler.

* Clean it up, check count

* Check the right value
2019-03-04 21:07:31 -08:00
Jonathan Downing 6dc0edf839 Make ASCollectionElement Public (#1303)
* Update AsyncDisplayKit.h

* Update project.pbxproj
2019-03-04 17:34:56 -08:00
Kevin babd81bd23 Add setNeedsLayout to yoga tree changes. (#1361) 2019-03-04 17:33:28 -08:00
Kevin 96e6a6c595 Resolve root constrained size before informing delegate to resolve infinite layout loop. (#1359) 2019-03-04 17:21:01 -08:00
Kevin 50e8dbfb9c Do not lock the nodeController if we are not locking to root. (#1360)
Doing so leaves it locked when we elsewhere explicitly unlock the node to ascend.
2019-03-04 17:20:47 -08:00
Garrett Moon 001765a85e If we check for batching before content size is available we'll always fetch (#1355) 2019-03-03 19:33:32 -06:00
Adlai Holler d14a3b03e9 Optimize ASTwoDimensionalArrayUtils (#1351)
* Optimize ASTwoDimensionalArrayUtils

These methods are called on the main thread during range controller updates (i.e. every frame) and so they should be as fast as possible.

* Rename

* Use vector instead of stack array to handle really big cases (e.g. photos)
2019-03-03 12:49:36 -06:00
Kevin 1410b29b63 Lock up to yogaRoot during layout to avoid deadlocks. (#1356)
* Lock up to yogaRoot during layout to avoid dead lock.

1) lock to root for tree
2) lock self to change parent (& consequently root)
3) Implement ASLocking (tryLock) on ASNodeController
4) add lockPair to try-lock node & controller together
5) lock controllers if they exist in lockToRoot...

Disable some asserts due to lock to root. :(

LL# No commands remaining.

* Add macro so non-Yoga still builds :)

* wut
2019-03-03 08:05:01 -08:00
Michael Schneider ddc4fd2ddb Don't compile out ASExperimentalTextNode if ASTextNode is compiled out (#1353) 2019-03-03 07:56:09 -08:00
Adlai Holler 6428077e01 Revert "Have node and controller share lock (#1227)" (#1347)
This reverts commit 2baa9438d7.
2019-02-22 11:28:36 -08:00
Garrett Moon 999cb6e485 Don't return non-animated GIFs for animation (update to latest PINRemoteImage beta) (#940)
* Don't return non-animated GIFs for animation

* Update to latest PINRemoteImage beta
2019-02-21 15:21:19 -08:00
Adlai Holler efeb3d2749 Add an experimental flag to use native dispatch_apply (#1345)
* Add an experimental flag to use native dispatch_apply instead of our core count * 2 approach. This has shown performance wins in some profiling.

* Add in other places
2019-02-21 12:33:39 -08:00
Michael Schneider 8edb5a45d3 Move ASSectionController and ASSupplementaryNodeSource method to be optional (#1302) 2019-02-20 11:21:47 -08:00
Leonid Lyadveykin 8908030eeb Add backgroundView for ASCellNode #trivial (#1333) 2019-02-15 12:52:48 -08:00
Michael Schneider 2a1e03fe75 Move ASCellLayoutModeSyncForSmallContent to the end of bitmask (#1341) 2019-02-15 12:52:07 -08:00
Adlai Holler 6e7cdea797 Add extension points for global node behaviors, potentially replacing interface state delegates (#1229)
* Add extension points for global node behaviors via categories and a public ivar

* Update documentation on context ivar
2019-02-14 14:17:03 -08:00
Kevin affa588654 Correct some dereferences in as_log_verbose invocations (#1317) 2019-02-14 09:22:38 -08:00
Max Wang 5f1dc2bc62 Fix a11y update when insert view (#1327)
* fix SIMULATE_WEB_RESPONSE not imported #449

* Fix to make rangeMode update in right time

* remove uncessary assert

* Fix collection cell editing bug for iOS 9 & 10

* Revert "Fix collection cell editing bug for iOS 9 & 10"

This reverts commit 06e18a1059.

* fix a11y update when insert view
2019-02-12 17:03:36 -08:00
Huy Nguyen e76272470d Fix duplicate definition of category "YogaDebugging" (#1331) 2019-02-01 14:57:18 -08:00
Michael Schneider d4efe95ec5 Improve separation of code for layout method types (#1305)
* Improve separation of code for layout method types

* Address PR comments

- Delegate to layout spec engine if the node is a layout spec node but yoga engine was asked for calculate the layout
- Change ASLayoutType to ASLayoutEngineType
- Improve layout engine fall through code
2019-01-28 07:41:49 -08:00
Huy Nguyen f1801388be Add experiments to skip waiting for updates of collection and table views under some circumstances (#1311)
* Add experiment to skip waiting until all updates of collection/table view are committed in -accessibilityElements

The wait was introduced in #1217 which blocks the main thread until updates are proccessed. We suspect this causes perf regressions accross the app and need to confirm this via an experiment.

* Add option to skip default behavior of ASCellLayoutMode

* Fix unit test

* Fix unit test in another way

* Remove import

* Minor change

* Add ASCellLayoutModeSyncForSmallContent

* Update unit tests

* Remove unnecessary change

* Remove unnecessary changes
2019-01-24 10:13:54 -08:00
Adlai Holler 2a4b77b6d5 Remove let and var macros now that we're all-C++ (#1312)
* Remove let and var macros now that we're all-C++

* Another fix

* More!

* And more!
2019-01-17 10:16:53 -08:00
Michael Schneider 7a782f8176 Fix deprecated implementations warning (#1306) 2019-01-16 18:28:37 -08:00
dmaclach d8cc3c9bdd Reduce startup time. (#1294)
Initializing the LUT arrays at file level scope creates a large chunk of code retaining and releasing all of the NSStrings in the tables. Moving them to function level moves the initialization to being lazy.
2019-01-16 18:25:19 -08:00
dmaclach 0a48cd7371 Reduce startup time. (#1293)
Move file level static into a function so that it isn't being initialized pre-main.
2019-01-16 18:23:08 -08:00
dmaclach e59eff8aa0 Reduce startup time. (#1292)
Move file scope constant that is initialized at startup to function scope to avoid startup hit.
2019-01-15 08:56:43 -08:00
appleguy 2d43f468d0 [ASCollectionView] Supplementary nodes should not enter ASHierarchyStateRangeManaged. (#1310)
As of today, ASRangeController doesn't manage the interfaceState for supplementary nodes. This bug was introduced with a refactoring of this code a couple months ago.

With this change, the supplementary nodes will automatically enter each interfaceState bit when they are added to a view hierarchy.
2019-01-11 08:11:55 +01:00
Michael Schneider 52b84bac01 Use cell mode while wrapping supplementary nodes (#1282) 2019-01-10 08:50:23 +01:00
Huy Nguyen 17e56042d3 Add a way to opt out of always-clear-data behavior in ASCollectionView and ASTableView (#1284) 2018-12-20 13:47:58 -08:00
Michael Schneider ab0a00c21c Copy yogaChildren in accessor method. Avoid using accessor method internally (#1283)
* Copy yogaChildren in accessor method. Avoid using accessor method internally.

* Further improvements
2018-12-20 17:45:52 +01:00
dmaclach 4982c84640 Reduce startup time. (#1291)
Get rid of file scope initialization that causes a premain startup hit.
2018-12-20 11:17:00 +01:00
dmaclach 7cddc2b1be Reduce startup time. (#1288)
Make global static a function local static. This stops it from being
initialized premain and affecting startup time.
2018-12-18 16:45:00 -08:00
Wu Zhong 351e402426 Remove UIKit header import in AsyncTransaction file (#1275) 2018-12-17 11:27:57 +01:00
Kevin ee9ecc4025 Access thread safe property to avoid assertion (#1281)
* Access thread safe property to avoid assertion after the ASDisplayNode's view or layer have been created.

* Oops add these headers
2018-12-15 13:18:46 -08:00
LiuJian c6fc05d9e6 Set automaticallyAdjustsContentOffset to ASTableView when view is load (#1278)
* Set automaticallyAdjustsContentOffset when view is load

* [ASTableNode] Update test: set automaticallyAdjustsContentOffset before view is load (#1278)
2018-12-11 19:32:43 -08:00
Kevin b69fe703fd Wrap supplementary node blocks to enable resizing them. (#1265)
* Wrap supplementary node blocks to enable resizing them.

Most ASCellNodeBlocks are wrapped by ASCollectionView.mm to add an `interactionDelegate` as well as calling `enterHierarchyState` on the node and setting its transform to a reflection if `inverted` is set on the collectionView.

This PR adds this behavior to supplementary nodes as well.

* Simplify code / block will never be nil
2018-12-10 14:33:04 -08:00
Kevin 5ae6547f5f Move assertions so they are valid. (#1261)
If PIN_ANIMATED is enabled, the creation of a PINRemoteImageManager
will create a sharedDownloader also. Thus we cannot assert that it
doesn't exist. We will move this assertion up to the methods that
create the preconfiguredSharedManager and before said manager is
allocated.
2018-12-10 14:32:16 -08:00
Max Wang 1d4b4c73cd Yoga debug info (#1253)
* fix SIMULATE_WEB_RESPONSE not imported #449

* Fix to make rangeMode update in right time

* remove uncessary assert

* Fix collection cell editing bug for iOS 9 & 10

* Revert "Fix collection cell editing bug for iOS 9 & 10"

This reverts commit 06e18a1059.

* Add description method for yoga.

* Fix comment
2018-12-10 14:29:43 -08:00
Michael Schneider 82b4d34e5b Introduce ASCellLayoutMode (#1273)
* Introduce ASCellLayoutMode

* Some smaller improvements

* Improve logic around _superPerformBatchUpdates:completion:

* Add comment about default values for ASCellLayoutModeNone

* Always call _superReloadData:completion: within UICollectionView

* Add initial range test for ASCellLayoutModeNone
2018-12-09 23:39:28 -08:00
Max Wang 4d9d3c26d9 Disable a11y cache (#1274)
* disable a11y cache

* style update
2018-12-09 08:41:18 -08:00
Adlai Holler bccdf83d2f Escalate directly to yoga root rather than walking up (#1269) 2018-12-07 13:12:57 -08:00
Michael Schneider 86a853ea09 Forward hitTest:withEvent and piontInside:withEvent: to node within _ASCollectionViewCell (#1268) 2018-12-06 07:57:54 -08:00
Michael Schneider 758afabde3 Fix isTruncated logic in ASTextNode2 (#1259)
* Fix isTruncated logic in ASTextNode2

* Add truncation tests
2018-12-04 13:40:24 -08:00
Rasul Tataev 635a370fff Documentation typo, "trying" written two times. #trivial (#1258)
Issue is at row 153 of ASVideoNode.h file
2018-11-30 07:35:36 -08:00
ricky 3daa5ac538 [ASPrimitiveTraitCollection] Fix ASPrimitiveTraitCollectionMakeDefault and implement containerSize (#1256)
With the changes to `ASPrimitiveTraitCollection` in https://github.com/TextureGroup/Texture/commit/e392f832f42897da41a7c0106709b55427efcea4 a new `ASPrimitiveTraitCollectionMakeDefault` was created. The new method didn’t give all values in an `ASPrimitiveTraitCollection` a default value (or initialize the struct with `{}`). This was causing fields like `userInterfaceIdiom`, `forceTouchCapability`, and `displayScale` to be filled with garbage, leading to `ASPrimitiveTraitCollectionIsEqualToASPrimitiveTraitCollection` to return `YES` when the trait collection hadn’t really changed.

It also looks like the getter `containerSize` was not implemented.
2018-11-28 08:56:08 -08:00
ernestmama 4d1ffcc2d0 Add more delegate methods for monitoring network image node progress (#1247) 2018-11-27 09:48:57 -08:00
Huy Nguyen a255953d34 Avoid using global Mutex variables (#1252)
After 5c9815f, some Mutexes are used as global C++ variables which are loaded before main(). Since the Mutex constructor checks for unfair lock experiment, it triggers an experiment configuration load, and our app isn't ready to respond that early in the process.
2018-11-26 17:25:38 -08:00
Michael Schneider f2bc63f05a Add way to compile out ASTextNode + TextKit dependencies (#1242)
* Add way to compile out ASTextNode + TextKit dependencies

* Compile out ASExperimentalTextNode and fix tests
2018-11-23 09:13:15 -08:00