* Revert "Revert "Set SkPath::setIsVolatile based on whether the path survives at least two frames (#22620)" (#23044)"
This reverts commit 4f914253bd7cd2a5cca3fd97213df37494e9bf37.
* Fix tracing
Changes to make this work:
- Had to change the use of an UBool constant `FALSE` to 0 because
the file referring to it does not include the respective header.
- Had to change the license checker to ignore files in the directory
icu/source/samples. There were random changes to the licensing
headers which tripped up license checks. And since we don't include
samples in the binaries we build, the most efficient way to fix it is
to exclude sample code from license checks.
Issue: https://github.com/flutter/flutter/issues/70370
FontLanguageListCache.cpp uses the ICU constant FALSE of type UBool, but
does not #include <umachine.h> where it is defined.
This makes the code brittle with respect to header file reorganization,
and I found this while trying to roll ICU version 68.1 to Flutter
engine.
Snapshots compiled with sound null-safety enabled require changes to the way in
which isolates are launched. Specifically, the `Dart_IsolateFlags::null_safety`
field needs to be known upfront. The value of this field can only be determined
once the kernel snapshot is available. This poses a problem in the engine
because the engine used to launch the isolate at shell initialization and only
need the kernel mappings later at isolate launch (when transitioning the root
isolate to the `DartIsolate::Phase::Running` phase). This patch delays launch of
the isolate on the UI task runner till a kernel mapping is available. The side
effects of this delay (callers no longer having access to the non-running
isolate handle) have been addressed in this patch. The DartIsolate API has also
been amended to hide the method that could return a non-running isolate to the
caller. Instead, it has been replaced with a method that requires a valid
isolate configuration that returns a running root isolate. The isolate will be
launched by asking the isolate configuration for its null-safety
characteristics.
A side effect of enabling null-safety is that Dart APIs that work with legacy
types will now terminate the process if used with an isolate that has sound
null-safety enabled. These APIs may no longer be used in the engine. This
primarily affects the Dart Convertors in Tonic that convert certain C++ objects
into the Dart counterparts. All known Dart Converters have been updated to
convert C++ objects to non-nullable Dart types inferred using type traits of the
corresponding C++ object. The few spots in the engine that used the old Dart
APIs directly have been manually updated. To ensure that no usage of the legacy
APIs remain in the engine (as these would cause runtime process terminations),
the legacy APIs were prefixed with the `DART_LEGACY_API` macro and the macro
defined to `[[deprecated]]` in all engine translation units. While the engine
now primarily works with non-nullable Dart types, callers can still use
`Dart_TypeToNonNullableType` to acquire nullable types for use directly or with
Tonic. One use case that is not addressed with the Tonic Dart Convertors is the
creation of non-nullable lists of nullable types. This hasn’t come up so far in
the engine.
A minor related change is reworking tonic to define a single library target.
This allows the various tonic subsystems to depend on one another. Primarily,
this is used to make the Dart convertors use the logging utilities. This now
allows errors to be more descriptive as the presence of error handles is caught
(and logged) earlier.
Fixes https://github.com/flutter/flutter/issues/59879
The character offset passed to isGraphemeBreak is relative to the beginning
of the string (not relative to the text_start parameter). This caused bad
results when searching for grapheme breaks beyond the first line of text
(see https://github.com/flutter/flutter/issues/24802).
This PR fixes the offset value. It also reverts the workaround applied in
https://github.com/flutter/engine/pull/10063, which caused incorrect
calculation of boundaries between graphemes within ligatures.
This is similar to the workaround used for
https://github.com/flutter/flutter/issues/30347
The Minikin line breaker inserts greedy breaks based on a comparison of
postBreak width and currentLineWidth. currentLineWidth is provided by
the framework based on previous calls to Layout::measureText.
That calculation may not exactly match the calculation of postBreak.
This change ensures that breaks are only added if the difference
between postBreak and currentLineWidth is significant.
Fixes https://github.com/flutter/flutter/issues/65419
Cleans up header order/grouping for consistency: associated header, C/C++ system/standard library headers, library headers, platform-specific #includes.
Adds <cstring> where strlen, memcpy are being used: there are a bunch of places we use them transitively.
Applies linter-required cleanups. Disables linter on one file due to included RapidJson header. See https://github.com/flutter/flutter/issues/65676
This patch does not cover flutter/shell/platform/darwin. There's a separate, slightly more intensive cleanup for those in progress.
We currently use a mix of C standard includes (e.g. limits.h) and their
C++ variants (e.g. climits). This migrates to a consistent style for all
cases where the C++ variants are acceptable, but leaves the C
equivalents in place where they are required, such as in the embedder
API and other headers that may be used from C.
Add copyright headers in a few files where they were missing.
Trim trailing blank comment line where present, for consistency with
other engine code.
Use the standard libtxt copyright header in one file where it differed
(extra (C) and comma compared to other files in libtxt).
This also amends tools/const_finder/test/const_finder_test.dart to look
for a const an additional four lines down to account for the copyright
header added to the test fixture.
Before this change, when we encounter an unhandles exception,
we see:
```
[00050.147083][37665][67367][klog] ERROR: [ERROR:flutter/shell/common/shell.cc(209)] Dart Error: Unhandled exception:
[00050.147087][37665][67367][klog] INFO: UnimplementedError
```
This doesn't help identify the root cause. Adding stack trace will help
the cause.
Tweak the primary flutter build rule so that fuchsia is more similar to
other platforms in how tests and the shell are built.
Only embedder_unittests and GLFW tests are disabled on Fuchsia now.
TEST: Ran unittests on host/fuchsia; workstation on fuchsia
BUG: fxb/53847, fxb/54056
* Revert "Do not register UI-related native functions in secondary isolates (#6401)"
This reverts commit 69ae5694de54d2a163743dcec727fcea1c7bc8e1 as it doesn't work when root and secondary isolates run in the same isolate group.
* Confirm it is root isolate that makes UI native calls.
* Fix format, UIDartState reference from Fuchsia source
* No UI isolate check for fuchsia calls
* Fix typo. Remove redundant runtime calls
This patch optimizes C++11 range-based for loops where the variable is
copied in each iteration but it would suffice to obtain it by const
reference. This is only applied to loop variables of types that are
expensive to copy which means they are not trivially copyable or have a
non-trivial copy constructor or destructor.
To ensure that it is safe to replace the copy with a const reference
only the following cases are modified:
* The loop variable is const-qualified.
* The loop variable is not const, but only const methods or operators
are invoked on it, or it is used as const reference or value argument
in constructors or function calls.
This is an application of the internal performance-for-range-copy
clang-tidy analysis.
* "Reland Clang 11, roll buildroot to 1bc40a5f916adb93d87e2a2230a0ec43db876c1c, take 4 (#17467)" (#17482)"
This reverts commit 8166a91bca11b83c16fba8f8fd407e937a2ac89c.
* format code
* Roll buildroot to 3a27de1c5bb0f50be7d3efe3e00de4f6068c9f30
On Linux, there is rarely just one default font that can reasonably be expected to be on the platform. This PR changes the GetDefaultFontFamily call to be GetDefaultFontFamilies, and it now returns a vector<string> so that the font collection code can look up all of them, and if any of them exist, add them to the fallback list.
For Linux, I supplied the list "Ubuntu", "Cantarell", "DejaVu Sans", "Liberation Sans", and "Arial", which should cover a large proportion of linux machines. For the other platforms, I supplied a list of length one, containing the one fallback font that used to be defined. On Windows, I added "Segoe UI" as a default, since that is the default system font on newer Windows.
The goal of this function is to provide at least one font family that is installed, since otherwise linux (or any platform) will just have no font at all if the default font isn't found.
We believe this may be implicated in a Windows-specific crash during the
Flutter Gallery integration test.
See:
https://github.com/flutter/flutter/issues/51896
This reverts commit f9b78c5db2bc3087e1793947b11ca643c2d747cf.