807 Commits

Author SHA1 Message Date
David Iglesias
d3c60acef8
More controls for Screenshot tests (for web) (#12284)
New features for golden tests (for web):

* Height/width of headless browser instance extracted to constants
* Remove border from the host iframe
* Added 'region' to matchGoldenFile, so screenshots can capture only
a subset of the viewport
* Added image-format-awareness (png) to screenshot comparison, so it
doesn't only look at raw bytes
* When a test fails, output a diff image alongside the unexpected
output.
2019-09-18 14:58:30 -07:00
David Iglesias
8814f6865c
Ensure DRRects without corners also draw. (#12330)
Uncovered this bug running some additional engine tests. Backported the
test here, and fixed the recording_canvas code.
2019-09-18 10:45:43 -07:00
Chinmay Garde
1c7300ed1e
Account for root surface transformation on the surfaces managed by the external view embedder. (#11384)
The earlier design speculated that embedders could affect the same
transformations on the layers post engine compositor presentation but before
final composition.

However, the linked issue points out that this design is not suitable for use
with hardware overlay planes. When rendering to the same, to affect the
transformation before composition, embedders would have to render to an
off-screen render target and then apply the transformation before presentation.
This patch negates the need for that off-screen render pass.

To be clear, the previous architecture is still fully viable. Embedders still
have full control over layer transformations before composition. This is an
optimization for the hardware overlay planes use-case.

Fixes b/139758641
2019-09-17 15:16:59 -07:00
Harry Terkelsen
d1692d4cc7
Update canvaskit backend (#12318)
* Improve the CanvasKit backend for Flutter Web

- Improve font handling by trying to load a "normal" font face
  instead of using the first face matching the family.
- Implement Vertices and drawVertices

* Add license header to vertices.dart

* Remove unused 'encodedPositions'

* Delete commented old code. Don't use Skia by default

* Add `vertices.dart` to licenses file
2019-09-17 14:42:18 -07:00
Mouad Debbar
b790d48ebc
README for the felt tool (#12323) 2019-09-17 14:03:31 -07:00
David Iglesias
851f4606f1
Improve check to render (or not) a DRRect when inner falls outside of outer on RecordingCanvas (#12229)
* Improve check to determine if a rrect is fully contained within another in RecordingCanvas.
* Add unit tests.

Fixes https://github.com/flutter/flutter/issues/37772 (and others)
2019-09-17 13:27:44 -07:00
gaaclarke
0a455a8207
Channel buffers (#12167)
Added channel buffers to 'ui' so that messages have a place to
go until message handling is setup.
2019-09-17 12:22:00 -07:00
Mouad Debbar
7ab695618e
Add a build command to felt (#12303)
- The build command supports a `--watch` or `-w` flag to watch for
changes and rebuild.

Fixes https://github.com/flutter/flutter/issues/40392
2019-09-17 10:31:13 -07:00
Michael Goderbauer
d5139465f6
Cleanup in web_ui (#12307) 2019-09-16 16:04:12 -07:00
Jonah Williams
11bb2bffeb
Include firefox in check to quote font families (#12288) 2019-09-16 14:17:17 -07:00
Mouad Debbar
968c3aa169
Refactor and polish the 'felt' tool (#12258)
1. Various functionalities offered by this tool are now organized into commands (e.g. `felt test`, `felt check-licenses`).
2. The felt tool can now be invoked from anywhere, not necessarily from the web_ui directory.
3. This new structure helps us scale better as we add more commands (e.g. soon a `build/watch` command is coming).
2019-09-16 10:41:34 -07:00
Michael Goderbauer
ef7bcafd5c
a11y: expose max character count for text fields (#12269) 2019-09-16 09:37:25 -07:00
Kaushik Iska
6fbbfe18e8
Fix flutter runner paths (#12289) 2019-09-15 16:22:35 -07:00
Kaushik Iska
00c8941dae [flutter_runner] Change the path to artifacts (#12282)
This is to account for fxb/36483
2019-09-13 16:18:03 -07:00
Nurhan Turgut
9c8465927e
Editable text fix (#12249)
* enabling spellcheck for text editing

* Fixing errors in the input box, which arrises when the fontweight is null.

* Rollback the spellcheck change. Still not tested in safari mobile.

* Carrying the assignment of fontweight from index to EditingStyle constructor. This reduce # of null checks to one.
2019-09-12 13:41:14 -07:00
Yegor
d6f0b64d06
pin and auto-install chrome version (#12228)
pin and auto-install chrome version
2019-09-12 10:25:37 -07:00
Kaushik Iska
988efe376a
Do not generate kernel platform files on topaz tree (#12222) 2019-09-11 12:42:27 -07:00
Harry Terkelsen
6c46a173e3
Don't disable toString in release mode for dart:ui classes (#12204) 2019-09-11 10:26:15 -07:00
Kaushik Iska
2bdfb61a04
Namespace patched SDK names to not conflict with Topaz (#12218) 2019-09-11 08:19:58 -07:00
Harry Terkelsen
e174b4b9b0
Don't load Roboto by default (#12205)
Fixes https://github.com/flutter/flutter/issues/39260
2019-09-10 16:40:41 -07:00
Yegor
e9c998468e
add a convenience CLI tool for building and testing web engine (#12197) 2019-09-10 14:52:57 -07:00
Yegor
954f1988c5
Add custom test plugin that supports screenshot tests (#12079)
- Add a custom `PlatformPlugin` that spins up a server waiting for test to request a screenshot.
  - When a screenshot is requested the plugin talks to Chrome via the debug port, captures a screenshot, and compares it with a golden file
- This PR also adds proper CLI for `dev/test.dart` with an `ArgParser` for future extension into a proper developer tool for the team.
  - As a first couple of features, it adds `--debug` option to launch Chrome in debug mode, a `--target` option to choose a single test to run rather than all tests, and `--shard` option to choose a subset of tests to run.

Limitations:
 - While screenshot test will run on Cirrus, they are configured to not fail on Cirrus. Need to solve Chrome version skew.
 - Stack maps do not work yet (you get stacks, but they are nonsensical)
 - When requesting a single test, build_runner builds all tests anyway
 - Nothing but desktop Chrome is supported
 - Nothing but Linux is supported
 - There's no Chrome version pinning; currently assumed stable Chrome channel
2019-09-10 13:53:47 -07:00
Jonah Williams
2438798147
Make ImageShader implement Shader for web ui (#12161) 2019-09-10 10:15:32 -07:00
Ferhat
c2e82892aa
Add GradientRadial paintStyle implementation (#12081) 2019-09-09 14:13:10 -07:00
Harry Terkelsen
c3eea0ac28
Don't quote generic font families (#12080)
* Don't quote generic font families

This is a change that should have been upstreamed before.

* Change generic family List to a Set

* Add test
2019-09-09 14:05:40 -07:00
Kaushik Iska
7ea9884ab0
[flutter_runner] Kernel platform files can now be built in topaz (#12016)
- Tested this compatibility in topaz repo. The build rules can now be
used to build kernel_platform_files in topaz tree, after this change we
can migrate the platform*dill and vm*snapshot files in topaz to use the
engine built artifacts.

- Also removes some namespace conflicts for dart configuration.
2019-09-06 14:34:26 -07:00
Ferhat
e50bfbe9f7
Fix multi span text ruler cache lookup failure. (#12023) 2019-09-06 14:05:52 -07:00
liyuqian
4243324a03
Revert "Add a BroadcastStream to FrameTiming (#11041)" (#11841)
This reverts commit e97ed36e580c9b4c4a3d768cfe1a520f7bf8161d.

Reason for revert: Stream is considered a bad API: https://github.com/flutter/engine/pull/11041#issuecomment-526892247
2019-09-05 10:41:55 -07:00
Mouad Debbar
cd920398e4
Handle new navigation platform messages (#11880) 2019-09-04 15:13:24 -07:00
Harry Terkelsen
57f4ea4d37
Provide a hook for a plugin handler to receive messages on the web (#11796)
* WIP on web plugin registry

* WIP on web plugins

* More WIP on registering web plugins

* remove flutter_web_plugins

* add license header

* Update year of license header to 2013

* Update the license goldens file
2019-08-30 17:08:31 -07:00
gaaclarke
daf1a27d46
Started logging warnings if we drop platform messages. (#11792) 2019-08-30 12:48:03 -07:00
Yegor
81e010f771
last flutter web sync: cc38319841 (#11732)
* last flutter web sync: cc38319841

* revert text.dart changes

* revert paragraph.dart

* link to issue
2019-08-29 18:50:50 -07:00
Harry Terkelsen
1b1f78165e
Quote the font family name whenever setting the font-family property. (#11722)
Browsers will only allow font names with spaces or '/' if they are
in quotes.

Fixes https://github.com/flutter/flutter/issues/39486
2019-08-29 15:58:32 -07:00
Martin Kustermann
74a3c73e3c
Roll src/third_party/dart 35382f9b14..05c28c6115 (#11702)
* Roll src/third_party/dart 35382f9b14..05c28c6115

dart-lang/sdk@05c28c6115 Reland "Scaffolding for dart:wasm"
dart-lang/sdk@d57a8f7451 [vm/bytecode] Remove DebugCheck in synthetic non-local transfer (no source pos).
dart-lang/sdk@b565c8c20f Don't serialize not serializable constant variable initializers.
dart-lang/sdk@ce12a2722d Migration: handle named parameters in _substituteFunctionAfterFormals.
dart-lang/sdk@a290271dea [vm/bytecode] Throw should be 'debug checked', but not ReThrow.
dart-lang/sdk@63133a2a8c [cfe] Handle extension instance method tearoff
dart-lang/sdk@a147d4e8d2 [cfe] Handle simple use of extension instance members
dart-lang/sdk@e9fdeb2db8 Migration: add support for creating instances without supplying type arguments.
dart-lang/sdk@66e349da9c Migration: Clean up substitution logic in getOrComputeElementType
dart-lang/sdk@e9a44ba6a8 fix extension instance field error
dart-lang/sdk@15a7b57d8e split endFields into endClass/Mixin/ExtensionFields events
dart-lang/sdk@ed1b4ffba1 Add tests of extensions of mixins
dart-lang/sdk@ef36f1ba0d [vm/fuzzer] Reduce limit on methods and classes
dart-lang/sdk@7b17602c74 [vm/bytecode] Include function name into source fingerprints
dart-lang/sdk@851701d2a4 add BREAK suggestions to switch cases
dart-lang/sdk@57f7941eef [cfe] Remove 'functionNestingLevel' for VariableDeclaration.forValue
2019-08-29 22:06:42 +02:00
David Iglesias
9a17d8e451
Don't crash while loading improperly formatted fonts on Safari (#11655)
(cl/265763028)

Fixes https://github.com/flutter/flutter/issues/39259
2019-08-29 09:03:14 -07:00
Yegor
479719b26d
remove Web test blacklist; all tests should pass now (#11640)
* copy ahem.ttf where web_ui can find it
* remove Web test blacklist; all tests should pass now
2019-08-28 12:37:34 -07:00
Gary Qian
13ece5c7fc
Update the ui.LineMetrics.height metric to be more useful to external users (#11456) 2019-08-28 12:26:42 -07:00
Chris Bracken
bf86d08102
Add missing newline at EOF (#11473)
This was required by the C++ spec pre-C++11 and still gets picked up in
the Fuchsia tree due to -Wnewline-eof. It fixes:

    ../../third_party/flutter/lib/ui/text/line_metrics.h:75:47: error: no newline at end of file [-Werror,-Wnewline-eof]
    #endif  // FLUTTER_LIB_UI_TEXT_LINE_METRICS_H_
2019-08-26 21:11:57 -07:00
Gary Qian
9f1eab2f1f
Expose LineMetrics in dart:ui (#10670) 2019-08-26 13:40:22 -07:00
Yegor
f38913b7c7
sync Flutter Web engine to the latest (#11421)
* sync Flutter Web engine to the latest
2019-08-26 08:16:09 -07:00
Chinmay Garde
b7d03138ed
Remove deprecated ThreadTest::GetThreadTaskRunner and use the newer CreateNewThread API. (#11395)
We will end up creating fewer threads in tests.
2019-08-23 12:21:46 -07:00
Yegor
ffe8c0b33d
preventDefault on touchend to show iOS keyboard (#11390) 2019-08-22 17:35:07 -07:00
Yegor
fad38e252f
sync web engine; run web engine tests (#11031)
sync web engine; run web engine tests
2019-08-22 16:38:03 -07:00
liyuqian
e97ed36e58
Add a BroadcastStream to FrameTiming (#11041)
Without this, developers have to override `onReportTimings` to listen for `FrameTiming`.
That can potentially break previous `onReportTimings` listeners if they forget to call
the old listener in their new callback.

This PR replaces the similar RP in the framework: https://github.com/flutter/flutter/pull/38574

Once this PR landed, we'll have to create another framework PR to use the stream to replace
`onReportTimings` usages.

Once that's done, we can then propose the breaking change of removing the deprecated
`onReportTimings`.
2019-08-19 10:52:16 -07:00
Shi-Hao Hong
014ab76ad0
Pass Android Q insets.systemGestureInsets to Window (#10413)
* Pass Android Q system gesture inset information from insets.systemGestureInsets to Window.systemGestureInsets
2019-08-16 13:42:56 -04:00
Brian Osman
646b594d5e
Remove unused dstColorSpace argument to MakeCrossContextFromPixmap (#11052) 2019-08-16 12:57:53 -04:00
Jason Simmons
33d168f99f
Remove the ParagraphImpl class from the text API (#11012)
ParagraphImpl was used to switch between libtxt and Blink implementations
of text rendering and is now obsolete.
2019-08-15 15:23:00 -07:00
Chinmay Garde
e8f954409d
Allow embedder controlled composition of Flutter layers. (#10195)
This patch allows embedders to split the Flutter layer tree into multiple
chunks. These chunks are meant to be composed one on top of another. This gives
embedders a chance to interleave their own contents between these chunks.

The Flutter embedder API already provides hooks for the specification of
textures for the Flutter engine to compose within its own hierarchy (for camera
feeds, video, etc..). However, not all embedders can render the contents of such
sources into textures the Flutter engine can accept. Moreover, this composition
model may have overheads that are non-trivial for certain use cases. In such
cases, the embedder may choose to specify multiple render target for Flutter to
render into instead of just one.

The use of this API allows embedders to perform composition very similar to the
iOS embedder. This composition model is used on that platform for the embedding
of UIKit view such and web view and map views within the Flutter hierarchy.
However, do note that iOS also has threading configurations that are currently
not available to custom embedders.

The embedder API updates in this patch are ABI stable and existing embedders
will continue to work are normal. For embedders that want to enable this
composition mode, the API is designed to make it easy to opt into the same in an
incremental manner.

Rendering of contents into the “root” rendering surface remains unchanged.
However, now the application can push “platform views” via a scene builder.
These platform views need to handled by a FlutterCompositor specified in a new
field at the end of the FlutterProjectArgs struct.

When a new platform view in introduced within the layer tree, the compositor
will ask the embedder to create a new render target for that platform view.
Render targets can currently be OpenGL framebuffers, OpenGL textures or software
buffers. The type of the render target returned by the embedder must be
compatible with the root render surface. That is, if the root render surface is
an OpenGL framebuffer, the render target for each platform view must either be a
texture or a framebuffer in the same OpenGL context. New render target types as
well as root renderers for newer APIs like Metal & Vulkan can and will be added
in the future. The addition of these APIs will be done in an ABI & API stable
manner.

As Flutter renders frames, it gives the embedder a callback with information
about the position of the various platform views in the effective hierarchy.
The embedder is then meant to put the contents of the render targets that it
setup and had previously given to the engine onto the screen (of course
interleaving the contents of the platform views).

Unit-tests have been added that test not only the structure and properties of
layer hierarchy given to the compositor, but also the contents of the texels
rendered by a test compositor using both the OpenGL and software rendering
backends.

Fixes b/132812775
Fixes flutter/flutter#35410
2019-08-13 14:53:19 -07:00
Yegor
708fc625d7
rename stub_ui to web_ui (#10776)
* rename stub_ui to web_ui

* update licenses
2019-08-09 11:11:20 -07:00
Dan Field
63b253d907
expose max depth on Window (#10414) 2019-08-02 20:37:24 -07:00