141 Commits

Author SHA1 Message Date
Dan Field
79c6ce19a1
Preserve safe area (#8848)
Preserve safe area on Window regardless of insets.
2019-05-31 09:24:38 -07:00
Chinmay Garde
37b367e4d2
Allow specifying both Dart and non-Dart fixtures in engine unit-tests. (#9113)
* Allow specifying both Dart and non-Dart fixtures in engine unittests.

This fixes numerous issues in the way in which fixtures were managed
in the engine unit-tests.

* Instead of only being able to specify Dart fixtures, unit-tests may specify
  non-Dart fixtures as well. These are simply copied over to the fixtures
  directory known to the unit-test at runtime.
* An issue where numerous Dart files could be given to the kernel snapshotter
  has been addressed. It was anticipated that such a (legal) invocation to the
  kernel snapshotter would produce a snapshot with the contents of all the Dart
  files added to the root library. This is incorrect and the behavior in this
  case is undefined.
* Dart files referenced by the main Dart file are correctly tracked via a
  depfile.
* The snapshotter arguments have been cleaned up to get rid of unused
  arguments (`—strong`) and  the use of the VM product mode argument has been
  corrected to no longer depend on the Flutter product mode.
2019-05-28 19:11:47 -07:00
Michael Klimushyn
14c82d9969
Only cache required frames (#8837)
Remove the extra `decodedCacheRatioCap` parameter, and the
`_frameBitmaps` member from `Codec`. This means that small looped images
will consume more CPU but prevents us from hitting OOM exceptions based
on trying to render multiple larger images.

Also switch to fDisposalMethod for caching frames.

Previously we looped over every single SkCodec::FrameInfo, tracked its
`fRequiredFrame`, and then saved any frames matching those indeces.
Doing this instead avoids that initialization loop and extra data
structure.
2019-05-13 11:18:20 -07:00
Kaushik Iska
e7e6689b7f
Expose API to decode images to specified dimensions (#8596)
* Dart side resize primitives exposed

* Write the codec side changes

* return un-scaled image if we can not allocate bitmap

* Format _instantiateImageCodec calls to be single lined

Move null check for size to be inner

* Address CR comments and make image resize dimensions container

* Round not trunc, also format

* Add tests, remove ImageResizeDims from api surface

* Make placeholder value public

* Make the api side changes

* Add a feature to resize pixels and also add tests

* Fix grammar and add more info
2019-05-08 13:57:35 -07:00
Dan Field
2b1f9925e4
new lints (#8849)
Dart lints added:
* Avoid optional new
* Avoid optional const
* Prefer single quotes
* Prefer default assignment `=`
2019-05-07 16:10:21 -07:00
liyuqian
50de4692a5
Check the matrix in pushTransform (#8758)
Fixes flutter/flutter#31650
2019-04-26 14:09:53 -07:00
Todd Volkert
0c9c293b56
Add Rect.fromCenter() constructor (#8716) 2019-04-25 14:40:29 -07:00
Dan Field
3e47b4bb39
Reland const Rect/RRect (#8695) 2019-04-23 11:21:03 -07:00
Dan Field
0523870e0b
Add tests from framework (#8692) 2019-04-22 16:39:00 -07:00
Dan Field
4f2fd84cbc
Revert Rect/RRect 64 bit (#8690)
* Revert "fix toString (#8688)"

This reverts commit 9fa7336784b56ef70fd3580ac54d2939d1faa5a0.

* Revert "Make Rect and RRect use 64 bit doubles, and make them const-able (#8565)"

This reverts commit c12315273f6344175dae748ec1f23e15b4e7d59e.
2019-04-22 15:45:59 -07:00
Dan Field
9fa7336784
fix toString (#8688) 2019-04-22 14:12:31 -07:00
Dan Field
c12315273f
Make Rect and RRect use 64 bit doubles, and make them const-able (#8565)
* Make Rect and RRect 64bit and const-able
2019-04-22 12:58:48 -07:00
Chinmay Garde
2e4f0a4a72
Put the testing lib in the flutter namespace. (#8661) 2019-04-20 20:42:46 -07:00
Chinmay Garde
1239df96aa
Allow native bindings in secondary isolates. (#8658)
The callbacks can be wired in via the Settings object. Both runtime and shell unit-tests have been patched to test this.
2019-04-19 17:36:36 -07:00
Chinmay Garde
c6400e2c25
Merge runtime lifecycle unittests into the base test target. (#8634)
`//flutter/runtime: runtime_lifecycle_unittests` was added because the these assumed that there was no VM already running in the process. Running other tests in the base target would mess up that assumption. Now that all test targets have been updated to make sure the VM instance does not leak, the tests in this target can be merged.

LUCI bots don’t need to be patched as these tests were only ever run on the trybots.
2019-04-18 12:15:45 -07:00
Chinmay Garde
f017fe74aa
Avoid manually shutting down engine managed isolates. (#8621)
These are now shutdown by the VM and cleanup waits for their shutdown.
2019-04-17 16:11:47 -07:00
stuartmorgan
4266f8583f
Add desktop shell unittests to test script (#8600)
Builds the unit test on all platforms, and adds them to the aggregate test script.
2019-04-16 22:37:39 -07:00
Kaushik Iska
7292d62ef8
Revert Versions API (#7828)
* Revert "Fix versions implementation (#7726)"

This reverts commit 3c38dd342f53d39603d1c5b138b5e4d36d93720f.

* Revert "Expose the Flutter engine, Dart and Skia versions to Dart. (#7634)"

This reverts commit b94e759b256819fb33cb9d2b41565fc137cac733.

* remove namespace shell stuff

* fix format

* fix licenses
2019-04-12 14:23:13 -07:00
Chinmay Garde
e356dbca2c
Merge flutter/synchronization contents into fml. (#8525)
When flutter/synchronization was first authored, we did not own fml (it was called fxl then). Now we do, so use a single spot for such utilities. The pipeline was meant to be a general purpose utility that was only ever used by the animator (it even has animator specific tracing), so move that to shell instead (where the animator resides).
2019-04-09 19:18:51 -07:00
Hugo
78bd318c96 Add Locale.toLanguageTag() (#8421)
Adds `Locale.toLanguageTag()`, which returns a valid Unicode Locale Identifier
using underscores as separator that can be reliably parsed.
2019-04-08 11:21:19 -07:00
Dan Field
e10d46421d
Improve path metrics tests and docs (#7851)
* Improve path metrics tests and docs
2019-04-05 13:58:46 -07:00
Chinmay Garde
7e38b0aa23
Revert "Revert "Separate the data required to bootstrap the VM into its own class. (#8397)" (#8406)" (#8414)
This reverts commit f7b4903d7c9913447af3aaebc4308d1a1e2a4dde.
2019-04-03 13:38:12 -07:00
Zachary Anderson
f7b4903d7c
Revert "Separate the data required to bootstrap the VM into its own class. (#8397)" (#8406)
This reverts commit c991647404f8117dab2ca4ed49aa3ba48a634240.
2019-04-02 09:12:56 -07:00
MH Johnson
3796d98918
[ui] Add null check in FontWeight.lerp (#8274)
* Add null check in FontWeight.lerp

* Add Unit tests for FontWeight.lerp
2019-04-01 21:56:19 -04:00
Chinmay Garde
c991647404
Separate the data required to bootstrap the VM into its own class. (#8397)
When attempting to shutdown and subsequently restart the VM, having the
VM own this data introduces lifecycle issues due to circular references.
2019-04-01 14:58:05 -07:00
Chinmay Garde
b75472c106
Add missing import to functional for Windows. (#8382) 2019-03-29 18:14:06 -07:00
Chinmay Garde
131cc625a1
Allow native entrypoint registration for runtime unittests. (#8379) 2019-03-29 17:53:49 -07:00
Chinmay Garde
972afdc92b
Allow running runtime_unittests in AOT mode. (#8375)
Previously, only the most basic tests were run in AOT mode.
2019-03-29 17:15:38 -07:00
Chinmay Garde
a1a2129bc4
GN Format all files in the engine. (#8369) 2019-03-29 12:44:57 -07:00
Chris Bracken
2098398e10
Cleanups to run_tests.sh script (#8337)
Bugfix:
* Use the `pub` from within the built Dart SDK (not whatever's on
  `$PATH`, if anything).

A few minor improvements:
* Allow running from below the src/ buildroot dir, as it's often
  convenient to work from within the flutter/engine git dir.
* Echo test name before running, for slightly better debuggability.
* Minor line-wrapping for readability.
2019-03-27 18:09:08 -07:00
Jonah Williams
146646d1b9
Correct greater than or equal logic in offset base (#8210) 2019-03-19 13:41:47 -07:00
Dan Field
571964e1d7
Allow exported __const on iOS (#8217) 2019-03-19 11:56:55 -07:00
liyuqian
0f19b2de06
Reland PerformanceOverlayLayer golden test (#8140)
This reverts commit f1f19bba8f0089490962316867bd222727510ac5.

Now we shouldn't break the engine build as https://chromium-review.googlesource.com/c/chromium/tools/build/+/1480746 is landed. The golden test is disabled by default and we'll enable it later in our recipe and test it in presubmit tests.
2019-03-12 14:10:11 -07:00
Chris Bracken
f1f19bba8f
Revert "Revert "Revert "Reland PerformanceOverlayLayer golden test (#7863)" (#7895)" (#7911)" (#7916)
This breaks the Linux build with:
```
[ RUN      ] PerformanceOverlayLayer.Gold
../../flutter/flow/layers/performance_overlay_layer_unittests.cc:70: Failure
Value of: golden_data != nullptr
  Actual: false
Expected: true
Golden file not found: "/b/s/w/ir/k/src/flutter/testing/resources"/performance_overlay_gold.png.
Please either set --golden-dir, or make sure that the unit test is run from the right directory (e.g., flutter/engine/src).
```

This reverts commit 3f0ce769e296b977cd0bcd8f4f7390f207ef50a8.
2019-02-21 17:04:34 -08:00
liyuqian
3f0ce769e2
Revert "Revert "Reland PerformanceOverlayLayer golden test (#7863)" (#7895)" (#7911)
This reverts commit 6d8bd99afb16f7a1ebb59a2657ec76802606a581.
2019-02-21 15:27:37 -08:00
Chris Bracken
6d8bd99afb
Revert "Reland PerformanceOverlayLayer golden test (#7863)" (#7895)
Reverting this broke the flow tests for the performance overlay:

```
../../flutter/flow/layers/performance_overlay_layer_unittests.cc:70: Failure
Value of: golden_data != nullptr
  Actual: false
Expected: true
```

This reverts commit 8427d73c8340c9e51492689ee66261a4a72cac9e.
2019-02-20 20:45:39 -08:00
Dan Field
39f7066b69
Test profile and release build and unit tests (#7880)
* Test profile build and unit tests

* update googletest, skip JIT tests on non-debug builds
2019-02-20 20:13:02 -08:00
liyuqian
8427d73c83
Reland PerformanceOverlayLayer golden test (#7863)
* Revert "Revert "Add mock capability to PerformanceOverlayLayer (#7537)" (#7765)"

This reverts commit 693645e4645001ae460d5794fa6f5c7066677955.

* Add command line args for golden dir and font file
2019-02-20 16:49:39 -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
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
Jason Simmons
0ca1d1f318
Remove the Dart JIT snapshot data from AOT builds of the embedder library (#7806)
Also extend the embedder unit tests to cover AOT execution
2019-02-15 09:43:23 -08:00
Dan Field
adf02abcd1
Allow specifying the buildtools path (#7815) 2019-02-13 15:16:49 -08:00
Dan Field
816921b9e4
Use newer Skia API for PathMeasure (#7809) 2019-02-13 11:15:19 -08:00
Dan Field
693645e464
Revert "Add mock capability to PerformanceOverlayLayer (#7537)" (#7765)
This reverts commit 5f3f3bd9839b0d4e185a13de05fc6b9a24e6067f.
2019-02-09 00:13:14 -08:00
liyuqian
5f3f3bd983
Add mock capability to PerformanceOverlayLayer (#7537)
So we can do golden test on PerformanceOverlay to avoid regression like
https://github.com/flutter/flutter/issues/26387
2019-02-08 14:47:22 -08:00
Dan Field
3c38dd342f
Fix versions implementation (#7726) 2019-02-07 08:53:31 -08:00
Matt Carroll
cc27cafb84
Implemented Dark Mode for Android (#25525) (#7488) 2019-02-04 19:30:15 -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
Jason Simmons
e7eb1c8bf6 Update the verify_exported script to include the symbols for ICU data (#7647) 2019-01-30 13:56:44 -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