Add configuration to support compiling engine with SUPPORT_FRACTIONAL_TRANSLATION (flutter/engine#33393)

This commit is contained in:
Jonah Williams 2022-05-16 13:04:05 -07:00 committed by GitHub
parent 2c25f5da2a
commit 858241db7c
4 changed files with 23 additions and 9 deletions

View File

@ -22,6 +22,9 @@ declare_args() {
# Whether to use a prebuilt Dart SDK instead of building one.
flutter_prebuilt_dart_sdk = false
# Whether layers can be drawn at half pixel boundaries.
support_fractional_translation = false
}
# feature_defines_list ---------------------------------------------------------
@ -56,6 +59,10 @@ if (flutter_runtime_mode == "debug") {
feature_defines_list += [ "FLUTTER_RUNTIME_MODE=0" ]
}
if (support_fractional_translation) {
feature_defines_list += [ "SUPPORT_FRACTIONAL_TRANSLATION=1" ]
}
if (is_ios || is_mac) {
flutter_cflags_objc = [
"-Werror=overriding-method-mismatch",

View File

@ -58,10 +58,7 @@ executable("testing_fractional_translation") {
]
}
defines = [
"SUPPORT_FRACTIONAL_TRANSLATION=1",
"DISABLE_SOFTWARE_RASTER_CACHE=1",
]
defines = []
deps = [
"//flutter/assets",

View File

@ -68,10 +68,10 @@ class TesterGPUSurfaceSoftware : public GPUSurfaceSoftware {
bool render_to_surface)
: GPUSurfaceSoftware(delegate, render_to_surface) {}
#if DISABLE_SOFTWARE_RASTER_CACHE
#if SUPPORT_FRACTIONAL_TRANSLATION
// |Surface|
bool EnableRasterCache() const override { return false; }
#endif // DISABLE_SOFTWARE_RASTER_CACHE
#endif // SUPPORT_FRACTIONAL_TRANSLATION
};
class TesterPlatformView : public PlatformView,

View File

@ -55,6 +55,9 @@ def get_out_dir(args):
if args.target_os == 'fuchsia' and args.fuchsia_cpu is not None:
target_dir.append(args.fuchsia_cpu)
if args.support_fractional_translation:
target_dir.append('fractional')
# This exists for backwards compatibility of tests that are being run
# on LUCI. This can be removed in coordination with a LUCI change:
# https://github.com/flutter/flutter/issues/76547
@ -312,10 +315,10 @@ def to_gn_args(args):
if runtime_mode == 'debug':
gn_args['dart_runtime_mode'] = 'develop'
elif runtime_mode == 'jit_release':
gn_args['dart_runtime_mode'] = 'release';
gn_args['dart_runtime_mode'] = 'release'
else:
gn_args['dart_runtime_mode'] = runtime_mode
# Desktop embeddings can have more dependencies than the engine library,
# which can be problematic in some build environments (e.g., building on
# Linux will bring in pkg-config dependencies at generation time). These
@ -330,6 +333,9 @@ def to_gn_args(args):
if args.allow_deprecated_api_calls:
gn_args['allow_deprecated_api_calls'] = args.allow_deprecated_api_calls
if args.support_fractional_translation:
gn_args['support_fractional_translation'] = args.support_fractional_translation
# DBC is not supported anymore.
if args.interpreter:
raise Exception('--interpreter is no longer needed on any supported platform.')
@ -440,7 +446,7 @@ def to_gn_args(args):
# dart_platform_sdk=True means exclude web-related files, e.g. dart2js,
# dartdevc, web SDK kernel and source files.
gn_args['dart_platform_sdk'] = not args.full_dart_sdk
if args.build_glfw_shell is not None:
gn_args['build_glfw_shell'] = args.build_glfw_shell
@ -613,6 +619,10 @@ def parse_args(args):
parser.add_argument('--fuchsia-target-api-level', dest='fuchsia_target_api_level')
parser.add_argument('--support-fractional-translation', dest='support_fractional_translation', default=False,
action='store_true', help='Whether to allow layers to render at fraction pixel '
'boundaries.')
# Flags for Dart features.
parser.add_argument('--use-mallinfo2', dest='use_mallinfo2', default=False, action='store_true',
help='Use mallinfo2 to collect malloc stats.')