From eed812dcdf1b046dd3bac01cdc9181ceeaa11261 Mon Sep 17 00:00:00 2001 From: Scott Goodson Date: Wed, 23 Mar 2016 23:36:10 -0700 Subject: [PATCH] [ASRangeController] Slight tweaks to the default Full ranges, for memory savings in multi-tabbed apps with still-excellent preloading consistency. --- .../Details/ASAbstractLayoutController.mm | 22 +++++++++---------- AsyncDisplayKit/Layout/ASStackLayoutDefines.h | 14 +++++++----- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/AsyncDisplayKit/Details/ASAbstractLayoutController.mm b/AsyncDisplayKit/Details/ASAbstractLayoutController.mm index 3ed6ccc5c2..b7426bd1c5 100644 --- a/AsyncDisplayKit/Details/ASAbstractLayoutController.mm +++ b/AsyncDisplayKit/Details/ASAbstractLayoutController.mm @@ -33,24 +33,24 @@ extern BOOL ASRangeTuningParametersEqualToRangeTuningParameters(ASRangeTuningPar _tuningParameters = std::vector> (ASLayoutRangeModeCount, std::vector (ASLayoutRangeTypeCount)); + _tuningParameters[ASLayoutRangeModeFull][ASLayoutRangeTypeDisplay] = { + .leadingBufferScreenfuls = 1.0, + .trailingBufferScreenfuls = 0.5 + }; + _tuningParameters[ASLayoutRangeModeFull][ASLayoutRangeTypeFetchData] = { + .leadingBufferScreenfuls = 2.5, + .trailingBufferScreenfuls = 1.5 + }; + _tuningParameters[ASLayoutRangeModeMinimum][ASLayoutRangeTypeDisplay] = { .leadingBufferScreenfuls = 0.25, .trailingBufferScreenfuls = 0.25 }; _tuningParameters[ASLayoutRangeModeMinimum][ASLayoutRangeTypeFetchData] = { - .leadingBufferScreenfuls = 1, - .trailingBufferScreenfuls = 1 + .leadingBufferScreenfuls = 0.25, + .trailingBufferScreenfuls = 0.5 }; - _tuningParameters[ASLayoutRangeModeFull][ASLayoutRangeTypeDisplay] = { - .leadingBufferScreenfuls = 1.5, - .trailingBufferScreenfuls = 0.75 - }; - _tuningParameters[ASLayoutRangeModeFull][ASLayoutRangeTypeFetchData] = { - .leadingBufferScreenfuls = 3, - .trailingBufferScreenfuls = 2 - }; - _tuningParameters[ASLayoutRangeModeVisibleOnly][ASLayoutRangeTypeDisplay] = { .leadingBufferScreenfuls = 0, .trailingBufferScreenfuls = 0 diff --git a/AsyncDisplayKit/Layout/ASStackLayoutDefines.h b/AsyncDisplayKit/Layout/ASStackLayoutDefines.h index 3fdbd252c1..48c0667a6b 100644 --- a/AsyncDisplayKit/Layout/ASStackLayoutDefines.h +++ b/AsyncDisplayKit/Layout/ASStackLayoutDefines.h @@ -96,12 +96,13 @@ typedef NS_ENUM(NSUInteger, ASHorizontalAlignment) { /** Right aligned */ ASHorizontalAlignmentRight, + // After 2.0 has landed, we'll add ASDISPLAYNODE_DEPRECATED here - for now, avoid triggering errors for projects with -Werror /** @deprecated Use ASHorizontalAlignmentLeft instead */ - ASAlignmentLeft ASDISPLAYNODE_DEPRECATED = ASHorizontalAlignmentLeft, + ASAlignmentLeft = ASHorizontalAlignmentLeft, /** @deprecated Use ASHorizontalAlignmentMiddle instead */ - ASAlignmentMiddle ASDISPLAYNODE_DEPRECATED = ASHorizontalAlignmentMiddle, + ASAlignmentMiddle = ASHorizontalAlignmentMiddle, /** @deprecated Use ASHorizontalAlignmentRight instead */ - ASAlignmentRight ASDISPLAYNODE_DEPRECATED = ASHorizontalAlignmentRight, + ASAlignmentRight = ASHorizontalAlignmentRight, }; /** Orientation of children along vertical axis */ @@ -115,10 +116,11 @@ typedef NS_ENUM(NSUInteger, ASVerticalAlignment) { /** Bottom aligned */ ASVerticalAlignmentBottom, + // After 2.0 has landed, we'll add ASDISPLAYNODE_DEPRECATED here - for now, avoid triggering errors for projects with -Werror /** @deprecated Use ASVerticalAlignmentTop instead */ - ASAlignmentTop ASDISPLAYNODE_DEPRECATED = ASVerticalAlignmentTop, + ASAlignmentTop = ASVerticalAlignmentTop, /** @deprecated Use ASVerticalAlignmentCenter instead */ - ASAlignmentCenter ASDISPLAYNODE_DEPRECATED = ASVerticalAlignmentCenter, + ASAlignmentCenter = ASVerticalAlignmentCenter, /** @deprecated Use ASVerticalAlignmentBottom instead */ - ASAlignmentBottom ASDISPLAYNODE_DEPRECATED = ASVerticalAlignmentBottom, + ASAlignmentBottom = ASVerticalAlignmentBottom, };