106 Commits

Author SHA1 Message Date
Ferhat
b080bdf56f
Prevent recycling of canvas multiple times (#23089) 2020-12-15 16:42:40 -08:00
Mouad Debbar
7bdaf3795b
[web] Introduce flag to enable new rich text implementation (#22942) 2020-12-11 09:28:37 -08:00
David Iglesias
50d830a1ac
[web] Do not reset 'cursor' in PersistedPlatformView. (#22977) 2020-12-10 16:03:02 -08:00
nturgut
3a30ae3d5c
Fix ios voiceover (for safari >13.4) (#22965)
* fixes voice over for higher ios-safari versions

* change enable conditions for webkit

* adding click event for removal. adding unit tests

* run the mobile semantics enabler test on mobile browsers

* remove test method that gave different result on LUCI.(further inv. needed)
2020-12-10 11:59:44 -08:00
Ferhat
4797b06652
[web] Fix drag failure when RMB pointer up event is not received (#22946) 2020-12-10 10:32:04 -08:00
Ferhat
91ec9451dd
[web] Optimize BitmapCanvas. Fixes overallocation of canvas elements (#22856) 2020-12-10 09:08:29 -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
nturgut
fbf6818741
Enabling semantics tests for safari, ios-safari and firefox (#22662)
* enable safari tests for almost all the methods for semantics tests

* enable almost all semantics tests for firefox

* Safari desktop have different scroll max values for different versions

* fix assert
2020-11-23 15:45:55 -08:00
Ferhat
23324c10dd
[web] Fix test failure on high dpi device (#22618) 2020-11-19 14:56:30 -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
Ferhat
c81a2ecb58
[web]Update @dart annotation. Change shaders to allocate smaller canvas (#22481) 2020-11-13 13:55:32 -08:00
Konstantin Scheglov
cf376142ed
Ignore several import_of_legacy_library_into_null_safe (#22326) 2020-11-06 09:55:29 -08:00
Ferhat
1ad676529a
[web] Fixes canvas pixelation and overallocation due to transforms. (#22160) 2020-10-30 09:02:49 -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
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
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
Ferhat
149ef70830
[web] Implement sweep gradient (#21873) 2020-10-19 22:14:42 -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
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
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
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
Yegor
94af181af6
web: implement frame timings (#21552)
* web: implement frame timings
2020-10-02 22:05:07 -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
a17036ca1c
fix EnginePicture.toImage; implement rawRgba toByteData; add test (#21370) 2020-09-29 12:17:03 -07:00
Mouad Debbar
fc7d0fc905
[web] Respond with null for unimplemented method channels (#21423) 2020-09-25 18:49:41 -07:00
David Iglesias
3d0f12974d
[web] Add canUpdateAsMatch to PersistedPlatformView. (#21313) 2020-09-23 21:47:02 -07:00
Dan Field
c0e1df65e5
implement decodeFromPixels (#21298) 2020-09-23 21:42:01 -07:00
Jonah Williams
83c9d103ed
[web] dispatch browser event on flutter/service_worker channel (#21284)
Registering the service worker immediately after the documented has loaded may cause SW initialization to compete with framework initialization. It was recommended to us that we defer the service worker setup until after the framework is done with setup, which should be sometime after the first frame.

To implement this, the binding will dispatch a platform message on startup. This can be listened for in the html document
#66066
2020-09-22 07:37:23 -07:00
Dan Field
6a6d6d7593
Implement toString for Images on web (#21304) 2020-09-21 17:22:02 -07:00
chunhtai
833c6a2e00
Implement browser history class for router widget (#20794) 2020-09-10 21:00:02 -07:00
Ferhat
bada9fc5f3
[web] Fix path clip crash when reused (#20846) 2020-08-30 19:35:39 -07:00
Ferhat
3ccf1ed2ec
Cliprect op (#20837)
* Switched PathCommand apply parameter to non-nullable. Add clip op parameter to ClipCommand.
2020-08-27 22:38:03 -07:00
Ferhat
87fd0e497c
Guard recording_canvas against restore calls without ending recording (#20786) 2020-08-26 11:19:07 -07:00
nturgut
bb24b4938f
[web] Build unit tests with dart2js instead of build_runner (#20390)
* change from build_runner to dart2js

* add internalBootstrapBrowserTest to some of the tests

* add internalBootstrapBrowserTest to all remaining tests

* make tests build in paralel. Total time dropped from 586 to 177 seconds for 8 core MacBook

* change isolates with pool

* fixing analysis errors

* skipping canvaskit tests for ios-safari

* copy image files to the build directory

* adding internalBootstrapBrowserTest to newly added tests

* add internalBootstrapBrowserTest to faling path iterator test

* necessary changes to make chrome windows work

* in windows test in chrome instead of edge. our edge code was for legacy edge

* do not run golden unit tests on Windows LUCI bots for now

* addressing reviewer comments. Adding a method for deciding when to run integration tests.

* remove lines that I forgot to remove

* fixing analysis error. add issue for todo

* add bootstap to a test file

* adding bootstrap to another test

* add internalBootstrapBrowserTest to a golden test

* return test result in bat file. use archieve package to unzip

* fixing logs for chrome_installer

* use archieve and archieve entity instead of dynamic

* adding comments for windows platform archieve part

* addressing reviewer comments

* change readme file
2020-08-17 16:19:27 -07:00
Jason Simmons
9993228251
Fix web_ui warnings flagged by the next Dart analyzer update (#20524) 2020-08-14 13:29:50 -07:00
Ferhat
6988f01779
Add Path iterator tests, sync verbs with skia enums, fix PathIterator.peek. (#20381)
* Sync verb enum to skia. Fix PathIterator.peek, add tests
* Add constant for iterator buffer size
2020-08-10 17:24:28 -07:00
MichealReed
06c89cd1c8
Implemented web image codec instantiation for CanvasKit. (#20194) 2020-08-04 15:01:02 -07:00
Mouad Debbar
f288fe563d
[web] Enable canvas measurement by default (#19924) 2020-07-29 16:18:07 -07:00
nturgut
d2d02917d9
[a11y-web] Semantics fix (#19898)
* fixinf enable semantics

* fix unit tests

* fix indentation

* addressing reviewer comments

* fix comment

* make commnt starts upper case

* fix grammar in comment

* Add one more comment
2020-07-28 10:29:02 -07:00
Ferhat
37fa2850d1
[web] Prevent crash when restore is called incorrectly after recording ends. (#19948)
* Prevent crash when restore is called after picture recording ends
* Addressed reviewer comments
2020-07-22 12:55:22 -07:00
Ferhat
df23044897
[web] Implement ulps for path ops (#19711)
* Implement ulps for path ops
* Address review comments
* cache abs()
* dartfmt and update licenses
2020-07-13 13:43:11 -07:00
Ferhat
f10f172573
[web] Update SurfacePath to use PathRef (#19557)
* Update SurfacePath to use PathRef
* Fix test analysis errors
* Switch DDRect to use path to reduce paint time processing
* Implement toString() for debug mode
* Fix contains (bounds inclusive) edge case, add test
* Update recording canvas test for drawDRRect change
* Update diffrate for arc/conic render change
* Add test for winding for beveled border. Fix checkOnCurve
* Fix mono quad winding on curve check
* fix _chopCubicAtYExtrema and add test case
* Address reviewer comments / setAll API usage
2020-07-09 13:55:39 -07:00
Alexandre Ardhuin
218d98f4d8
Operator equals (#19303)
* use Object for operator==

* apply style guide for operator==
2020-06-30 23:16:31 +02:00
nturgut
3fcf5463b9
Run IOS unit tests on LUCI (#19141)
* change the version of simulator. luci bots only has 13.0

* skip failing pointer binding tests

* skip path_metrics (canvaskit) and a method from surface_test

* fix analyzer errors

* remove extra added touch event context test

* removing left overs for screenshot debugging

* apply reviewers suggestion for skipping tests
2020-06-23 15:22:01 -07:00
Yegor
00aa0bc071
take web_ui to null safety (#19027)
move web_ui to NNBD syntax
2020-06-16 15:28:06 -07:00