Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/TextureGroup/Texture:
  Fix build errors and a crash in xcode 15 (TextureGroup#2093)
  [ASCellNodeVisibilityEvent] Add a new event when scrolling stops (TextureGroup#2084)
  Trying to get CI to work (TextureGroup#2085)
  fix typo: ASStackLayoutElement.h (TextureGroup#2067)
  Docs: Fix references of ASViewController/ASNavigationController (non-existent) to ASDKViewController/ASDKNavigationController (TextureGroup#2072)
  [ASTextKitRenderer] Adding locking when accessing the text renderer cache (TextureGroup#2075)
  Switch UITextWritingDirection to NSWritingDirection (TextureGroup#2071)
  • Loading branch information
andrey-golovin-ios committed Oct 5, 2023
2 parents 0a21143 + 923901a commit 4288b7c
Show file tree
Hide file tree
Showing 114 changed files with 483 additions and 199 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-master-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:
jobs:
cocoapods-lint:
env:
DEVELOPER_DIR: /Applications/Xcode_11.5.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
name: Verify that podspec lints
runs-on: macos-10.15
runs-on: macOS-latest
steps:
- name: Checkout the Git repository
uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-pull-requests-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
buildsh:
env:
DEVELOPER_DIR: /Applications/Xcode_11.5.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
strategy:
matrix:
mode: [cocoapods-lint-default-subspecs, cocoapods-lint-other-subspecs]
Expand All @@ -18,7 +18,7 @@ jobs:
- mode: cocoapods-lint-other-subspecs
name: Verify that other subspecs lint
name: ${{ matrix.name }}
runs-on: macos-10.15
runs-on: macOS-latest
steps:
- name: Checkout the Git repository
uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]
jobs:
buildsh:
env:
DEVELOPER_DIR: /Applications/Xcode_11.5.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
strategy:
matrix:
mode: [tests, framework, life-without-cocoapods, carthage, examples-pt1, examples-pt2, examples-pt3, examples-pt4]
Expand All @@ -27,7 +27,7 @@ jobs:
- mode: examples-pt4
name: Build examples (examples-pt4)
name: ${{ matrix.name }}
runs-on: macos-10.15
runs-on: macOS-latest
steps:
- name: Checkout the Git repository
uses: actions/checkout@v2
Expand Down
4 changes: 4 additions & 0 deletions AsyncDisplayKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@
9C49C3701B853961000B0DD5 /* ASStackLayoutElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C49C36E1B853957000B0DD5 /* ASStackLayoutElement.h */; settings = {ATTRIBUTES = (Public, ); }; };
9C55866B1BD54A1900B50E3A /* ASAsciiArtBoxCreator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9C5586681BD549CB00B50E3A /* ASAsciiArtBoxCreator.mm */; };
9C55866C1BD54A3000B50E3A /* ASAsciiArtBoxCreator.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C5586671BD549CB00B50E3A /* ASAsciiArtBoxCreator.h */; settings = {ATTRIBUTES = (Public, ); }; };
9C664E7D2A7048BE0059B2AB /* ASCellVisibilityScrollEventTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C664E7C2A7048BE0059B2AB /* ASCellVisibilityScrollEventTests.m */; };
9C6BB3B31B8CC9C200F13F52 /* ASAbsoluteLayoutElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C6BB3B01B8CC9C200F13F52 /* ASAbsoluteLayoutElement.h */; settings = {ATTRIBUTES = (Public, ); }; };
9C70F2051CDA4F06007D6C76 /* ASTraitCollection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9C70F2021CDA4EFA007D6C76 /* ASTraitCollection.mm */; };
9C70F2061CDA4F0C007D6C76 /* ASTraitCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 9C70F2011CDA4EFA007D6C76 /* ASTraitCollection.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -793,6 +794,7 @@
9C49C36E1B853957000B0DD5 /* ASStackLayoutElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASStackLayoutElement.h; sourceTree = "<group>"; };
9C5586671BD549CB00B50E3A /* ASAsciiArtBoxCreator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASAsciiArtBoxCreator.h; sourceTree = "<group>"; };
9C5586681BD549CB00B50E3A /* ASAsciiArtBoxCreator.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASAsciiArtBoxCreator.mm; sourceTree = "<group>"; };
9C664E7C2A7048BE0059B2AB /* ASCellVisibilityScrollEventTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASCellVisibilityScrollEventTests.m; sourceTree = "<group>"; };
9C6BB3B01B8CC9C200F13F52 /* ASAbsoluteLayoutElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASAbsoluteLayoutElement.h; sourceTree = "<group>"; };
9C70F2011CDA4EFA007D6C76 /* ASTraitCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASTraitCollection.h; sourceTree = "<group>"; };
9C70F2021CDA4EFA007D6C76 /* ASTraitCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASTraitCollection.mm; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1401,6 +1403,7 @@
CC583ABF1EF9BAB400134156 /* Common */,
058D09C6195D04C000B7D73C /* Supporting Files */,
052EE06A1A15A0D8002C6279 /* TestResources */,
9C664E7C2A7048BE0059B2AB /* ASCellVisibilityScrollEventTests.m */,
);
path = Tests;
sourceTree = "<group>";
Expand Down Expand Up @@ -2341,6 +2344,7 @@
058D0A39195D057000B7D73C /* ASDisplayNodeAppearanceTests.mm in Sources */,
CCB2F34D1D63CCC6004E6DE9 /* ASDisplayNodeSnapshotTests.mm in Sources */,
AE6987C11DD04E1000B9E458 /* ASPagerNodeTests.mm in Sources */,
9C664E7D2A7048BE0059B2AB /* ASCellVisibilityScrollEventTests.m in Sources */,
058D0A3A195D057000B7D73C /* ASDisplayNodeTests.mm in Sources */,
9644CFE02193777C00213478 /* ASThrashUtility.m in Sources */,
696FCB311D6E46050093471E /* ASBackgroundLayoutSpecSnapshotTests.mm in Sources */,
Expand Down
1 change: 1 addition & 0 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
source 'https://cdn.cocoapods.org/'
platform :ios, '9.0'

target :'AsyncDisplayKitTests' do
Expand Down
8 changes: 4 additions & 4 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- iOSSnapshotTestCase/Core (6.2.0)
- OCMock (3.6)
- OCMock (3.9.1)

DEPENDENCIES:
- iOSSnapshotTestCase/Core (~> 6.2)
Expand All @@ -13,8 +13,8 @@ SPEC REPOS:

SPEC CHECKSUMS:
iOSSnapshotTestCase: 9ab44cb5aa62b84d31847f40680112e15ec579a6
OCMock: 5ea90566be239f179ba766fd9fbae5885040b992
OCMock: 9491e4bec59e0b267d52a9184ff5605995e74be8

PODFILE CHECKSUM: 1b4ea0e8ab7d94a46b1964a2354686c2e599c8c2
PODFILE CHECKSUM: 0a3b63450c1b52ec105545b62c41089097e077d6

COCOAPODS: 1.10.0
COCOAPODS: 1.12.1
5 changes: 5 additions & 0 deletions Source/ASCellNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
* Indicates user has ended dragging the visible cell
*/
ASCellNodeVisibilityEventDidEndDragging,
/**
* Indicates a cell has stopped scrolling. May not be called if
* ASCellNodeVisibilityEventDidEndDragging did not decelerate
*/
ASCellNodeVisibilityEventDidStopScrolling,
};

/**
Expand Down
5 changes: 4 additions & 1 deletion Source/ASCollectionView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,10 @@ - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoi
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
_deceleratingVelocity = CGPointZero;

for (_ASCollectionViewCell *cell in _cellsForVisibilityUpdates) {
[cell cellNodeVisibilityEvent:ASCellNodeVisibilityEventDidStopScrolling inScrollView:scrollView];
}

if (_asyncDelegateFlags.scrollViewDidEndDecelerating) {
[_asyncDelegate scrollViewDidEndDecelerating:scrollView];
}
Expand Down
2 changes: 2 additions & 0 deletions Source/ASExperimentalFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ typedef NS_OPTIONS(NSUInteger, ASExperimentalFeatures) {
ASExperimentalDisableGlobalTextkitLock = 1 << 10, // exp_disable_global_textkit_lock
ASExperimentalMainThreadOnlyDataController = 1 << 11, // exp_main_thread_only_data_controller
ASExperimentalRangeUpdateOnChangesetUpdate = 1 << 12, // exp_range_update_on_changeset_update
ASExperimentalNoTextRendererCache = 1 << 13, // exp_no_text_renderer_cache
ASExperimentalLockTextRendererCache = 1 << 14, // exp_lock_text_renderer_cache
ASExperimentalFeatureAll = 0xFFFFFFFF
};

Expand Down
5 changes: 4 additions & 1 deletion Source/ASExperimentalFeatures.mm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
@"exp_optimize_data_controller_pipeline",
@"exp_disable_global_textkit_lock",
@"exp_main_thread_only_data_controller",
@"exp_range_update_on_changeset_update"]));
@"exp_range_update_on_changeset_update",
@"exp_no_text_renderer_cache",
@"exp_lock_text_renderer_cache"]));

if (flags == ASExperimentalFeatureAll) {
return allNames;
}
Expand Down
5 changes: 5 additions & 0 deletions Source/ASTableView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,11 @@ - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
}
_deceleratingVelocity = CGPointZero;

for (_ASTableViewCell *tableViewCell in _cellsForVisibilityUpdates) {
[[tableViewCell node] cellNodeVisibilityEvent:ASCellNodeVisibilityEventDidStopScrolling
inScrollView:scrollView
withCellFrame:tableViewCell.frame];
}
if (_asyncDelegateFlags.scrollViewDidEndDecelerating) {
[_asyncDelegate scrollViewDidEndDecelerating:scrollView];
}
Expand Down
19 changes: 18 additions & 1 deletion Source/ASTextNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ - (BOOL)isEqual:(ASTextNodeRendererKey *)object
we maintain a LRU renderer cache that is queried via a unique key based on text kit attributes and constrained size.
*/

static ASTextKitRenderer *rendererForAttributes(ASTextKitAttributes attributes, CGSize constrainedSize)
static ASTextKitRenderer *_rendererForAttributes(ASTextKitAttributes attributes, CGSize constrainedSize)
{
NSCache *cache = sharedRendererCache();

Expand All @@ -130,6 +130,23 @@ - (BOOL)isEqual:(ASTextNodeRendererKey *)object
return renderer;
}

static AS::RecursiveMutex __sharedRendererCacheInstanceLock__;

static ASTextKitRenderer *rendererForAttributes(ASTextKitAttributes attributes, CGSize constrainedSize)
{
BOOL neverCache = ASActivateExperimentalFeature(ASExperimentalNoTextRendererCache);
if (neverCache) {
return [[ASTextKitRenderer alloc] initWithTextKitAttributes:attributes constrainedSize:constrainedSize];
}

BOOL lockCache = ASActivateExperimentalFeature(ASExperimentalLockTextRendererCache);
if (lockCache) {
AS::MutexLocker l(__sharedRendererCacheInstanceLock__);
return _rendererForAttributes(attributes, constrainedSize);
}
return _rendererForAttributes(attributes, constrainedSize);
}

#pragma mark - ASTextNodeDrawParameter

@interface ASTextNodeDrawParameter : NSObject {
Expand Down
4 changes: 4 additions & 0 deletions Source/Details/ASGraphicsContext.mm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ NS_INLINE void ASConfigureExtendedRange(UIGraphicsImageRendererFormat *format)
}

UIImage *ASGraphicsCreateImage(ASPrimitiveTraitCollection traitCollection, CGSize size, BOOL opaque, CGFloat scale, UIImage * sourceImage, asdisplaynode_iscancelled_block_t NS_NOESCAPE isCancelled, void (NS_NOESCAPE ^work)()) {
if (size.width <= 0 || size.height <= 0) {
return nil;
}

if (AS_AVAILABLE_IOS_TVOS(10, 10)) {
if (ASActivateExperimentalFeature(ASExperimentalDrawingGlobal)) {
// If they used default scale, reuse one of two preferred formats.
Expand Down
2 changes: 1 addition & 1 deletion Source/Layout/ASStackLayoutElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN

/**
* @abstract If the sum of children's stack dimensions is greater than the maximum size, how much should this component shrink?
* This value represents the "flex shrink factor" and determines how much this component should shink in relation to
* This value represents the "flex shrink factor" and determines how much this component should shrink in relation to
* other flexible children.
*/
@property (nonatomic) CGFloat flexShrink;
Expand Down
2 changes: 1 addition & 1 deletion SubspecWorkspaces/ASDKListKit/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'https://github.com/CocoaPods/Specs.git'
source 'https://cdn.cocoapods.org/'

platform :ios, '9.0'
target 'ASDKListKitTests' do
Expand Down
Loading

0 comments on commit 4288b7c

Please sign in to comment.