From c6bcc99a89d9c3635e2ebca3ff16601d6b45e1b0 Mon Sep 17 00:00:00 2001 From: pcsosinski Date: Fri, 13 Nov 2020 10:40:40 -0800 Subject: [PATCH 1/4] Update 1.24 engine to use Dart 2.12.0-29.7.beta --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index ca175679b247c..4186ea04810a5 100644 --- a/DEPS +++ b/DEPS @@ -34,7 +34,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '26219fa05863420b5811ef509663ee13bc7432eb', + 'dart_revision': '6fee8e27b8206acd82cd7ed6204941916a2568e5', # WARNING: DO NOT EDIT MANUALLY # The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py From dfbceb5d41c745c74e39711aa40883492e4a903f Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Thu, 12 Nov 2020 10:37:14 -0800 Subject: [PATCH 2/4] Default to 2.7 when generating the package config (#22469) For https://github.com/flutter/flutter/issues/70349 --- tools/generate_package_config/bin/generate_from_legacy.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/generate_package_config/bin/generate_from_legacy.dart b/tools/generate_package_config/bin/generate_from_legacy.dart index f1a7d6e235875..ae71032224dd9 100644 --- a/tools/generate_package_config/bin/generate_from_legacy.dart +++ b/tools/generate_package_config/bin/generate_from_legacy.dart @@ -46,10 +46,10 @@ void main(List args) async { if (!File.fromUri(pubspec).existsSync()) { continue; } - // Default to 2.8 if not found to prevent all packages from accidentally + // Default to 2.7 if not found to prevent all packages from accidentally // opting into NNBD. languageVersion = await languageVersionFromPubspec(pubspec, name) ?? - LanguageVersion(2, 8); + LanguageVersion(2, 7); packages.add(Package(name, packageRoot, languageVersion: languageVersion, packageUriRoot: uri)); } From ec37b5f90ff34a2adcd18f157db89639d4eafd6f Mon Sep 17 00:00:00 2001 From: Matej Knopp Date: Thu, 12 Nov 2020 20:50:31 +0100 Subject: [PATCH 3/4] Disable synchronous resizing until a frame is produced (#22457) Instead of synchronousResizing flag which in some cases seems to be set too early, synchronous resizing is postponed until framework produces a frame so ResizeSynchronizer knows for sure that the engine is up and running. --- .../macos/framework/Source/FlutterEngine.mm | 4 ---- .../Source/FlutterResizeSynchronizer.mm | 17 +++++++++++++++++ .../darwin/macos/framework/Source/FlutterView.h | 7 ------- .../macos/framework/Source/FlutterView.mm | 14 +++++--------- 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/shell/platform/darwin/macos/framework/Source/FlutterEngine.mm b/shell/platform/darwin/macos/framework/Source/FlutterEngine.mm index ed1874c529a93..d9ebd55f0d7ec 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterEngine.mm +++ b/shell/platform/darwin/macos/framework/Source/FlutterEngine.mm @@ -322,7 +322,6 @@ - (BOOL)runWithEntrypoint:(NSString*)entrypoint { [self sendUserLocales]; [self updateWindowMetrics]; [self updateDisplayConfig]; - self.viewController.flutterView.synchronousResizing = YES; return YES; } @@ -359,9 +358,6 @@ - (void)setViewController:(FlutterViewController*)controller { [self shutDownEngine]; _resourceContext = nil; } - if (_engine) { - self.viewController.flutterView.synchronousResizing = YES; - } } - (id)binaryMessenger { diff --git a/shell/platform/darwin/macos/framework/Source/FlutterResizeSynchronizer.mm b/shell/platform/darwin/macos/framework/Source/FlutterResizeSynchronizer.mm index 8f2eaac98cc40..84d560f4ea11e 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterResizeSynchronizer.mm +++ b/shell/platform/darwin/macos/framework/Source/FlutterResizeSynchronizer.mm @@ -17,6 +17,10 @@ @interface FlutterResizeSynchronizer () { // Used to block [requestCommit]. std::condition_variable _condBlockRequestCommit; + // Whether a frame was received; We don't block platform thread during resize + // until we know that framework is running and producing frames + BOOL _receivedFirstFrame; + // If NO, requestCommit calls are ignored until shouldEnsureSurfaceForSize is called with // proper size. BOOL _acceptingCommit; @@ -50,6 +54,12 @@ - (void)beginResize:(CGSize)size notify:(dispatch_block_t)notify { return; } + if (!_receivedFirstFrame) { + // No blocking until framework produces at least one frame + notify(); + return; + } + ++_cookie; // from now on, ignore all incoming commits until the block below gets @@ -79,6 +89,11 @@ - (void)beginResize:(CGSize)size notify:(dispatch_block_t)notify { - (BOOL)shouldEnsureSurfaceForSize:(CGSize)size { std::unique_lock lock(_mutex); + + if (!_receivedFirstFrame) { + return YES; + } + if (!_acceptingCommit) { if (CGSizeEqualToSize(_newSize, size)) { _acceptingCommit = YES; @@ -93,6 +108,8 @@ - (void)requestCommit { return; } + _receivedFirstFrame = YES; + _pendingCommit = YES; if (_waiting) { // BeginResize is in progress, interrupt it and schedule commit call _condBlockRequestCommit.notify_all(); diff --git a/shell/platform/darwin/macos/framework/Source/FlutterView.h b/shell/platform/darwin/macos/framework/Source/FlutterView.h index 4d5cd3780f10e..cd96f58a2291c 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterView.h +++ b/shell/platform/darwin/macos/framework/Source/FlutterView.h @@ -25,13 +25,6 @@ */ @property(readwrite, nonatomic, nonnull) NSOpenGLContext* openGLContext; -/** - * Controls whether view resizing synchronously updates contents. This can only be enabled - * after the engine is running and producing frames, because during synchronous view resizing the - * platform thread is blocked until engine produces frame with requested size. - */ -@property(readwrite, nonatomic) BOOL synchronousResizing; - - (nullable instancetype)initWithFrame:(NSRect)frame shareContext:(nonnull NSOpenGLContext*)shareContext reshapeListener:(nonnull id)reshapeListener diff --git a/shell/platform/darwin/macos/framework/Source/FlutterView.mm b/shell/platform/darwin/macos/framework/Source/FlutterView.mm index 4dcfcf0bd13b3..d6ce889f54e81 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterView.mm +++ b/shell/platform/darwin/macos/framework/Source/FlutterView.mm @@ -71,15 +71,11 @@ - (void)present { } - (void)reshaped { - if (self.synchronousResizing) { - CGSize scaledSize = [self convertSizeToBacking:self.bounds.size]; - [_resizeSynchronizer beginResize:scaledSize - notify:^{ - [_reshapeListener viewDidReshape:self]; - }]; - } else { - [_reshapeListener viewDidReshape:self]; - } + CGSize scaledSize = [self convertSizeToBacking:self.bounds.size]; + [_resizeSynchronizer beginResize:scaledSize + notify:^{ + [_reshapeListener viewDidReshape:self]; + }]; } #pragma mark - NSView overrides From 8c9ef5e007b2d476b2201a0ebe3369bf6c923766 Mon Sep 17 00:00:00 2001 From: pcsosinski Date: Fri, 13 Nov 2020 11:07:00 -0800 Subject: [PATCH 4/4] update license file for Dart 2.12.0-29.7.beta --- ci/licenses_golden/licenses_third_party | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/licenses_golden/licenses_third_party b/ci/licenses_golden/licenses_third_party index 6c104dfa7b3ba..91d49adeb9253 100644 --- a/ci/licenses_golden/licenses_third_party +++ b/ci/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: d9eae89a1e78eeab48c3f2091544cca5 +Signature: 502f3595bc06228a8fd17d9129312d68 UNUSED LICENSES: