Skip to content

Commit

Permalink
release: update for flutter 3.13.0 (#203)
Browse files Browse the repository at this point in the history
Signed-off-by: Hidenori Matsubayashi <[email protected]>
  • Loading branch information
HidenoriMatsubayashi authored Aug 17, 2023
1 parent a957327 commit 4d74745
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 26 deletions.
2 changes: 1 addition & 1 deletion bin/internal/engine.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cdbeda788a293fa29665dc3fa3d6e63bd221cb0d
1ac611c64eadbd93c5f5aba5494b8fc3b35ee952
2 changes: 1 addition & 1 deletion bin/internal/flutter.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f468f3366c26a5092eb964a230ce7892fda8f2f8
efbf63d9c66b9f6ec30e9ad4611189aa80003d31
2 changes: 1 addition & 1 deletion lib/commands/build.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,6 @@ class BuildPackageCommand extends BuildSubCommand

String _getCurrentHostPlatformArchName() {
final HostPlatform hostPlatform = getCurrentHostPlatform();
return getNameForHostPlatformArch(hostPlatform);
return hostPlatform.platformName;
}
}
2 changes: 1 addition & 1 deletion lib/commands/run.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ class ELinuxRunCommand extends RunCommand

String _getCurrentHostPlatformArchName() {
final HostPlatform hostPlatform = getCurrentHostPlatform();
return getNameForHostPlatformArch(hostPlatform);
return hostPlatform.platformName;
}
}
6 changes: 3 additions & 3 deletions lib/elinux_build_target.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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`
Expand Down
4 changes: 2 additions & 2 deletions lib/elinux_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -214,5 +214,5 @@ String _getTargetPlatformPlatformName(TargetPlatform targetPlatform) {

String _getCurrentHostPlatformArchName() {
final HostPlatform hostPlatform = getCurrentHostPlatform();
return getNameForHostPlatformArch(hostPlatform);
return hostPlatform.platformName;
}
2 changes: 1 addition & 1 deletion lib/elinux_device_discovery.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class ELinuxDeviceDiscovery extends PollingDeviceDiscovery {

String _getCurrentHostPlatformArchName() {
final HostPlatform hostPlatform = getCurrentHostPlatform();
return getNameForHostPlatformArch(hostPlatform);
return hostPlatform.platformName;
}

@override
Expand Down
4 changes: 2 additions & 2 deletions lib/elinux_package.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class BuildableELinuxApp extends ELinuxApp {
return globals.fs.path.join(
'build/elinux/',
targetArch,
getNameForBuildMode(buildMode),
buildMode.cliName,
'bundle',
binaryName,
);
Expand All @@ -109,7 +109,7 @@ class BuildableELinuxApp extends ELinuxApp {
return globals.fs.path.join(
'build/elinux/',
targetArch,
getNameForBuildMode(buildMode),
buildMode.cliName,
'bundle',
);
}
Expand Down
2 changes: 0 additions & 2 deletions lib/executable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -86,7 +85,6 @@ Future<void> main(List<String> args) async {
DevicesCommand(verboseHelp: verboseHelp),
DoctorCommand(verbose: verbose),
EmulatorsCommand(),
FormatCommand(),
GenerateLocalizationsCommand(
fileSystem: globals.fs,
logger: globals.logger,
Expand Down
68 changes: 57 additions & 11 deletions templates/app/runner/flutter_embedder_options.h
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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.
Expand Down Expand Up @@ -79,6 +88,9 @@ class FlutterEmbedderOptions {
}
}

text_scale_factor_ = options_.GetValue<double>("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<double>("force-scale-factor");
Expand All @@ -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;
Expand Down Expand Up @@ -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_;
Expand All @@ -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_
5 changes: 4 additions & 1 deletion templates/app/runner/main.cc
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 4d74745

Please sign in to comment.