97 Commits

Author SHA1 Message Date
Adlai Holler
f542e8d458 [ASDisplayNode] If We Skipped Rendering Due to Zero-Area, Re-Render When We Get a Real Area (#2149)
* Add failing test case

* [_ASDisplayLayer] If we skipped render due to being zero-size, enqueue a render when we get a real size

* Remove pointless import
2016-08-26 15:51:49 -07:00
Garrett Moon
dfe4585cec Add ability to force the size which an image node is rendered. (#2107)
* Add ability to force the size which an image node is rendered.

* Add unit tests for forced scaling.

* Whoops, need results!

* Round forced scaling.

* Check size of contents too.

* Remove unnecessary container node.
2016-08-23 16:01:43 -07:00
Yue-Wang-Google
a38f3db6b0 set the right attributes for block properties. (#2113)
* set the right attributes for block properties.

* oops. should remove strong.

* Update ASImageNode.mm

* revert to use copy for blocks. See apple documentation below

https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithBlocks/WorkingwithBlocks.html#//apple_ref/doc/uid/TP40011210-CH8-SW12

* make the block properties nonatomic.
2016-08-21 13:06:21 -07:00
Hannah Troisi
893e601e81 Convert to type-generic math (#2050)
* [Optimization] Convert to type-generic math

* add std:: prefix in obj-c++ files

* more cleanup

* revert test changes

* convert min and max back to fmin/fmax
2016-08-09 15:31:37 -07:00
David Rodrigues
70574243f7 Prevent API misuse at compile time (#2035)
Using Objective-C attributes, in this case `unavailable`, we can hide
unsupported APIs at compile time instead of detecting and warn about it
at runtime with a set of asserts.
2016-08-04 19:00:46 -07:00
Chris Danford
c09db1cb17 ASImageNode backing store sharing for memory and CPU reduction (#1974) 2016-08-03 13:10:50 -07:00
appleguy
74bf376b2f [ASDisplayNode] Rename _propertyLock to __instanceLock__ to avoid subclass naming collisions. (#1941) 2016-07-16 15:32:13 -07:00
Hannah Troisi
f39c2ce7e3 [ASTextNode, ASImageNode, ASVideoNode] Use ASDisplayNode base class lock for subclass property synchronization (#1877)
* [ASTextNode, ASVideoNode] Use ASDisplayNode base class lock for subclass property synchronization

* fix headers to match master

* address @appleguy, @maicki comments

* import header

* Swap lock in ASNetworkImageNode as well

* remove invalid comment

* more cleanup of locks
2016-07-09 22:08:34 -07:00
appleguy
3b2af7eb6d [Build] Remove Unused Imports across all of AsyncDisplayKit. This uses a feature of AppCode. (#1875)
Details on the tool are here: https://www.jetbrains.com/help/idea/2016.1/optimizing-imports.html
2016-07-09 17:20:59 -07:00
Michael Schneider
e7e2672472 Move imageLock in braces for getting drawing parameters (#1876) 2016-07-09 17:02:05 -07:00
Scott Goodson
f0ff9c108d Merge branch 'master' of git://github.com/kielgillard/AsyncDisplayKit into kielgillard-master 2016-07-09 15:44:31 -07:00
Michael Schneider
b2810edb0f Move dealloc method from ASImageNode+AnimatedImage category to ASImageNode
Having a dealloc method in a category can be very problematic as the superclass dealloc method will not be called in case it exists.
2016-07-08 14:41:47 -07:00
Kiel Gillard
f7b7bcebeb * Make the "Life Without Cocoapods" sample build and run.
* Properly reference headers within implementation files to avoid import cycles and redeclaration warnings.
2016-07-06 16:58:13 +10:00
Michael Schneider
36e48cf340 Remove caching of _drawParameter and use bounds instead of threadSafeBounds 2016-06-21 13:11:38 -07:00
Michael Schneider
74b9b6b49e Use threadSafeBounds instead of bounds to create drawing parameters 2016-06-21 13:11:38 -07:00
Michael Schneider
fc7cff333e Prevent subclassing of ASTextNode and ASImageNode 2016-06-21 13:11:38 -07:00
Michael Schneider
3384297c58 Move drawing parameters in ASTextNode and ASImageNode to structs 2016-06-21 13:11:38 -07:00
Hannah Troisi
c857e809f4 Clean up header comments (for consistent Facebook licensing info) (#1741)
[Licensing] Clean up header comments (for consistent Facebook licensing info)
2016-06-11 23:31:39 -07:00
Eric Jensen
fdc57410ee Move the default animated image runloop mode to a constant, and fallback to the constant if the runloop mode is set to nil 2016-06-09 10:53:37 -07:00
Eric Jensen
370e5f1006 Allow configuration of ASImageNode's animation runloop 2016-06-08 10:38:43 -07:00
appleguy
86deec4033 Merge pull request #1665 from hannahmbanana/master
[AsyncDisplayKit+Debug.h] Move hitTestDebug code out of ASControlNode and into debug file
2016-06-01 11:15:44 +07:00
Michael Schneider
73ce8c148a Add comment for setting the backgroundColor in ASImageNode 2016-05-26 10:01:12 -07:00
Michael Schneider
e3e9d36f56 Fix image sometimes appearing with black background or completely disappearing in ASImageNode 2016-05-25 10:07:34 -07:00
Hannah Troisi
37d4c5e475 Fixing a bug in both debug tools (image scaling, tappable area) in which I don't check that the overlay exists before creating it. 2016-05-15 23:28:39 -07:00
Aaron Schubert
b586b9f34b Fix merge conflicts 2016-04-21 09:26:40 +01:00
Aaron Schubert
e2fa2f8192 [tvOS] Address comments on previous PR. 2016-04-21 09:23:47 +01:00
Aaron Schubert
06d4573b14 [tvOS] Branch out tvOS specific code into it's own categories 2016-04-21 08:59:14 +01:00
appleguy
dd4853bf3a Merge pull request #1273 from aaronschubert0/tvOS
[tvOS] Add default focus states to ASControlNode & ASImageNode.
2016-04-20 13:29:31 -07:00
Garrett Moon
0fc39d1ccd Follow up to animated GIF PR 2016-04-19 13:43:41 -07:00
Aaron Schubert
21abe8f899 Fix merge conflicts 2016-04-19 09:02:07 +01:00
appleguy
30a0c471ca Merge pull request #1528 from ejensen/instancetype
[Refactoring] Replace id with instancetype in initializers
2016-04-16 20:53:41 -07:00
Garrett Moon
1b316217ef Downstream ASAnimatedImage 2016-04-13 14:23:02 -07:00
Garrett Moon
beba9031ef Expose public properties properly
Reviewers: rmalik

Reviewed By: rmalik

Differential Revision: https://phabricator.pinadmin.com/D82227
2016-04-13 14:23:02 -07:00
Garrett Moon
3bcbfb149d Add support for animated GIFs
Summary:
Use NSData as key

Add chunking of files

Add support for Animated Images

This adds support for GIF playback in ASDK. It's not currently ready
for merging to public ASDK – for one the GIF decompression may make
more sense in PINRemoteImage.

Removed duration as it wasn't used

Make cover image lazily loaded

Differential Revision: https://phabricator.pinadmin.com/D82033
2016-04-13 14:23:02 -07:00
Eric Jensen
527397ba7e Replace id with instancetype in initializers 2016-04-13 11:20:05 -07:00
Scott Goodson
cd493358cc [ASControlNode] Upgrades to +setEnableHitTestDebug: to intersect hitTestSlop with parents' bounds+slop, to accurately predict and visualize UIKit event delivery edge cases. 2016-03-27 22:02:13 -07:00
Scott Goodson
c5c7abb1d6 [ASDisplayNode] Placeholders should always be recreated if returning to past nodes.
If previously-displayed contents is gone (e.g. clearContents), and is not finished displaying
by the time the node is onscreen, recreate the placeholder immediately.
2016-03-18 21:13:26 -07:00
Eric Jensen
33fda7ab49 - Use modern Objective-C syntax.
-  Simplify comparisons.
-  Remove dead stores.
2016-03-15 22:34:29 -07:00
Scott Goodson
21bebb9d29 [ASRangeController] Improvements to application state change and memory warning handling.
Introduces ASLayoutRangeModeVisibleOnly, allowing the preservation of decoded backing stores without any extra padding to
strictly minimize memory usage while supporting immediate re-display of content.  Set visible range controllers to this mode
upon app suspend / memory warning, while more aggressively clearing others to the ASLayoutRangeModeLowMemory mode.

By default, when the app is running and recieves a memory warning, we set the range mode for non-visible controllers to
ASLayoutRangeModeVisibleOnly.  This is because, unlike in the app suspend case where on app resume we can restore controllers
from LowMemory to VisibleOnly, the memory warning doesn't provide a good opportunity to do this.

A new +Beta API to control this behavior is called +setRangeModeForMemoryWarnings:, as some apps may prefer to use LowMemory
in the memory warning scenario.  For these apps, optimal user experience will require manually setting the range mode back
to some larger value as the user navigates the app, or they will encounter controllers that are temporarily blank and need
a moment to re-display their contents as they start to become visible.
2016-03-09 21:22:45 -08:00
Hannah Troisi
51eccb3d96 [ASImageNode] More refined naming and documentation for [ASImageNode shouldShowImageScalingOverlay] 2016-03-08 23:30:17 -08:00
Hannah Troisi
d64c05a68e [ASImageNode] A ASImageNode debug feature showing pixel scaling amount
- shows a red text label overlay on bottom right hand corner of ASImageNodes with pixel scaling factor
- import AsyncDisplayKit+Debug.h and enable using [ASImageNode setEnableImageDebugOverlay]
2016-03-08 23:13:32 -08:00
Aaron Schubert
f9bf402047 [tvOS] Clean up and document parts of code. 2016-02-25 09:06:11 +00:00
Aaron Schubert
3d6f6766e9 [tvOS] Implement a default behaviour of ASImageNode, trying to match the behaviour of UIImageView. Still need to add shine. 2016-02-24 13:58:11 +00:00
appleguy
3abde9348d Merge pull request #1256 from Adlai-Holler/AHAffinityRevisions
[ASDisplayNode] Post-Review Refinements of Recent No-Affinity UIKit/CA Property Bridging
2016-02-22 20:41:59 -08:00
Adlai Holler
fd5723379f [ASImageNode] Lock & unlock directly instead of using stack objects. 2016-02-22 18:48:31 -08:00
Adlai Holler
57ca0c73bf [ASImageNode] Correctly unlock _imageLock 2016-02-22 09:12:58 -08:00
Adlai Holler
03d2b57991 [ASImageNode] Unlock immediately after updating _image 2016-02-22 09:04:23 -08:00
Adlai Holler
2a94d88b4b [ASImageNode] Remove thread affinity dispatches 2016-02-20 15:43:00 -08:00
Garrett Moon
8f07197573 Don't need this :) 2016-02-16 19:05:17 -08:00
Garrett Moon
1b08114eca Allow prevention of downscaling 2016-02-02 19:10:12 -08:00