139 Commits

Author SHA1 Message Date
Michael Klimushyn
3d8b9b1e9c Only cache required frames (flutter/engine#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
9421579df4 Expose API to decode images to specified dimensions (flutter/engine#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
c96714ac5d new lints (flutter/engine#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
41077726ae Check the matrix in pushTransform (flutter/engine#8758)
Fixes flutter/flutter#31650
2019-04-26 14:09:53 -07:00
Todd Volkert
9f70d84295 Add Rect.fromCenter() constructor (flutter/engine#8716) 2019-04-25 14:40:29 -07:00
Dan Field
cc68d41b6e Reland const Rect/RRect (flutter/engine#8695) 2019-04-23 11:21:03 -07:00
Dan Field
b3951b1d90 Add tests from framework (flutter/engine#8692) 2019-04-22 16:39:00 -07:00
Dan Field
e0283d92c7 Revert Rect/RRect 64 bit (flutter/engine#8690)
* Revert "fix toString (#8688)"

This reverts commit c9a0f50ecc62899952ff693ed67d022d510d9453.

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

This reverts commit d98c2e2df0427aad3bd824f41d804ccc56eee367.
2019-04-22 15:45:59 -07:00
Dan Field
c9a0f50ecc fix toString (flutter/engine#8688) 2019-04-22 14:12:31 -07:00
Dan Field
d98c2e2df0 Make Rect and RRect use 64 bit doubles, and make them const-able (flutter/engine#8565)
* Make Rect and RRect 64bit and const-able
2019-04-22 12:58:48 -07:00
Chinmay Garde
0b2269e30e Put the testing lib in the flutter namespace. (flutter/engine#8661) 2019-04-20 20:42:46 -07:00
Chinmay Garde
572b7b80fb Allow native bindings in secondary isolates. (flutter/engine#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
bc51cf62bb Merge runtime lifecycle unittests into the base test target. (flutter/engine#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
54927647c6 Avoid manually shutting down engine managed isolates. (flutter/engine#8621)
These are now shutdown by the VM and cleanup waits for their shutdown.
2019-04-17 16:11:47 -07:00
stuartmorgan
e722bba483 Add desktop shell unittests to test script (flutter/engine#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
f9648fe057 Revert Versions API (flutter/engine#7828)
* Revert "Fix versions implementation (#7726)"

This reverts commit 82b3db052387161a8eed5f98f08080f1a60b7dfb.

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

This reverts commit ec6f6c35b36548a2cf745c0a4b3cb8e5b6ee0e72.

* remove namespace shell stuff

* fix format

* fix licenses
2019-04-12 14:23:13 -07:00
Chinmay Garde
2b4e6ce82b Merge flutter/synchronization contents into fml. (flutter/engine#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
c80b91dcde Add Locale.toLanguageTag() (flutter/engine#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
812955c39d Improve path metrics tests and docs (flutter/engine#7851)
* Improve path metrics tests and docs
2019-04-05 13:58:46 -07:00
Chinmay Garde
736277e9c7 Revert "Revert "Separate the data required to bootstrap the VM into its own class. (#8397)" (#8406)" (flutter/engine#8414)
This reverts commit 8a0076fdddc96b4ec2fb67f45051aa490827fc02.
2019-04-03 13:38:12 -07:00
Zachary Anderson
8a0076fddd Revert "Separate the data required to bootstrap the VM into its own class. (#8397)" (flutter/engine#8406)
This reverts commit 38f5fc418a08ed43945ad21d19494d6b352e1443.
2019-04-02 09:12:56 -07:00
MH Johnson
dc2da3460f [ui] Add null check in FontWeight.lerp (flutter/engine#8274)
* Add null check in FontWeight.lerp

* Add Unit tests for FontWeight.lerp
2019-04-01 21:56:19 -04:00
Chinmay Garde
38f5fc418a Separate the data required to bootstrap the VM into its own class. (flutter/engine#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
2d22e77e37 Add missing import to functional for Windows. (flutter/engine#8382) 2019-03-29 18:14:06 -07:00
Chinmay Garde
18af29469e Allow native entrypoint registration for runtime unittests. (flutter/engine#8379) 2019-03-29 17:53:49 -07:00
Chinmay Garde
39fb01b459 Allow running runtime_unittests in AOT mode. (flutter/engine#8375)
Previously, only the most basic tests were run in AOT mode.
2019-03-29 17:15:38 -07:00
Chinmay Garde
1a7c5d7bf3 GN Format all files in the engine. (flutter/engine#8369) 2019-03-29 12:44:57 -07:00
Chris Bracken
6bde234915 Cleanups to run_tests.sh script (flutter/engine#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
b49939de1b Correct greater than or equal logic in offset base (flutter/engine#8210) 2019-03-19 13:41:47 -07:00
Dan Field
011838e2c8 Allow exported __const on iOS (flutter/engine#8217) 2019-03-19 11:56:55 -07:00
liyuqian
7ed28478d9 Reland PerformanceOverlayLayer golden test (flutter/engine#8140)
This reverts commit c416fe99ee0ddb464ca85c0b336d679ea626a03c.

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
c416fe99ee Revert "Revert "Revert "Reland PerformanceOverlayLayer golden test (#7863)" (#7895)" (#7911)" (flutter/engine#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 3534a2c4cdfa35f921e99466013c7c8b3f03a8c3.
2019-02-21 17:04:34 -08:00
liyuqian
3534a2c4cd Revert "Revert "Reland PerformanceOverlayLayer golden test (#7863)" (#7895)" (flutter/engine#7911)
This reverts commit def147d48ee538dd7bbf0d2f0323a5d90a3d872c.
2019-02-21 15:27:37 -08:00
Chris Bracken
def147d48e Revert "Reland PerformanceOverlayLayer golden test (#7863)" (flutter/engine#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 ad96de250ecc47a7c26134ad434150199539b00b.
2019-02-20 20:45:39 -08:00
Dan Field
53102bd3a2 Test profile and release build and unit tests (flutter/engine#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
ad96de250e Reland PerformanceOverlayLayer golden test (flutter/engine#7863)
* Revert "Revert "Add mock capability to PerformanceOverlayLayer (#7537)" (#7765)"

This reverts commit 284016b1e1d6e8badec99cbff907ddb900cd27c4.

* Add command line args for golden dir and font file
2019-02-20 16:49:39 -08:00
Dan Field
4206f443f7 Revert "Shut down and restart the Dart VM as needed. (#7832)" (flutter/engine#7877)
This reverts commit 75a66f31dc2a02ccb54f10fb4477233086f4906b.
2019-02-19 16:14:18 -08:00
Chinmay Garde
75a66f31dc Shut down and restart the Dart VM as needed. (flutter/engine#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
a0f4916009 Remove the Dart JIT snapshot data from AOT builds of the embedder library (flutter/engine#7806)
Also extend the embedder unit tests to cover AOT execution
2019-02-15 09:43:23 -08:00
Dan Field
76529a8ee7 Allow specifying the buildtools path (flutter/engine#7815) 2019-02-13 15:16:49 -08:00
Dan Field
49d5433fcd Use newer Skia API for PathMeasure (flutter/engine#7809) 2019-02-13 11:15:19 -08:00
Dan Field
284016b1e1 Revert "Add mock capability to PerformanceOverlayLayer (#7537)" (flutter/engine#7765)
This reverts commit a3b89e97a89a1c3bd725cf391ff7b6b0fe7e810b.
2019-02-09 00:13:14 -08:00
liyuqian
a3b89e97a8 Add mock capability to PerformanceOverlayLayer (flutter/engine#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
82b3db0523 Fix versions implementation (flutter/engine#7726) 2019-02-07 08:53:31 -08:00
Matt Carroll
e1aeaf5dd4 Implemented Dark Mode for Android (#25525) (flutter/engine#7488) 2019-02-04 19:30:15 -08:00
Kaushik Iska
ec6f6c35b3 Expose the Flutter engine, Dart and Skia versions to Dart. (flutter/engine#7634)
- Moved versions from shell to common
- versions singleton contains all the required versions.
2019-01-30 16:22:45 -08:00
Jason Simmons
5c988ece29 Update the verify_exported script to include the symbols for ICU data (flutter/engine#7647) 2019-01-30 13:56:44 -08:00
Dan Field
b934c0495e Improve PathMetrics (flutter/engine#7621)
* Improve PathMetrics

* Use index instead of dirty

* revert unintended change

* space
2019-01-29 12:40:48 -08:00
Brian Osman
3dd1198f0d Remove SkColorSpaceXformCanvas, use color-managed SkSurfaces instead (flutter/engine#7548)
Behavior (visual) changes should be very minor. Things that are to be expected:
* A few things were not color managed correctly by the transform canvas (color emoji, some color filters). Those will be handled correctly with the tagged surfaces (although we're always transforming to sRGB, so nothing should change until we target a wider gamut).
* Image filtering will happen in the source color space, rather than the destination. Very minor.
* The transform canvas did caching of images in the destination color space. Now, the conversion happens at draw time. If there are performance issues, images can be pre-converted to the destination with makeColorSpace().
2019-01-22 15:34:51 -05:00
Chris Bracken
01da26e047 Support custom kernel blob path in test fixtures (flutter/engine#7525)
Updates the test_fixtures rule to support a custom kernel output file
name. Improves rule documentation.
2019-01-22 11:35:34 -08:00