923 Commits

Author SHA1 Message Date
Chris Bracken
69d7e8eb91
Correct button state on synthetic pointer events (#23111)
This corrects the button state emitted on synthetic pointer move and
hover events generated by the engine.

When an embedder notifies the engine of a pointer up or down event, and
the pointer's position has changed since the last move or hover event,
`PointerDataPacketConverter` generates a synthetic move or hover to
notify the framework of the change in position. In these cases, the
current event from the embedder contains the new button state *after*
the pointer up/down event, but the move/hover needs to be synthesized
such that it occurs *before* the pointer up/down, with the previous
button state.

This patch stores the button state after each pointer down, up, move, or
hover event such that it can be used by the next event if a synthetic
event must be issued.

The bug in the previous logic was revealed by the release of macOS 11
(Big Sur), which appears to issue move events between mouse down and
mouse up, which did not use to be the case.

This fixes https://github.com/flutter/flutter/issues/64961, which is the
desktop-specific tracking bug for the more general Big Sur mouse click
umbrella issue https://github.com/flutter/flutter/issues/71190.
2020-12-16 11:57:42 -08:00
Dan Field
205d2b8e18
Reland path volatility tracker (#23063)
* Revert "Revert "Set SkPath::setIsVolatile based on whether the path survives at least two frames (#22620)" (#23044)"

This reverts commit 4f914253bd7cd2a5cca3fd97213df37494e9bf37.

* Fix tracing
2020-12-14 17:21:55 -08:00
Dan Field
4f914253bd
Revert "Set SkPath::setIsVolatile based on whether the path survives at least two frames (#22620)" (#23044)
This reverts commit 2efc7c10aa12005010c837a1023024bb26bee143.
2020-12-11 15:39:24 -08:00
Jim Graham
bb81b954b9
Allow Tile mode for blur filter and add new decal TileMode (#22982)
Add a new TileMode.decal enum value and allow TileMode in ImagerFilter.blur() constructor
2020-12-10 14:37:17 -08:00
Dan Field
2efc7c10aa
Set SkPath::setIsVolatile based on whether the path survives at least two frames (#22620)
This patch defaults the volatility bit on SkPaths to false, and then flips it to true if the path survives at least two frames.
2020-12-10 13:57:23 -08:00
mikerreed
6ae2594b97
opt into new Skia APIs (#22845) 2020-12-03 15:28:02 -08:00
zljj0818
48befc59d4
More rename from GPU thread to raster thread (#22819) 2020-12-03 15:03:02 -08:00
Gary Qian
fcbfa9f527
Split AOT Engine Runtime (#22624) 2020-12-02 13:28:01 -08:00
Greg Spencer
d2ad4419bb
Fix PlatformDispatcher.locale to return something meaningful when there are no locales. (#22608)
Returns an "undefined" locale (language code "und") from PlatformDispatcher.locale when no locales are defined.
2020-12-01 09:54:56 -08:00
vsmenon
550c750252
Remove opt outs for dart:ui (#22603)
* Remove null safety opt outs for dart:ui
2020-11-19 18:54:12 -08:00
Matěj Žídek
93a8e6f04a
replace dead links (#22530) 2020-11-19 14:58:02 -08:00
Greg Spencer
4b859cee93
Fix typos and fix some env var state leakage in tests (#22576)
This just fixes some typos, and a small state leak in some of the tests that set env variables.
2020-11-17 21:51:37 -08:00
Greg Spencer
9a5fd321f6
Reland: Remove the Window class now that it is no longer used. (#22566)
Reland #22505, now that flutter/flutter#70637 has landed.

Removes references to dart:ui.Window, and switch usages to PlatformDispatcher or SingletonFlutterWindow, as appropriate.
2020-11-17 16:39:07 -08:00
Ian Hickson
1a5ec52a6c
Also maintain the zone on the ChannelBuffers.push callback (#22454) 2020-11-17 09:48:03 -08:00
Jim Graham
b0966e8123
Revert "Remove the Window class now that it is no longer used. (#22505)" (#22519)
This reverts commit 2004a7b3756d27c76f0c0ffcfaae885fb61f091a.
2020-11-13 23:12:12 -08:00
Greg Spencer
2004a7b375
Remove the Window class now that it is no longer used. (#22505)
This removes the Window class, now that the framework no longer uses it.
2020-11-13 14:38:15 -08:00
LongCatIsLooong
e872177c1f
Exposing ColorFilter to ImageFilter conversion and Compose() (#20309) 2020-11-12 15:34:02 -08:00
Greg Spencer
9f09ff2455
Reland: "Make PlatformDispatcher.locale and locales return consistent values (#22267)" (#22473)
This reverts commit d37b862, relanding #22267, now that flutter/flutter#70252 has landed to prevent the problems it had the first time.

Here is the original PR description:

For some reason (probably a bad merge on my part), the return values for locale and locales are not the same on web as they are on other platforms for the PlatformDispatcher and SingletonFlutterWindow classes. The web versions are non-nullable and the others are nullable.

This converts them to be the same (non-nullable) values
2020-11-12 13:20:13 -08:00
Jim Graham
d37b86216a
Revert "Make PlatformDispatcher.locale and locales return consistent values (#22267)" (#22461)
This reverts commit dc8864182c531994852a8263f77596a6131ed8fd.
2020-11-11 23:39:59 -08:00
Greg Spencer
dc8864182c
Make PlatformDispatcher.locale and locales return consistent values (#22267)
For some reason (probably a bad merge on my part), the return values for locale and locales are not the same on web as they are on other platforms for the PlatformDispatcher and SingletonFlutterWindow classes. The web versions are non-nullable and the others are nullable.

This converts them to be the same (non-nullable) values.
2020-11-11 16:30:22 -08:00
Emmanuel Garcia
7ab39127ee
loadFontFromList returns void instead of string (#22373) 2020-11-06 17:24:02 -08:00
张风捷特烈
1c2a56ce02
Update painting.dart (#22221) 2020-11-05 15:24:02 -08:00
Ian Hickson
ad79d23358
Refactor platform message logic (#22181) 2020-11-05 15:19:01 -08:00
Sarbagya Dhaubanjar
deb7c662d2
Updated return-type for PathMetric.extractPath to be non-nullable (#22292) 2020-11-04 14:54:03 -08:00
Daco Harkes
ccdb6819ce
WeakPersistentHandle migration (#19843)
and roll Dart to 52783837369de45d3372cb6c6b7cdd63e71cd829.
2020-11-03 13:06:53 +01:00
张风捷特烈
fe85f946db
Update painting.dart (#22195) 2020-10-29 15:28:02 -07:00
Greg Spencer
ce1dd11f51
Standardize macro names for dartdoc macros (#22180) 2020-10-29 12:03:04 -07:00
Chris Bracken
6e0262d37a
Fix _lerpInt precision bug (#22089)
Fixes a precision bug was introduced in 784e6d7, which improved the
precision of lerpDouble when the extrema differed significantly in
magnitude.

_lerpInt doesn't have this issue since the extrema are passed as 64-bit
twos-complement values, therefore the difference will always be accurate
so long as it doesn't overflow. This reverts the _lerpInt implementation
to the original a + (b - a) * t, but adds a test to avoid a regression
if anyone is tempted to make it consistent with the others.
2020-10-24 09:49:21 -07:00
Dan Field
b9520248c4
Add debugDisposed to Image (#21547) 2020-10-23 10:27:02 -07:00
Greg Spencer
6bc70e4a11
Reland: Migration to PlatformDispatcher and multi-window (#21932)
This re-lands #20496 and #21780 after fixing the semantics-enabling code that was causing the post-submit web_smoke_test to fail.

Below is the description from the original PR:

This is a PR for converting the dart:ui code in the engine to use a multi-window API. The goal here is to convert from the window singleton to an API that has the concept of multiple windows. Also, I'm matching up the new PlatformDispatcher class to talk directly to the PlatformConfiguration class in the engine. I'm not attempting to actually enable creating multiple windows here, just migrate to an API that has a concept of multiple windows. The multi-window API in this PR currently only ever creates one window.

The design doc for this change is here.

The major changes in this PR:

Move the platfom-specific attributes out of Window, and into the new PlatformDispatcher class that holds all of the platform state, so that the platform code need only update the configuration on this class.
Create FlutterView, FlutterWindow, and SingletonFlutterWindow classes to separate out the concepts of a view (of which there may be multiple in a window), a window (of which there may be multiple on a screen, and they host views), and a window where there is only ever expected to be one (this hosts the entire API of the former Window class, and will eventually be the type of the window singleton).
Next step after this PR lands:

Remove the Window class entirely (it is replaced by SingletonFlutterWindow). Some minor changes in the Framework are needed to switch to using SingletonFlutterWindow directly first.

The Window class still exists in this PR, but will be removed as soon as the framework is converted to point to the SingletonFlutterWindow class instead. They share the same API, just have different names (Window is currently a subclass of SingletonFlutterWindow). The intention is that the Window name will be freed up to use as a widget class name in the framework for managing windows. The singleton called window will remain, and keep the same API it has now.
2020-10-22 14:54:25 -07:00
Jonah Williams
6ce33dd4a9
[null-safety] fix soundness of Paragraph._addPlaceholder (#21994) 2020-10-20 09:57:59 -07:00
Jonah Williams
326157ee7e
[null-safety] fix Scene.toImage declaration (#21983) 2020-10-19 22:52:19 -07:00
Chinmay Garde
fa11ee6e2a
Fix native constructor of list of zircon handles and remove unused list factory specializations. (#21980) 2020-10-19 19:42:01 -07:00
Jonah Williams
895940081c
[null-safety] fix types of layer code (#21959) 2020-10-19 16:22:40 -07:00
Jonah Williams
1c35cc6416
[null-safety] fix type declaration of Picutre._toImage (#21942)
Fixes flutter/flutter#68377

Should be a nullable string. Looks like --null-assertions does not cover the native binding code.
2020-10-17 11:02:19 -07:00
Chris Bracken
49c35b6177
Eliminate unnecessary linter opt-outs (#21935)
Eliminates FLUTTER_NOLINT where they can be landed without triggering
lint failures.
2020-10-16 17:24:23 -07:00
Chinmay Garde
5bd7260a1e
Enable loading snapshots with sound null safety enabled. (#21820)
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
2020-10-16 14:53:26 -07:00
Chris Bracken
c449c8ee50
Eliminate FLUTTER_NOLINT where possible (#21904)
This removes most of the remaining FLUTTER_NOLINT comments and opts
these files back into linter enforcement.

I've filed https://github.com/flutter/flutter/issues/68273 to require
that all FLUTTER_NOLINT comments be followed by a GitHub issue URL
describing the problem to be fixed.
2020-10-16 12:44:49 -07:00
Jason Simmons
c2080ec725
Check for null images in ImageFromCompressedData (#21891) 2020-10-15 16:57:02 -07:00
Yuqian Li
c2938d06b1
Revert "Migration to PlatformDispatcher and multi-window #20496" (#21792)
* Revert "Fix documentation build for window changes. (#21780)"

This reverts commit 931a04683d6eb49fc92059b2384ac5b1618d5422.

* Revert "Migration to PlatformDispatcher and multi-window (#20496)"

This reverts commit 85b0031f73544e448354047dc6a236c0b0808252.
2020-10-12 19:26:41 -07:00
Greg Spencer
931a04683d
Fix documentation build for window changes. (#21780)
* Fix documentation build for window changes.

* Add missing interfaces for web_ui
2020-10-12 16:04:05 -07:00
Greg Spencer
85b0031f73
Migration to PlatformDispatcher and multi-window (#20496)
This is a PR for converting the dart:ui code in the engine to use a multi-window API. The goal here is to convert from the window singleton to an API that has the concept of multiple windows. Also, I'm matching up the new PlatformDispatcher class to talk directly to the PlatformConfiguration class in the engine. I'm not attempting to actually enable creating multiple windows here, just migrate to an API that has a concept of multiple windows. The multi-window API in this PR currently only ever creates one window.

The design doc for this change is here.

The major changes in this PR:

Move the platfom-specific attributes out of Window, and into the new PlatformDispatcher class that holds all of the platform state, so that the platform code need only update the configuration on this class.
Create FlutterView, FlutterWindow, and SingletonFlutterWindow classes to separate out the concepts of a view (of which there may be multiple in a window), a window (of which there may be multiple on a screen, and they host views), and a window where there is only ever expected to be one (this hosts the entire API of the former Window class, and will eventually be the type of the window singleton).
Next step after this PR lands:

Remove the Window class entirely (it is replaced by SingletonFlutterWindow). Some minor changes in the Framework are needed to switch to using SingletonFlutterWindow directly first.

The Window class still exists in this PR, but will be removed as soon as the framework is converted to point to the SingletonFlutterWindow class instead. They share the same API, just have different names (Window is currently a subclass of SingletonFlutterWindow). The intention is that the Window name will be freed up to use as a widget class name in the framework for managing windows. The singleton called window will remain, and keep the same API it has now.
2020-10-09 16:29:16 -07:00
David Worsham
d5dddf32e7
fuchsia: Don't send ViewportMetrics w/ 0 DPR (#21392) 2020-10-06 17:57:28 -07:00
Nolan Scobie
d92c42f349
Minor a11y documentation breadcrumbs (#20330)
Adds a reference to RenderObject.describeSemanticsClip to
`SemanticsFlag.isHidden` and a hint that lets readers know that the
`SemanticsNode` rect is specified in local coordinates.
2020-10-02 23:30:23 -07:00
Dan Field
08cf7256d8
Fix getNextFrame (#21422) 2020-09-25 17:26:59 -07:00
Alexander Brusher
de5f2b48fb
Revert "Revert "Adds fuchsia node roles to accessibility bridge updates. (#20385)" (#20936)" (#21367)
This reverts commit 96efe39272a2850092c9a1445dc5406dbe1fb645.
2020-09-25 11:07:10 -07:00
Dan Field
aa8d5d4b9b
Avoid sending a 0 DPR to framework (#21389)
* Avoid sending a 0 DPR to framework

* check width and height as well
2020-09-25 10:35:57 -07:00
Ian Hickson
ee71df706a
Revert "Make drain() consistently asynchronous. (#21062)" (#21391)
This reverts commit cdc631c4338455f292f68c110d584870753e0160.
2020-09-24 18:19:53 -07:00
Ian Hickson
cdc631c433
Make drain() consistently asynchronous. (#21062) 2020-09-23 22:17:02 -07:00
Dan Field
2ea7e5230b
isCloneOf for Image (#21371)
* isCloneOf for Image

* Update docs, add missing impl
2020-09-23 21:09:44 -07:00