296 Commits

Author SHA1 Message Date
Chris Yang
2fcd4e799b
Do nothing if the params didn't change when compositing iOS platform views. (#8999) 2019-06-03 13:08:29 -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
liyuqian
d0dc9b94d4
Rename frame_time and engine_time (#8952)
At a quick glance, one could easily think of the "engine_time" as the
GPU thread time and the "frame_time" as the UI thread time because the
GPU thread time is mainly spent on the engine while the UI thread time
is mainly spent on the Dart framework to generate the frame.

But it's actually the other way. The "engine_time" is UI thread time and
the "frame_time" is the GPU thread time.

To avoid the confusion, rename them to "ui_time" and "raster_time"
respectively. I avoided the "gpu_time" because the rasterization may be
purely on a CPU backed software Skia backend.
2019-05-14 14:29:27 -07:00
bungeman
f4d23ef694 Replace Skia font macros with enums. (#8920)
This mechanically replaces kXXX_SkTextEncoding with SkTextEncoding::kXXX
and kXXX_SkFontHinting with SkFontHinting::kXXX. This will allow Skia to
remove these old macro constants and get everyone on the new enums.
2019-05-13 11:11:49 -07:00
Chinmay Garde
f6e6d39860
Wire up Fuchsia SDK related updated for shell dependencies. #8869
This does not actually import the runners into the engine. It only sets up the targets so they need no modifications are necessary when the migration is done. The engine has been verified to build in both buildroots.
2019-05-06 18:01:59 -07:00
liyuqian
50de4692a5
Check the matrix in pushTransform (#8758)
Fixes flutter/flutter#31650
2019-04-26 14:09:53 -07:00
David Worsham
a56aa95e80
[scenic] Purge references to Mozart (#8712)
We also rename all MZ-* bugs to SCN-*.

SCN-580 #comment
2019-04-24 12:26:25 -07:00
liyuqian
7c8ec376ff
Document that OpacityLayer's children are nonempty (#8707)
See https://github.com/flutter/flutter/issues/31517
2019-04-23 15:02:57 -07:00
Matthew Dempsky
b0cbce4175 Replace ThreadLocal with ThreadLocalUniquePtr<T> (#8659)
Fixes https://github.com/flutter/flutter/issues/31292.
2019-04-19 17:33:46 -07:00
liyuqian
d79eb2857d
Generate layer unique id for raster cache key (#8637)
The raw pointer isn't a reliable id as the allocator can reuse an
address that's just been released for another layer.

This will fix Fuchsia bug FL-216.

This problem was not affecting non-Fuchsia Flutter probably because
non-Fuchsia Flutter purges the raster cache key much more frequently so
we won't see a key collision. In Fuchsia, as the key has to wait for the
Vulkan surface to render asynchronously, this suddenly becomes an issue.
2019-04-18 14:14:06 -07:00
liyuqian
edef8bb8b3
Reland elevation test (#8633)
Reland "Add a unit test for PhysicalShapeLayer (#8616)"

This reverts commit 91b71070f55ffc38c432babc7d9bb68ac2720d8d.

The only change is the namespace.
2019-04-18 10:56:24 -07:00
Chinmay Garde
91b71070f5
Revert "Add a unit test for PhysicalShapeLayer (#8616)" (#8627)
This reverts commit 8b667b0178f135411ad72d7e5b3304cc46ff7dcf.
2019-04-17 17:47:58 -07:00
liyuqian
8b667b0178
Add a unit test for PhysicalShapeLayer (#8616)
An unnecessary PrerollContext copy is also removed. The added unit test will catch the error if we forget to subtract the elevation after the copy removal.

This change has been tested with the framework (`flutter test --local-engine=host_debug_unopt`).
2019-04-17 17:34:11 -07:00
liyuqian
8ff631f3df
Rename flow namespace to flutter (#8615)
This follows our namespace change from shell to flutter: https://github.com/flutter/engine/pull/8520.
2019-04-17 14:38:45 -07:00
bungeman
c5d1ba916c Remove call to SkFont::setLinearMetrics (#8612)
This particular call doesn't do anything since the default is false
anyway. In addition Skia is looking to remove this flag since setting it
to true is now synonymous with setting the hinting to none.
2019-04-17 15:13:19 -04:00
Zachary Anderson
dd9dcaf9a5
[fuchsia] Fix SceneUpdateContext for new PaintContext field (#8608) 2019-04-17 09:58:58 -07:00
Michael Klimushyn
0e27e0fc38
Pipe Z bounds from ViewportMetrics to Flow (#8583)
This is the first step in making Flutter aware of and responsive to Z
bound overflow. On its own this patch shouldn't result in any changes in
behavior. This will need to be followed up with a patch in Fuchsia's
Flutter runner to set the Z bounds after this lands, and another patch
in the engine actually implementing the desired overflow behavior.

This Z bound info is routed through the engine itself to make sure the
bounds in flow are truly consistent from the Fuchsia runner. However
these values should eventually be exposed to the framework as well.
2019-04-17 09:56:46 -07:00
liyuqian
3b016106c7
Check that TransformLayer has a finite matrix (#8585)
To catch issues like https://github.com/flutter/flutter/issues/30586

https://github.com/flutter/flutter/pull/31097 will trigger this CHECK
if https://github.com/flutter/engine/pull/8467 were reverted and the
transform_ were not initialized in this PR.
2019-04-16 20:36:25 -07:00
Qxyat
28a46d51a0 Composite Embedded Views with the correct GrContext
PaintRecorder Canvases are not associated with GrContexts.
2019-04-16 14:13:34 -07:00
Jason Simmons
36d2135ad0
Redo a fix for cull rect calculation on TransformLayers with a perspective transform (#8528)
This was originally implemented in d217a95126
but was not retained when cull rects were removed from the SceneBuilder.

Fixes https://github.com/flutter/flutter/issues/30819
2019-04-10 13:00:05 -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
reed-at-google
df707c6f1f
switch to newer APIs for shaders and filters (#8511)
* switch to newer APIs for shaders and filters

* fix formatting
2019-04-09 11:00:36 -04:00
freiling
c7b138d82d
[scenic][SCN-1054] remove dangling uses of SetTranslationRH (#8503)
Looks like someone added a new use of the method while I was waiting for flutter
to roll. nuking the last instance so i can move forward with deprecating and
removing it.
2019-04-08 16:32:26 -07:00
Brian Osman
a6b8e70ad5
Remove unused variable (#8490) 2019-04-08 11:02:11 -04:00
David Worsham
ff1bcdc009
Add Views V2 support for Fuchsia (#8115) 2019-04-07 01:18:59 -07:00
liyuqian
0c2a2c1c44
Initialize OpacityLayer's matrix to identity (#8467)
Should have https://github.com/flutter/flutter/issues/30586 fixed once the engine rolls.
2019-04-05 18:34:05 -07:00
reed-at-google
5944867cab
update to use SkTileMode (#8439) 2019-04-04 08:41:49 -04:00
liyuqian
9d7167516e
Ensure OpacityLayer to have a single child (#8362)
It ensures that every OpacityLayer can be optimized by retained
rendering.

Tested with `flutter test --local-engine=host_debug_unopt` in
flutter/flutter/packages/flutter.

Related issues: #21756 #23535
2019-03-29 17:58:30 -07:00
Chinmay Garde
a1a2129bc4
GN Format all files in the engine. (#8369) 2019-03-29 12:44:57 -07:00
liyuqian
96c9751638
Rename threshold to access_threshold (#8354) 2019-03-28 14:37:00 -07:00
Michael Klimushyn
602b612135
Reduce z-fighting on Scenic (#8318)
Previously the engine was creating multiple `ShapeNode`s all underneath
the same root `EntityNode` at local space z=0. This caused frequent
z-fighting within Flutter layers.

This patch updates the engine to only create one ShapeNode per
EntityNode, which fixes the z-fighting independent of layer elevation.
Z-fighting is still possible from actually setting multiple layers to
the same z in world space using Flutter elevation.

flutter/flutter#25226
2019-03-28 14:05:37 -07:00
freiling
b404c69fdb
[scenic][SCN-1054] Move back off of SetTranslationRH (#8174)
The behavior of SetTranslation() is now in its final state so we can migrate
back off the temporary function.
2019-03-18 16:33:57 -07:00
liyuqian
5088735e5f
Clip to clip_rect instead of paint bounds (#8183)
Otherwise, we'll have issues such as https://github.com/flutter/flutter/issues/29070

The engine roll that includes this PR needs a tiny golden image update. Will do a manual roll.
2019-03-18 12:43:41 -07:00
P.Y. Laligand
c033aa4696
Fix include of libzx. (#8181) 2019-03-15 13:58:25 -07:00
Kaushik Iska
cad97fe746
Update overlays_gr_context_ correctly (#8175)
There can be cases where SubmitFrame gets called
before overlays are a part of the frame, in these
cases, we should not update the GRContext ahead of time.

This commit makes it so we will update it only when
the frame really shows the overlay.

This addresses: https://github.com/flutter/flutter/issues/28920
2019-03-15 08:35:48 -07:00
Dan Field
fdad56f5fb
Anti-Aliasing for shape layers (#8157) 2019-03-13 14:26:42 -07:00
Chinmay Garde
906d684a77
Reland ""Add support for trace counters with variable arguments and instrument the raster cache." (#8145)
This reverts commit bc901324faf5a24f9220cc7ecbcf5b97b96ae09f and fixes the
discovered on Windows builds.
2019-03-13 13:53:22 -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
Chinmay Garde
bc901324fa
Revert "Add support for trace counters with variable arguments and instrument the raster cache. (#8094)" (#8122)
This reverts commit 2a0d3542851ae59c2d2f490d1111eeb57b0da388.
2019-03-11 15:09:24 -07:00
Chinmay Garde
2a0d354285
Add support for trace counters with variable arguments and instrument the raster cache. (#8094) 2019-03-11 14:44:43 -07:00
liyuqian
56d8634c51
Improve shadow doc in PhysicalShapeLayer (#8114)
The old x is confusing as it often refers to x-axis in 2D graphics.
Replace it with t which has a nice interpretation of tangent.
2019-03-11 14:30:07 -07:00
Dan Field
b30f9897b9
Improve elevation bounds for physical shape layers (#8044)
* improve elevation bounds calculation and add diagram
2019-03-05 16:32:22 -08:00
liyuqian
e2a449a519
Move canvas clear after preroll (#7923)
This will reduce 1 render target switch when preroll paints some raster
cache.
2019-02-22 12:48:04 -08: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
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
liyuqian
ed3123dff0
Reland "Lower the threshold to raster cache pictures (#7687)" (#7862)
This reverts commit 68d9ac44ec530a22beda85fcdf01871770a710d7.

https://github.com/flutter/engine/pull/7759 has landed without any
unexpected regressions. Hence we'll reland this as planned.
2019-02-19 14:46:42 -08:00
freiling
f37b09a11b [fuchsia][SCN-1054] Map elevation onto -Z in Scenic (#7834)
Note: the SetTranslationRH function is temporary and part of the smooth
transition plan for Scenics handedness inversion. See SCN-1054 for details.

We will follow this will a change to migrate back off SetTranslationRH
Submit after https://fuchsia-review.googlesource.com/c/fuchsia/+/255056
lands in fuchsia.git
2019-02-15 15:32:56 -08:00
Josh Gargus
347d690b29
Add support for new Scenic clip planes. (#7804)
Uses SetClipPlanesCmd in addition to the old clipping approach.
Flutter will use both clipping methods during a transition period
(Scenic will select internally which one to use).
2019-02-12 18:33:14 -08:00