diff --git a/bin/internal/engine.version b/bin/internal/engine.version index faf32cd..beb9505 100644 --- a/bin/internal/engine.version +++ b/bin/internal/engine.version @@ -1 +1 @@ -cdbeda788a293fa29665dc3fa3d6e63bd221cb0d +1ac611c64eadbd93c5f5aba5494b8fc3b35ee952 diff --git a/bin/internal/flutter.version b/bin/internal/flutter.version index e90e6c9..8be5dee 100644 --- a/bin/internal/flutter.version +++ b/bin/internal/flutter.version @@ -1 +1 @@ -f468f3366c26a5092eb964a230ce7892fda8f2f8 \ No newline at end of file +efbf63d9c66b9f6ec30e9ad4611189aa80003d31 diff --git a/lib/commands/build.dart b/lib/commands/build.dart index 279685f..71e8b2e 100644 --- a/lib/commands/build.dart +++ b/lib/commands/build.dart @@ -149,6 +149,6 @@ class BuildPackageCommand extends BuildSubCommand String _getCurrentHostPlatformArchName() { final HostPlatform hostPlatform = getCurrentHostPlatform(); - return getNameForHostPlatformArch(hostPlatform); + return hostPlatform.platformName; } } diff --git a/lib/commands/run.dart b/lib/commands/run.dart index f98f8d3..2b4ec14 100644 --- a/lib/commands/run.dart +++ b/lib/commands/run.dart @@ -29,6 +29,6 @@ class ELinuxRunCommand extends RunCommand String _getCurrentHostPlatformArchName() { final HostPlatform hostPlatform = getCurrentHostPlatform(); - return getNameForHostPlatformArch(hostPlatform); + return hostPlatform.platformName; } } diff --git a/lib/elinux_build_target.dart b/lib/elinux_build_target.dart index 04b8cfb..67110b0 100644 --- a/lib/elinux_build_target.dart +++ b/lib/elinux_build_target.dart @@ -64,7 +64,7 @@ abstract class ELinuxAssetBundle extends Target { throw MissingDefineException(kBuildMode, name); } final BuildMode buildMode = - getBuildModeForName(environment.defines[kBuildMode]!); + BuildMode.fromCliName(environment.defines[kBuildMode]!); final Directory outputDirectory = environment.outputDir .childDirectory('flutter_assets') ..createSync(recursive: true); @@ -275,7 +275,7 @@ class NativeBundle { // libflutter_elinux_*.so in profile mode is under the debug mode's directory. final Directory embedderDir = _getEngineArtifactsDirectory( buildInfo!.targetArch, - buildMode.isRelease ? buildMode : BuildMode.fromName('debug')); + buildMode.isRelease ? buildMode : BuildMode.fromCliName('debug')); final File embedder = embedderDir.childFile(buildInfo!.targetBackendType == 'gbm' ? 'libflutter_elinux_gbm.so' @@ -433,7 +433,7 @@ class NativeBundle { String _getCurrentHostPlatformArchName() { final HostPlatform hostPlatform = getCurrentHostPlatform(); - return getNameForHostPlatformArch(hostPlatform); + return hostPlatform.platformName; } /// Converts [targetArch] to an arch name that corresponds to the `BUILD_ARCH` diff --git a/lib/elinux_builder.dart b/lib/elinux_builder.dart index 4f74969..e748b5d 100644 --- a/lib/elinux_builder.dart +++ b/lib/elinux_builder.dart @@ -76,7 +76,7 @@ class ELinuxBuilder { final Directory outputDir = project.directory.childDirectory('build').childDirectory('elinux'); final BuildInfo buildInfo = eLinuxBuildInfo.buildInfo; - final String buildModeName = getNameForBuildMode(buildInfo.mode); + final String buildModeName = buildInfo.mode.cliName; // Used by AotElfBase to generate an AOT snapshot. final String targetPlatformName = getNameForTargetPlatform( _getTargetPlatformForArch(eLinuxBuildInfo.targetArch)); @@ -214,5 +214,5 @@ String _getTargetPlatformPlatformName(TargetPlatform targetPlatform) { String _getCurrentHostPlatformArchName() { final HostPlatform hostPlatform = getCurrentHostPlatform(); - return getNameForHostPlatformArch(hostPlatform); + return hostPlatform.platformName; } diff --git a/lib/elinux_device_discovery.dart b/lib/elinux_device_discovery.dart index 53edc3c..270052d 100644 --- a/lib/elinux_device_discovery.dart +++ b/lib/elinux_device_discovery.dart @@ -187,7 +187,7 @@ class ELinuxDeviceDiscovery extends PollingDeviceDiscovery { String _getCurrentHostPlatformArchName() { final HostPlatform hostPlatform = getCurrentHostPlatform(); - return getNameForHostPlatformArch(hostPlatform); + return hostPlatform.platformName; } @override diff --git a/lib/elinux_package.dart b/lib/elinux_package.dart index 9a1baa2..829de0d 100644 --- a/lib/elinux_package.dart +++ b/lib/elinux_package.dart @@ -98,7 +98,7 @@ class BuildableELinuxApp extends ELinuxApp { return globals.fs.path.join( 'build/elinux/', targetArch, - getNameForBuildMode(buildMode), + buildMode.cliName, 'bundle', binaryName, ); @@ -109,7 +109,7 @@ class BuildableELinuxApp extends ELinuxApp { return globals.fs.path.join( 'build/elinux/', targetArch, - getNameForBuildMode(buildMode), + buildMode.cliName, 'bundle', ); } diff --git a/lib/executable.dart b/lib/executable.dart index d29dd47..5a05296 100644 --- a/lib/executable.dart +++ b/lib/executable.dart @@ -18,7 +18,6 @@ import 'package:flutter_tools/src/commands/config.dart'; import 'package:flutter_tools/src/commands/devices.dart'; import 'package:flutter_tools/src/commands/doctor.dart'; import 'package:flutter_tools/src/commands/emulators.dart'; -import 'package:flutter_tools/src/commands/format.dart'; import 'package:flutter_tools/src/commands/generate_localizations.dart'; import 'package:flutter_tools/src/commands/install.dart'; import 'package:flutter_tools/src/commands/logs.dart'; @@ -86,7 +85,6 @@ Future main(List args) async { DevicesCommand(verboseHelp: verboseHelp), DoctorCommand(verbose: verbose), EmulatorsCommand(), - FormatCommand(), GenerateLocalizationsCommand( fileSystem: globals.fs, logger: globals.logger, diff --git a/templates/app/runner/flutter_embedder_options.h b/templates/app/runner/flutter_embedder_options.h index bfb5b43..41d0bd1 100644 --- a/templates/app/runner/flutter_embedder_options.h +++ b/templates/app/runner/flutter_embedder_options.h @@ -1,4 +1,4 @@ -// Copyright 2023 Sony Corporation. All rights reserved. +// Copyright 2021 Sony Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -21,9 +21,18 @@ class FlutterEmbedderOptions { options_.AddInt("rotation", "r", "Window rotation(degree) [0(default)|90|180|270]", 0, false); + options_.AddDouble("text-scaling-factor", "x", "Text scaling factor", 1.0, + false); + options_.AddWithoutValue("enable-high-contrast", "i", + "Request that UI be rendered with darker colors.", + false); options_.AddDouble("force-scale-factor", "s", "Force a scale factor instead using default value", 1.0, false); + options_.AddWithoutValue( + "async-vblank", "v", + "Don't sync to compositor redraw/vblank (eglSwapInterval 0)", false); + #if defined(FLUTTER_TARGET_BACKEND_GBM) || \ defined(FLUTTER_TARGET_BACKEND_EGLSTREAM) // no more options. @@ -79,6 +88,9 @@ class FlutterEmbedderOptions { } } + text_scale_factor_ = options_.GetValue("text-scaling-factor"); + enable_high_contrast_ = options_.Exist("enable-high-contrast"); + if (options_.Exist("force-scale-factor")) { is_force_scale_factor_ = true; scale_factor_ = options_.GetValue("force-scale-factor"); @@ -87,6 +99,8 @@ class FlutterEmbedderOptions { scale_factor_ = 1.0; } + enable_vsync_ = !options_.Exist("async-vblank"); + #if defined(FLUTTER_TARGET_BACKEND_GBM) || \ defined(FLUTTER_TARGET_BACKEND_EGLSTREAM) use_onscreen_keyboard_ = false; @@ -118,22 +132,51 @@ class FlutterEmbedderOptions { return true; } - std::string BundlePath() const { return bundle_path_; } - std::string WindowTitle() const { return window_title_; } - std::string WindowAppID() const { return window_app_id_; } - bool IsUseMouseCursor() const { return use_mouse_cursor_; } - bool IsUseOnscreenKeyboard() const { return use_onscreen_keyboard_; } - bool IsUseWindowDecoraation() const { return use_window_decoration_; } + std::string BundlePath() const { + return bundle_path_; + } + std::string WindowTitle() const { + return window_title_; + } + std::string WindowAppID() const { + return window_app_id_; + } + bool IsUseMouseCursor() const { + return use_mouse_cursor_; + } + bool IsUseOnscreenKeyboard() const { + return use_onscreen_keyboard_; + } + bool IsUseWindowDecoraation() const { + return use_window_decoration_; + } flutter::FlutterViewController::ViewMode WindowViewMode() const { return window_view_mode_; } - int WindowWidth() const { return window_width_; } - int WindowHeight() const { return window_height_; } + int WindowWidth() const { + return window_width_; + } + int WindowHeight() const { + return window_height_; + } flutter::FlutterViewController::ViewRotation WindowRotation() const { return window_view_rotation_; } - bool IsForceScaleFactor() const { return is_force_scale_factor_; } - double ScaleFactor() const { return scale_factor_; } + double TextScaleFactor() const { + return text_scale_factor_; + } + bool EnableHighContrast() const { + return enable_high_contrast_; + } + bool IsForceScaleFactor() const { + return is_force_scale_factor_; + } + double ScaleFactor() const { + return scale_factor_; + } + bool EnableVsync() const { + return enable_vsync_; + } private: commandline::CommandOptions options_; @@ -152,6 +195,9 @@ class FlutterEmbedderOptions { flutter::FlutterViewController::ViewRotation::kRotation_0; bool is_force_scale_factor_; double scale_factor_; + double text_scale_factor_; + bool enable_high_contrast_; + bool enable_vsync_; }; #endif // FLUTTER_EMBEDDER_OPTIONS_ diff --git a/templates/app/runner/main.cc b/templates/app/runner/main.cc index ae4a067..579daee 100644 --- a/templates/app/runner/main.cc +++ b/templates/app/runner/main.cc @@ -1,4 +1,4 @@ -// Copyright 2023 Sony Corporation. All rights reserved. +// Copyright 2021 Sony Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -35,8 +35,11 @@ int main(int argc, char** argv) { view_properties.use_mouse_cursor = options.IsUseMouseCursor(); view_properties.use_onscreen_keyboard = options.IsUseOnscreenKeyboard(); view_properties.use_window_decoration = options.IsUseWindowDecoraation(); + view_properties.text_scale_factor = options.TextScaleFactor(); + view_properties.enable_high_contrast = options.EnableHighContrast(); view_properties.force_scale_factor = options.IsForceScaleFactor(); view_properties.scale_factor = options.ScaleFactor(); + view_properties.enable_vsync = options.EnableVsync(); // The Flutter instance hosted by this window. FlutterWindow window(view_properties, project);