533 Commits

Author SHA1 Message Date
Dan Field
93eeb48bae
Revert "Revert "Remove unnecessary entry-point closurization. (#7827)" (#7876)" (#7904)
This reverts commit f45572e95f93edb89b6750a4f36ad8ed7c0a2560.
2019-02-21 10:57:31 -08:00
Chris Bracken
abe9826a9d
Add accessibility semantics support to embedder (#7891)
Flutter's accessibility APIs consist of three main calls from the
embedder to the Dart application:

  1. FlutterEngineUpdateSemanticsEnabled: enables/disables semantics support.

  2. FlutterEngineUpdateAccessibilityFeatures: sets embedder-specific
     accessibility features.

  3. FlutterEngineDispatchSemanticsAction: dispatches an action (tap,
     long-press, scroll, etc.) to a semantics node.

and two main callbacks triggered by Dart code:

  1. FlutterUpdateSemanticsNodeCallback: notifies the embedder of
     updates to the properties of a given semantics node.

  2. FlutterUpdateSemanticsCustomActionCallback: notifies the embedder
     of updates to custom semantics actions registered in Dart code.

In the Flutter framework, when accessibility is first enabled, the
embedder will receive a stream of update callbacks notifying the
embedder of the full semantics tree. On further changes in the Dart
application, only updates will be sent.
2019-02-20 18:59:29 -08:00
Chris Bracken
dad6ec01c3
Correct onAccessibilityFeaturesChanged docs (#7883)
Reference to `accessibilityFlags` corrected to `accessibilityFeatures`.
2019-02-20 08:53:12 -08:00
Chris Bracken
a150cc125a
Fix minor typos in accessibility action docs (#7882)
Fixes a minor pluralisation error in docs for didGainAccessibilityFocus,
didLoseAccessibilityFocus.
2019-02-19 23:27:37 -08:00
Dan Field
f45572e95f
Revert "Remove unnecessary entry-point closurization. (#7827)" (#7876)
This reverts commit 3a1b9b3d85cc5521b8da85a019cb260e27c6576b.
2019-02-19 16:14:31 -08:00
Dan Field
572fea361c
Revert "Shut down and restart the Dart VM as needed. (#7832)" (#7877)
This reverts commit 0d6ff1669c4a765774b91e37353b4392408d112a.
2019-02-19 16:14:18 -08:00
sjindel-google
3a1b9b3d85
Remove unnecessary entry-point closurization. (#7827) 2019-02-18 14:23:17 +01:00
Chinmay Garde
0d6ff1669c
Shut down and restart the Dart VM as needed. (#7832)
The shell was already designed to cleanly shut down the VM but it couldnt
earlier as |Dart_Initialize| could never be called after a |Dart_Cleanup|. This
meant that shutting down an engine instance could not shut down the VM to save
memory because newly created engines in the process after that point couldn't
restart the VM. There can only be one VM running in a process at a time.

This patch separate the previous DartVM object into one that references a
running instance of the DartVM and a set of immutable dependencies that
components can reference even as the VM is shutting down.

Unit tests have been added to assert that non-overlapping engine launches use
difference VM instances.
2019-02-15 14:16:17 -08:00
Dan Field
f519aedb95
Fix typo in painting.dart (#7814) 2019-02-13 15:14:10 -08:00
Dan Field
816921b9e4
Use newer Skia API for PathMeasure (#7809) 2019-02-13 11:15:19 -08:00
Brian Osman
7c702404b8
Create mipmaps for images when uploading them on the IO thread (#7751)
This does several things:
- It adds CPU time on the IO thread, but avoids GPU time on the GPU
  thread.
- For images that are never drawn with mipmaps, it adds about 33%
  memory overhead. For images that are drawn with mipmaps, it saves
  an entire copy of the base level.
- It fixes https://github.com/flutter/flutter/issues/24517, which is
  a driver bug related to mip-mapping and cross-context images.

Overall, I think the tradeoff is good, but I'm curious to see what
benchmarks look like.
2019-02-08 15:12:29 -05:00
Michael Klimushyn
b0370c13c3
Decode using the last cached required frame (#7715)
`MultiFrameCodec` now uses whatever previously cached required frame is
available instead of panicking if it doesn't have the exact frame
requested by `SkCodec::FrameInfo#fRequiredFrame`.

`SkCodec::FrameInfo#fRequiredFrame` doesn't point to the one and only
frame that's required to decode the given frame. It points to the latest
frame that's disposal method none and filling a greater surface area
than the current frame. The last required frame `MultiFrameCodec` has
actually cached is also valid in these cases and can be supplied as
`fPriorFrame` instead. [flutter/flutter#26757](https://github.com/flutter/flutter/issues/26757#issuecomment-459522530)
has a more detailed explanation.

Fixes flutter/flutter#26757
2019-02-07 14:47:23 -08:00
Dan Field
3c38dd342f
Fix versions implementation (#7726) 2019-02-07 08:53:31 -08:00
Chinmay Garde
6585f334a1
Allow all entrypoints support by the command line VM. (#7717) 2019-02-06 15:29:19 -08:00
Matt Carroll
cc27cafb84
Implemented Dark Mode for Android (#25525) (#7488) 2019-02-04 19:30:15 -08:00
Matt Carroll
194608290e
Move Brightness definition to dart:ui (#27479) (#7678) 2019-02-04 13:29:53 -08:00
Kaushik Iska
b94e759b25
Expose the Flutter engine, Dart and Skia versions to Dart. (#7634)
- Moved versions from shell to common
- versions singleton contains all the required versions.
2019-01-30 16:22:45 -08:00
Gary Qian
2c610bfec6
Fix dynamic array -> vector (#7645) 2019-01-30 13:03:27 -08:00
Gary Qian
c92df428ef
Strut implementation (#7414)
Engine half of flutter/flutter#26332
2019-01-30 10:16:37 -08:00
Dan Field
78e145d056
Improve PathMetrics (#7621)
* Improve PathMetrics

* Use index instead of dirty

* revert unintended change

* space
2019-01-29 12:40:48 -08:00
Chinmay Garde
23b7e29f04
Re-land "Wrap the user entrypoint function in a zone with native exception callback. (#7512)" (#7551)
This reverts commit 4c135c298a8173bb9affafc1f92120a0158c1e6e and applies relevant fixes.
2019-01-24 13:42:51 -08:00
Vyacheslav Egorov
4c135c298a
Revert "Wrap the user entrypoint function in a zone with native exception callback. (#7512)" (#7522)
This reverts commit 25559ed0779604d56c47c5d2341ffd16b137cd10.

Reason for revert: broken in AOT mode.

@pragma('vm:entry-point') placed on a function only instructs
the compiler to retain the function itself, but does not tell
compiler to generate and retain tear-off for this function.

In this PR _runMainZoned was marked as an entry-point but C++
code was trying to tear it off and use a closure, instead of
invoking it directly, which is not supported.
2019-01-17 11:49:20 +01:00
Chinmay Garde
25559ed077
Wrap the user entrypoint function in a zone with native exception callback. (#7512) 2019-01-16 16:08:51 -08:00
Michael Goderbauer
6c68bf3caf
Revert "Revert "Add elevation and thickness to SemanticsNode (#7282)" (#7483)" (#7484)
This reverts commit 24cf93e2555da5f0b464b55c43fe4b1a7dd06eed.
2019-01-15 18:56:21 -08:00
Jason Simmons
3b13c4a9c1
Execute Picture.toImage on the current thread in the test environment (#7485) 2019-01-15 12:02:29 -08:00
Michael Goderbauer
24cf93e255
Revert "Add elevation and thickness to SemanticsNode (#7282)" (#7483)
This reverts commit 6c29fb4d5eeeba8aee7c484de185bf1d3679042a.
2019-01-15 10:45:49 -08:00
Michael Goderbauer
6c29fb4d5e
Add elevation and thickness to SemanticsNode (#7282) 2019-01-15 09:59:44 -08:00
Dan Field
43fa420b04
Make IOManager own resource context (#7272)
* Make IOManager own resource context
2019-01-14 13:46:38 -08:00
Ian Hickson
3996efb22b
[HR] Documentation cleanup (#7370)
* Documentation cleanup

* Typo fix
2019-01-14 12:46:32 -08:00
Razvan Lung
2820157751 add ColorFilter matrix support (#7459)
* add ColorFilter matrix support
2019-01-14 10:45:06 -08:00
Jason Simmons
82097a4268
Move Picture.toImage rasterization to the GPU thread (#7442)
Reuses the implementation that was previously done for Scene.toImage
(see 20c805c973)

This introduces a breaking API change:
Picture.toImage is now asynchronous and returns a Future<Image>

Fixes https://github.com/flutter/flutter/issues/23621
2019-01-14 09:39:03 -08:00
Dan Field
6179ac6377
fix up analysis for Dart in Engine (#7404)
* fix up analysis for Dart in Engine, particularly for tests
2019-01-11 13:50:58 -08:00
Jason Simmons
cd98f6bdb5
Clear the font collection's cache when a font is dynamically loaded (#7436)
Fixes https://github.com/flutter/flutter/issues/26293
2019-01-10 11:26:49 -08:00
liyuqian
dea6a08499
Remove legacy and deprecated defaultClipBehavior (#7439)
The defaultClipBehavior is no longer used anywhere in the Flutter framework and Google3.
2019-01-11 02:31:15 +08:00
Justin McCandless
39a99b0050
Docs improvements per @Hixie's comments (#7387) 2019-01-10 07:46:50 +08:00
Jonah Williams
42f449fa47
remove deprecated updateNode argument (#7413) 2019-01-08 16:39:38 -08:00
Dan Field
937ee8bf9d
Cleanup dead code (#7409)
* Remove unused files
2019-01-08 12:21:25 -08:00
Dan Field
5965f9084b
Make ParagraphConstraints have const constructor (#7346) 2019-01-07 08:51:47 -08:00
Ben Konyi
b35f021a8e
Update GetCallbackHandle to use Dart_IsTearOff instead of a string comparison (#7324)
* Update GetCallbackHandle to use Dart_IsTearOff instead of a string
comparison to determine whether or not a closure was provided as an
argument to PluginUtilities.GetCallbackHandle.

Fixes #24394
2019-01-04 14:41:56 -08:00
liyuqian
e52287a1b5
Fix typo clas -> class (#7360) 2019-01-03 10:06:17 -08:00
Michael Klimushyn
770536ab6c
Only overflow the cache for one required frame (#7048)
Previously codec.cc needed all required frames to already be decoded
before it could decode any of their dependent frames. To accomplish this
it would always cache required frames, regardless of cache limit.

However both GIF and WEBP (the only currently supported animated image
formats) only allow the image to depend on one decoded frame at a time.
This means that there's no reason to cache all the required frames since
it's only valid for the image formats to require one previously decoded
frame at a time. (For example, frame 10 and frame 11 in a hypothetical
animated image could all depend on frame 9. But no subsequent frame
after frame 9 could depend on frames 0-8.)

Frames are always added to the cache as long as they're under the limit,
and never removed. Required frames are always stored as a separate
member on `MultiFrameCodec`.

Warning: this logic will break if we decide to support more animated
formats in the future.

Fixes flutter/flutter#24835.
2018-12-21 16:55:54 -08:00
Gary Qian
215ca15600
Support user-provided font-fallback. (#7241)
* Support user-provided font-fallback.

* Use tonic to pass to native

* Handle font families as a fallback vector in LibTxt

* Fix docs

* Concatentate fontFamily lists in dart before passing to engine

* Fix formatting

* Reworked font family matching to search all managers

* Fix formatting

* Proper toString null checking to keep format consistent

* Formatting

* Move _listEquals out of textstyle as it is not specific to TextStyle and will later be used for paragraphStyle too
2018-12-21 15:07:47 -08:00
Justin McCandless
8532868d8b
Address some comments on previous doc improvement PR (#7274) 2018-12-21 10:46:11 -08:00
Stanislav Baranov
ead76a4db8
Remove unused native function dumpCopmpilationTrace(). (#7276)
Framework has stopped using it as of https://github.com/flutter/flutter/pull/25594.
2018-12-20 16:32:40 -08:00
Justin McCandless
cc51731d82
Clarify TextAffinity docs (#7238)
* Clarify TextAffinity docs

* Clarify TextPosition and the definition of upstream/downstream

* Docs fixes from code review, less redundant with 'string in code'
2018-12-20 14:14:04 -08:00
Stanislav Baranov
e859296b71
Document native functions for compilation trace (#7256) 2018-12-20 11:48:59 -08:00
Chris Bracken
8939e2abeb
Fix a misspelling (#7234)
Change funciton to function in a doc comment.
2018-12-18 20:08:46 -08:00
liyuqian
ba117366ef
Compute cull_rect and optimize in Layer::Preroll (#6923)
This PR replaces the unused `PrerollContext::child_paint_bounds` with `PrerollContext::cull_rect` so we can prune unnecessary preroll tasks (especially cache) based on clips. This PR fixes https://github.com/flutter/flutter/issues/24712

Performance test has been added (https://github.com/flutter/flutter/pull/25381) to make sure that we won't regress again in the future.

Note that the cull_rect here is very similar to those removed in https://github.com/flutter/engine/pull/6352 .     We can't compute cull rects in SceneBuilder because of retained layers. But we can still compute and use them to optimize performance in Preroll.
2018-12-18 09:54:52 -08:00
Jimmy Casey
f986a12e20 Correct spelling in doc comments (#7179)
Applies spelling corrections to accessibility-related doc comments and in the
license tool.
2018-12-16 12:51:00 -08:00
Ian Hickson
17789249d7
Offset.fromDirection and Size.aspectRatio (#6805) 2018-12-15 08:31:59 -08:00