1530 Commits

Author SHA1 Message Date
Zachary Anderson
b54bb88f00
Migrate runZoned to runZonedGuarded (#22198) 2020-10-29 11:02:35 -07:00
Ferhat
07c780bd95
[web] Assign default natural width/height for svgs that report 0,0 on firefox and ie11 (#22184) 2020-10-29 09:54:49 -07:00
Mouad Debbar
005dec449a
[web] Clean up unused previousStyle logic (#22150) 2020-10-28 18:17:03 -07:00
Jonah Williams
b177edd069
[null-safety] update path version (#22134) 2020-10-26 18:49:42 -07:00
Ferhat
412e14d54e
[web] Fix positioning of canvas elements due to svg filters (#22070) 2020-10-25 22:15:03 -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
Ferhat
6999c4d4e2
When picture is updated and bitmapcanvas reused, clear element cache (#22072) 2020-10-23 12:31:48 -07:00
Dan Field
b9520248c4
Add debugDisposed to Image (#21547) 2020-10-23 10:27:02 -07:00
Ferhat
f0b10c54bf
[web] Prevent using DOM nodes for canvas with large number of draws (#22064) 2020-10-22 22:38:08 -07:00
Angjie Li
cde1e3fca8
Auto detect mode to determine which rendering backend to use. (#21852) 2020-10-22 16:17: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
Zachary Anderson
2ef0f4228c
Revert "[web] Fix image gap due to svg element without position attribute (#21939)" (#21986)
This reverts commit 79879802e05edb2f8fb871428609f3db5a549273.
2020-10-19 23:54:07 -07:00
Jonah Williams
326157ee7e
[null-safety] fix Scene.toImage declaration (#21983) 2020-10-19 22:52:19 -07:00
Ferhat
79879802e0
[web] Fix image gap due to svg element without position attribute (#21939) 2020-10-19 22:15:06 -07:00
Ferhat
149ef70830
[web] Implement sweep gradient (#21873) 2020-10-19 22:14:42 -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
Ferhat
0747f2f4b1
[web] Fix 3d transforms for html backend (#21499)
* Workaround for canvas element lacking support for 3d setTransform

* update golden test

* Add webkit workaround

* Implement DOM rendering for perspective

* cleanup

* update goldens lock

* Add check for shader and filtermask for dom use

* Fix svg viewBox. Move zIndex check to bitmap canvas

* Fix null check warning

* Fix scene_builder zIndex=-1 test to force canvas usage

* Add blendmode handling for DOM mode

* Update maxdiff and golden locks

* Remove unused import

* Add drawcolor/drawpaint test. Fix bounds for drawColor/drawPaint

* update golden locks

* adjust drawColor for dpr

* Update test to use canvas

* Fix toDataUrl NNBD

* Update Picture.toImage to use canvas to obstain image data

* Remove write:true from golden calls

* Add fill-rule for _pathToSvgElement

* Update golden locks

* Fix sceneBuilder pushClip / add missing clipBehaviour

* Fix test now that clipping works correctly

* move overflow handling for tests into DOMClip.addOverflow

* Add clipRect to test to keep render inside bitmap canvas area

* Update compositing test, fix drawColor coordinates

* update golden locks

* Skip test for matchGolden infra fail

* update golden lock

* merge

* update maxdiff for text over canvas

* update golden diff

* update paint spread bounds maxdiff

* update paint spread maxDiff
2020-10-19 17:27:27 -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
Ferhat
890f016207
[web] Implement ClipOp.difference (#21901) 2020-10-17 00:09:41 -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
Harry Terkelsen
869d3c8c7a
Set strokeCap, strokeJoin, and strokeMiter when resurrecting Paint (#21926) 2020-10-16 16:08:46 -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
Harry Terkelsen
ddf978b8b9
Add more TextStyle support to Paragraph in CanvasKit mode (#21629)
* WIP on Paragraph

* WIP skparagraph

* Add more Paragraph features in CanvasKit mode

* Fix addRoundRect test

* Respond to review comments

* Remove unused (and potentially harmful) getters from Sk classes
2020-10-15 16:33:51 -07:00
nturgut
3b2da6be9f
[web] enabling firefox screenshot tests. adding to documentation (#21807)
* enabling firefox screenshot tests. adding to documentation

* test with correct goldens

* update goldens SHA

* change the goldens with flutter/goldens repo

* do not run preparation step twice. this will cause test_results to be deleted
2020-10-13 19:26:34 -07:00
Ferhat
d5c5a8ec61
[web] Fix Altgr keyboard crash (#21781)
* Fix AltGr modifier crash
* update integration test
2020-10-13 08:53:28 -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
nturgut
38d8ebaa46
E2e screenshot tests2 (#21383)
* carrying code

* more changes for carrying the code

* rebase changes onto ios-screenshot tests

* adding screenshot capability to text_editing e2e test

* address some comments

* change enable flag for isUnitTestsScreenshotsAvailable

* addressing the reviewer comments

* change the dependency for path

* add to licencense file

* changing goldens commit no. the new commit has the screenshot goldens

* update readme file

* firefox tests needs LUCI changes

* change to release mode since screenshots were taken in release mode

* change window size

* some argument changes

* small comment change

* test the chrome linux tests again

* use roboto font instead of default font

* addressing reviewer comments

* change commit for goldens
2020-10-12 16:25:57 -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
Ferhat
ec1d111171
[web] Add ShaderBuilder, change drawVertices to use builder. (#21716)
* Move shader.dart into shaders directory
* Add Shader builder basic structure and decls
* rewrite drawVertices with ShaderBuilder
* Fix in parameters in fragment shader to use varying for webgl1
2020-10-09 15:52:29 -07:00
Mouad Debbar
9ab40c2809
[web] Reland Support custom url strategies (#21702) 2020-10-08 14:30:02 -07:00
nturgut
83e18142e8
chrome driver for chrome 86 (#21705) 2020-10-08 13:41:05 -07:00
nturgut
eb939028f9
fixing the autofill overlay problem (blue area for chrome) (#21610)
* fixing the autofill overlay problem (blue area for chrome)

* addression comments
2020-10-08 10:10:12 -07:00
Dan Field
3905b9ec39
Revert "[web] Support custom url strategies (#19134)" (#21687)
This reverts commit 02324994a3f44a2777ade96b3d69aa61901fb9b4.
2020-10-07 21:42:20 -07:00
Mouad Debbar
02324994a3
[web] Support custom url strategies (#19134) 2020-10-07 17:19:07 -07:00
David Worsham
d5dddf32e7
fuchsia: Don't send ViewportMetrics w/ 0 DPR (#21392) 2020-10-06 17:57:28 -07:00
Ferhat
284ef2217d
[web] Fix CapsLock keyevent (#21584)
* Fix metaState for Key events for lock modifiers
2020-10-05 12:49:32 -07:00
Yegor
33515242ed
test CkPath.reset() (#21567) 2020-10-05 12:44:33 -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
Yegor
94af181af6
web: implement frame timings (#21552)
* web: implement frame timings
2020-10-02 22:05:07 -07:00
Yegor
de7c0b9b81
Respect the --debug option in Firefox (#21438) 2020-10-02 18:17:02 -07:00
Dan Field
89a46af119
Implement Image.clone for CanvasKit (#21555) 2020-10-02 12:57:01 -07:00
Luigi Rosso
a446aac02e
Fix for issue flutter/#66502. (#21372) 2020-10-02 09:10:11 -07:00
Ferhat
af5717eb10
[web] Fix setPreferredOrientations failure on iOS due to NNBD change. (#21531) 2020-10-01 14:00:01 -07:00
Ferhat
f37a0b12e8
Fix mono quad winding (#21530) 2020-10-01 13:51:38 -07:00
Yegor
93735c98ef
re-enable CanvasKit path ops test (#21520)
* re-enable CanvasKit path ops test

* also test Path.combine
2020-09-30 14:30:01 -07:00