316 Commits

Author SHA1 Message Date
Chris Bracken
2586db3b22 Clean up C++ includes (flutter/engine#21127)
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.
2020-09-11 21:18:35 -07:00
Chris Bracken
d03692449b Prefer C++ standard headers to their C counterpart (flutter/engine#21091)
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.
2020-09-11 17:10:00 -07:00
Chris Bracken
9ff7d7ca44 Copyright header hygiene improvements (flutter/engine#21089)
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.
2020-09-11 08:55:37 -07:00
Alexander Aprelev
84121702c9 Log exception in addition to the stack trace for unhandled exceptions. (flutter/engine#20935)
* Log exception in addition to the stack trace for unhandled exceptions.

Having exception logged can be especially useful when stack trace is blank.
2020-09-02 09:47:09 -07:00
xster
4774c05cb1 Fix font sorting problem due to iOS 14 fonts being broader (flutter/engine#20557) 2020-08-24 13:03:20 -07:00
LongCatIsLooong
fcfd260ae9 Reland "account for inline placeholders in longest line calculation (#20370)" reverted in (#20669) (flutter/engine#20678) 2020-08-21 16:31:02 -07:00
Zachary Anderson
e9fcab4436 Revert "account for inline placeholders in longest line calculation (#20370)" (flutter/engine#20669)
This reverts commit fd97c2487f24ef5f82fe240b6bb19f9a48939922.

Landing on red to fix the build.
2020-08-20 12:35:48 -07:00
LongCatIsLooong
fd97c2487f account for inline placeholders in longest line calculation (flutter/engine#20370) 2020-08-11 16:23:26 -07:00
Daco Harkes
8e7d90d2c4 Migrate some Dart_WeakPersistentHandle uses to Dart_FinalizableHandle (flutter/engine#20107) 2020-07-30 15:56:00 +02:00
Siva
03706dce89 Manual roll of Dart from 24c7666def...40fd1c456e (flutter/engine#20092)
* Manual roll of Dart from 24c7666def...40fd1c456e

dart-lang/sdk@40fd1c456e Revert "[dart:io] Add Abort() on HttpClientRequest"
dart-lang/sdk@17d7296a42 [vm/nnbd/bytecode] Fix reuse of type arguments in bytecode
dart-lang/sdk@58b6f40c73 Issue 42797. Understand in legacy libraries that a function returning Never (in Null Safety library) never returns. (reland)
dart-lang/sdk@fc8a6d9f9b [VM/compiler] Dereference TypeRef literal when propagating constants.
dart-lang/sdk@0689ec527a Move "test.dart" (well, most of its contents) into pkg/test_runner.
dart-lang/sdk@1094b3c61d Prepare static error test updater tool to handle web tests.
dart-lang/sdk@b258585f2f [observatory] Migrate from deprecated isInstanceOf to isA.
dart-lang/sdk@dfe1d9b682 Disable OverrideContributor for Cider.
dart-lang/sdk@aea99b2f5c scope debug property assist to Diagnosticables
dart-lang/sdk@4b96f20a79 [dart:io] Add Abort() on HttpClientRequest
dart-lang/sdk@1b1a39708c [build] Use frameworks instead of libs
dart-lang/sdk@3fef522496 Revert "Reland "[vm] Replaces fuchsia.deprecatedtimezone""
dart-lang/sdk@8c664d4f3f Revert "Issue 42797. Understand in legacy libraries that a function returning Never (in Null Safety library) never returns."
dart-lang/sdk@2efb5bebc7 [ dart:_http ] Fix typo in HTTP response timeline event
dart-lang/sdk@0884dae36c Revert "Fix the #include path for ICU headers"
dart-lang/sdk@5171534e81 Scope tweaks. Report REFERENCED_BEFORE_DECLARATION in more places.
dart-lang/sdk@6bba75079a Issue 42797. Understand in legacy libraries that a function returning Never (in Null Safety library) never returns.
dart-lang/sdk@b4ebbb7f5c [build] Update gn to match Fuchsia
dart-lang/sdk@cb428a7a02 [dart2js] Remove old bug work around in collector.
dart-lang/sdk@08663c20ab Change flutter patch to match existing DEPS on master branch
dart-lang/sdk@146ad014d9 update js/meta for the 2.10 dev sdk
dart-lang/sdk@488c718793 [co19] Roll co19 to d79951e06e443213243e54c2c32694b79a221b65
dart-lang/sdk@ba20edd7be Add patch for flutter-engine when changing to version 2.10

* Rev buildroot to latest version.

* Update license.

* update.

* Update gn revision.

* Format BUILD.gn files as the gn revision has been updated.
2020-07-29 13:10:15 -07:00
Kaushik Iska
132bfaa975 [tonic] Log stack trace for unhandles exceptions (flutter/engine#19811)
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.
2020-07-16 12:03:02 -07:00
David Worsham
cbd3cd9c0d fuchsia: Enable most unittests (flutter/engine#19583)
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
2020-07-13 17:36:19 -07:00
Michael Goderbauer
0b0c2c68d0 Word substitutions (flutter/engine#19111) 2020-06-18 11:05:24 -07:00
Jason Simmons
c7bc6e9ad0 Avoid creating a vector when constructing Dart typed data objects for platform messages (flutter/engine#18838) 2020-06-18 09:58:03 -07:00
Gary Qian
85c98bef38 Fix windows SkParagraph compilation (flutter/engine#19073) 2020-06-17 02:14:34 -07:00
bungeman
6282eb8094 Mark conditional SkParagraph include nogncheck. (flutter/engine#18741) 2020-06-02 11:18:03 -07:00
Dan Field
65afbec58a Make GetAllocationSize const (flutter/engine#18713) 2020-06-01 15:58:03 -07:00
Jason Simmons
ded9b51e21 [SkParagraph] Copy text height behavior to the Skia paragraph style (flutter/engine#18178) 2020-05-07 18:24:08 -07:00
Alexander Aprelev
4b5878c6ab Introduce runtime check that it is root isolate that makes UI native calls. (flutter/engine#18050)
* Revert "Do not register UI-related native functions in secondary isolates (#6401)"

This reverts commit c23deb818efc3813273d28ce7d965d0eb261cca9 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
2020-05-01 09:05:41 -07:00
Ali Mahdiyar
b1e554aee6 Handle paragraph alignment and direction in newline rectangles (flutter/engine#17750) 2020-04-20 14:35:01 -07:00
Jason Simmons
6e05478105 Remove unused parameter from GetLineXOffset (flutter/engine#17745) 2020-04-17 12:24:58 -07:00
Vyacheslav Egorov
2eb118495b Release acquired typed data before calling Dart_SetReturnValue. (flutter/engine#17729) 2020-04-15 10:35:04 -07:00
Chris Bracken
adb73da22f Use const refs in for loops where reasonable (flutter/engine#17484)
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.
2020-04-03 11:44:35 -07:00
Dan Field
904a84fee3 Roll to clang11, mark 4 (flutter/engine#17483)
* "Reland Clang 11, roll buildroot to 1bc40a5f916adb93d87e2a2230a0ec43db876c1c, take 4 (#17467)" (#17482)"

This reverts commit d7bbf2e70c8cb86823f1ec7a310d6ab0b9a610db.

* format code

* Roll buildroot to 3a27de1c5bb0f50be7d3efe3e00de4f6068c9f30
2020-04-02 13:04:49 -07:00
Greg Spencer
6a2e36c37f Make GetDefaultFontFamilies return a vector<string> instead of… (flutter/engine#16928)
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.
2020-03-05 00:45:53 +01:00
Ryan Macnak
ae7c21544b Roll Dart to df5036eb6e738c723339ed74c1e8ca93bea2570d. (flutter/engine#16936) 2020-03-04 13:45:24 -08:00
Chris Bracken
90f3de7400 Revert "Drop last usages of Dart_New from engine (#16838)" (flutter/engine#16915)
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 b41f86eb00e16e0dd6e1bfba7d670e05a8dafd4b.
2020-03-03 14:52:56 -08:00
Dan Field
b41f86eb00 Drop last usages of Dart_New from engine (flutter/engine#16838)
Image
Codec
FrameInfo
Scene/Picture toImage
2020-03-02 21:30:28 -08:00
Jason Simmons
6739aaff60 [libtxt] Fix the flag used to check validity of the strikeout position in Skia font metrics (flutter/engine#15981) 2020-02-27 11:36:54 -08:00
Dan Field
b1f692e9cb Refactor of ClaimDartHandle -> AssociateWithDartWrapper (flutter/engine#16720) 2020-02-20 17:31:03 -08:00
Dan Field
a03a05a385 Reland "Remove usage of Dart_AllocateWithNativeFields" (flutter/engine#16713) 2020-02-20 16:06:02 -08:00
Dan Field
d483ae6288 Revert "Remove usage of Dart_AllocateWithNativeFields from tonic (#16588)" (flutter/engine#16684)
This reverts commit d32975f3877f6be5b227f3156226ccdea35f15c9.
2020-02-19 10:00:05 -08:00
Ben Konyi
d32975f387 Remove usage of Dart_AllocateWithNativeFields from tonic (flutter/engine#16588)
This API is being removed from the Dart SDK.
2020-02-14 13:55:38 -08:00
Jason Simmons
2af9eee72e libtxt: use a fixture in the benchmarks (flutter/engine#16531) 2020-02-11 10:24:47 -08:00
Jason Simmons
504c378cd2 [SkParagraph] Text layout benchmarks using SkParagraph (flutter/engine#16373)
Imported from @Rusino's branch
2020-02-07 14:17:57 -08:00
stuartmorgan
69e4ea885f Suppress some deprecation warnings on Windows (flutter/engine#16416)
Targeted suppression of some deprecation warnings that are build errors under
clang:
- Ignore the deprecation of codecvt's unicode conversion until we decide on
  a replacement strategy.
- Allow the deprecated posix names of functions in third_party/txt.

Part of https://github.com/flutter/flutter/issues/16256
2020-02-05 21:10:25 -08:00
Chinmay Garde
426c48aaac Remove all uses of the redundant flutter_root variable. (flutter/engine#16311)
This was only necessary when the Engine had to build in multiple buildroots
where the sources where checked out at different paths relative to the
buildroot. This is no longer the case and there are already cases GN rules
have been written that mix and match variable usage with the direct
specification of the path to the Flutter sources relative to the sole buildroot.
2020-01-31 21:49:48 -08:00
Gary Qian
20ab007c56 Reland "Engine/LibTxt/dart:ui impl of TextHeightBehavior #15087" (flutter/engine#16155) 2020-01-29 10:52:24 -08:00
Dan Field
b392f1e3bd Revert breaking PRs (flutter/engine#16148)
* Revert "Web PargraphStyle TextHeightBehavior integration (#16075)"

This reverts commit a152c9df009f74b3f52c46845e618b8ddcf3eaa7.

* Revert "Engine/LibTxt/dart:ui impl of TextHeightBehavior (#15087)"

This reverts commit e6f6d2a3c2fe333a85c8997d755ca91594e80544.
2020-01-28 10:40:05 -08:00
Chinmay Garde
5defd058a9 Remove tonic/platform. (flutter/engine#16062)
This is unused.
2020-01-27 14:41:15 -08:00
Gary Qian
e6f6d2a3c2 Engine/LibTxt/dart:ui impl of TextHeightBehavior (flutter/engine#15087) 2020-01-27 13:37:11 -08:00
Chinmay Garde
93d67baf2b Move tonic into //flutter/third_party. (flutter/engine#15895)
Tonic used to be used by multiple consumers outside of Flutter Engine. Due to
this, it has an unnecessary abstraction layer as well as utilities duplicated in
FML and other engine subsystems. The sole user of Tonic is now the Flutter
Engine. It is intended that the Flutter Engine team now owns this subsystem,
remove unnecessary utilities and document the headers. This is the first step in
the transition. No history is being imported as the initial history was already
lost in the transition of this component to fuchsia.googlesource. As this
component was unmaintained there, I could see no additional value in importing
the history of the patches there.

No functional change. Just moved the repo from //third_party to
//flutter/third_party and updates GN refs.
2020-01-25 17:01:56 -08:00
Dan Field
62a99c60c5 the the fix (flutter/engine#15973) 2020-01-24 12:43:32 -08:00
Jason Simmons
bc8c219dc6 [libtxt] Assign a unique ID to each glyph cluster within a line (flutter/engine#15742) 2020-01-22 10:38:03 -08:00
Gary Qian
03b4730cb7 Add FML_DCHECK to ensure layout before calling getters (flutter/engine#15635) 2020-01-14 13:44:29 -08:00
Jason Simmons
0a68d8b149 Use Skia's CSS3 style matcher for dynamically loaded font sets (flutter/engine#15468)
This will improve font matching for SkParagraph, which relies on the
FontStyleSet's matchStyle implementation to find the closest match for a
FontStyle.
2020-01-13 17:35:56 -08:00
Jason Simmons
bb39a8050a [SkParagraph] Copy font features to the Skia layout engine text style (flutter/engine#15562) 2020-01-13 15:47:31 -08:00
Jason Simmons
dcc0266219 [SkParagraph] Cache the font collection created for use by the Skia text shaper library (flutter/engine#15317) 2020-01-08 15:21:35 -08:00
Gary Qian
ca8411d856 Fix RectHeightStyle::kMax ascent computation bug (flutter/engine#15106) 2020-01-07 10:43:42 -08:00
Jason Simmons
073d9af904 libtxt: cache fallback fonts found by a Minikin font collection (flutter/engine#14482)
If a new fallback font is discovered during paragraph layout, the fallback
font cache in txt::FontCollection will use that font in future layouts.

However, that cache is not available if the new fallback font needs to be
used for other characters within the current layout.  This PR adds a cache
to minikin::FontCollection and checks whether fonts in the cache can handle
a character before calling the fallback font provider.

See https://github.com/flutter/engine/pull/13257
2019-12-13 15:18:37 -08:00