325 Commits

Author SHA1 Message Date
Kaushik Iska
f3f1b7c0b7 Revert "Remove one last final call to AddPart()" (flutter/engine#10440) 2019-08-02 09:18:17 -07:00
cfontas
d871e4da7f Remove one last final call to AddPart() (flutter/engine#10273)
* Remove one last final call to AddPart()

* fix merge conflict

* fix how i merged

* remove add part again

* remove pointer syntax

* fix formatting
2019-07-31 20:05:00 -07:00
David Worsham
6984916c0f [fuchsia] Remove extraneous ShapeNodes (flutter/engine#10150)
Test: Ran test programs on Fuchsia and dumped Scenic scene graph using
`fx shell cat /hub/c/scenic.cmx/*/out/debug/dump-scenes`
Inspected scene graph to confirm removal of ShapeNodes.
FL-284 #done
2019-07-31 02:22:01 -07:00
cfontas
a5a784d060 Remove Dead Scenic Clipping Code Path. (flutter/engine#10242)
Scenic has now fully transitioned to clipping by adding lists
of planes to Nodes; the old approach of adding a ShapeNode
"part" is now a no-op, and is safe to remove.
2019-07-30 14:19:32 -07:00
Dan Field
e38fb755f3 Let pushColorFilter accept all types of ColorFilters (flutter/engine#9641) 2019-07-10 12:06:58 -07:00
Chris Yang
c2916d93dc iOS platform view opacity (flutter/engine#9667) 2019-07-08 16:07:39 -07:00
liyuqian
160663387a Explain why OpacityLayer has an offset field (flutter/engine#9713)
According to the request by Amir and Chris.
2019-07-08 15:02:18 -07:00
Kaushik Iska
9815a20559 Raster now returns an enum rather than boolean (flutter/engine#9661)
This is part of a bigger change that will facilitate us
to act on this `RasterStatus`. The specific case is where
after pre-roll we might decide to want to merge the threads
and re-submit the frame -- `RasterStatus::kResubmit` can then
let us achieve this result.
2019-07-03 19:53:01 -07:00
Chris Yang
e5bc87a4cd Mutators Stack refactoring (flutter/engine#9663)
Rename methods in the MutatorsStack to Pascal case to match standard cpp style
Refactor the operator== for Mutator class
2019-07-03 11:18:14 -07:00
Kaushik Iska
3346b46ae7 ExternalViewEmbedder can CancelFrame after pre-roll (flutter/engine#9660)
* ExternalViewEmbedder can CancelFrame after pre-roll

- Resets the state so next pre-roll can be successful.
- Commit any pending `CATransaction` so we don't create
  nested transactions.

* Update flow/embedded_views.h
2019-07-03 08:38:19 -07:00
Kaushik Iska
4f307483d8 External view embedder can tell if embedded views have mutated (flutter/engine#9653)
* refactoring to move the mutator stack handling to preroll

* more review fixes

* Add support for external view embedded to know if it has changed

* remove the need to reset

* address comments

* Rename to HasPendingViewOperations
2019-07-03 07:28:53 -07:00
Chris Yang
cec3b15298 Move the mutators stack handling to preroll (flutter/engine#9651)
* refactoring to move the mutator stack handling to preroll

* more review fixes
2019-07-02 16:35:47 -07:00
Chris Yang
92ae45a714 make EmbeddedViewParams a unique ptr (flutter/engine#9640) 2019-07-02 13:27:12 -07:00
Chris Yang
102825d288 iOS PlatformView clip path (flutter/engine#9478) 2019-07-02 10:56:59 -07:00
Chinmay Garde
d90e42e020 Fix uninitialized variables and put tests in flutter namespace. (flutter/engine#9613)
Also enabled the tests previously disabled due to flakiness caused by these
uninitialized variables.

Fixes https://github.com/flutter/flutter/issues/35338
2019-06-29 21:05:42 -07:00
Chris Yang
ef172e2250 disable mysterious failing tests (flutter/engine#9608) 2019-06-29 12:38:49 -07:00
Chris Yang
bb909453ea Reland "IOS Platform view transform/clipping (#9075)" and fix the breakage. (flutter/engine#9483)
* Revert "Revert "IOS Platform view transform/clipping (#9075)" (#9480)"

This reverts commit 52ceaee505a26b6bad893e38b33c522d1e0ba571.

* fix fuschia buid
2019-06-25 15:29:47 -07:00
Chris Bracken
52ceaee505 Revert "IOS Platform view transform/clipping (#9075)" (flutter/engine#9480)
This reverts commit 5625d01b324f5a0d94aaa916d9e08fd038e363b3.

Seeing the following breakage on host build:
```
../../flutter/flow/scene_update_context.cc:205:36: error: non-const lvalue reference to type 'flutter::MutatorsStack' cannot bind to a value of unrelated type 'const flutter::Stopwatch'
                                   frame.context().raster_time(),
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../flutter/flow/scene_update_context.cc:207:36: error: no viable conversion from 'flutter::TextureRegistry' to 'const flutter::Stopwatch'
                                   frame.context().texture_registry(),
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../flutter/flow/instrumentation.h:55:32: note: candidate constructor not viable: no known conversion from 'flutter::TextureRegistry' to 'const flutter::Stopwatch &' for 1st argument
  FML_DISALLOW_COPY_AND_ASSIGN(Stopwatch);
                               ^
../../flutter/fml/macros.h:28:3: note: expanded from macro 'FML_DISALLOW_COPY_AND_ASSIGN'
  TypeName(const TypeName&) = delete;          \
  ^
../../flutter/flow/scene_update_context.cc:208:36: error: non-const lvalue reference to type 'flutter::TextureRegistry' cannot bind to a temporary of type 'flutter::RasterCache *'
                                   &frame.context().raster_cache(),
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../flutter/flow/scene_update_context.cc:209:36: error: cannot initialize a member subobject of type 'const flutter::RasterCache *' with an rvalue of type 'bool'
                                   false};
                                   ^~~~~
```
2019-06-25 10:48:37 -07:00
Chris Yang
5625d01b32 IOS Platform view transform/clipping (flutter/engine#9075) 2019-06-25 09:33:50 -07:00
Michael Klimushyn
7dad09a5d7 Clamp when overflowing z bounds (flutter/engine#9402) 2019-06-20 18:20:35 -07:00
Chinmay Garde
5f5821e8c1 Replace lock_guard with scoped_lock and use class template argument deduction. (flutter/engine#9338) 2019-06-17 10:08:45 -07:00
David Worsham
c913c07e29 [scene_host] Expose Opacity and remove ExportNode (flutter/engine#9297)
SCN-947 #comment
SCN-1291 #comment
2019-06-13 10:16:21 -07:00
liyuqian
4b958d852b Set identity instead of crash in opt build (flutter/engine#9262)
According to https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#expectations-around-potential-crashes-in-the-engine

This should address https://github.com/flutter/flutter/issues/31650#issuecomment-494935507

We'll instead use `FML_LOG(ERROR)` to report errors to our CI tests. See https://github.com/flutter/flutter/issues/34194
2019-06-13 09:35:54 -07:00
Zachary Anderson
35107c4dca Revert tracing changes (flutter/engine#9296)
* Revert "[fuchsia] Fix alignment of Fuchsia/non-Fuchsia tracing (#9289)"

This reverts commit e7d406fe36790b1a8161d4687a6a4a144ba44254.

* Revert "Align fuchsia and non-fuchsia tracing (#9199)"

This reverts commit 1ccb372e5f8ceaaf90f5b43b42df617d7f18d955.
2019-06-12 10:25:49 -07:00
liyuqian
43f4c1d3c7 Make flow layers' attributes immutable (flutter/engine#9176)
For https://github.com/flutter/flutter/issues/33807

We still need to make layers' children immutable for full immutability.
That will require us to change the SceneBuilder API to build the layer
bottom up instead of top down (post-order traversal instead of pre-order
traversal).
2019-06-10 13:09:37 -07:00
liyuqian
fb0ea0ef4c Add onReportTimings and FrameRasterizedCallback API (flutter/engine#8983)
Using it, a Flutter app can monitor missing frames in the release mode, and a custom Flutter runner (e.g., Fuchsia) can add a custom FrameRasterizedCallback.

Related issues:
https://github.com/flutter/flutter/issues/26154
https://github.com/flutter/flutter/issues/31444
https://github.com/flutter/flutter/issues/32447

Need review as soon as possible so we can merge this before the end of May to catch the milestone.

Tests added:
* NoNeedToReportTimingsByDefault
* NeedsReportTimingsIsSetWithCallback
* ReportTimingsIsCalled
* FrameRasterizedCallbackIsCalled
* FrameTimingSetsAndGetsProperly
* onReportTimings preserves callback zone
* FrameTiming.toString has the correct format

This will need a manual engine roll as the TestWindow defined in the framework needs to implement onReportTimings.
2019-06-06 10:42:48 -07:00
Dan Field
1ccb372e5f Align fuchsia and non-fuchsia tracing (flutter/engine#9199) 2019-06-05 15:14:27 -07:00
liyuqian
cb9441d98b Skip golden tests on non-Linux OSes (flutter/engine#9198) 2019-06-05 14:10:02 -07:00
Chinmay Garde
c1040567da Compile the physical_shape_layer_unittests.cc TU. (flutter/engine#9187)
This was incorrectly removed by my as I was reworking the GN rules for Fuchsia https://github.com/flutter/engine/pull/8869/files#diff-b6056f6ec9dff658c81f7711f6865e5eL739
2019-06-04 14:51:57 -07:00
Chris Yang
33d335d61e Do nothing if the params didn't change when compositing iOS platform views. (flutter/engine#8999) 2019-06-03 13:08:29 -07:00
Chinmay Garde
cb00aac583 Allow specifying both Dart and non-Dart fixtures in engine unit-tests. (flutter/engine#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
b000f9830c Rename frame_time and engine_time (flutter/engine#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
ead69ba45a Replace Skia font macros with enums. (flutter/engine#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
56e7bf84b1 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
41077726ae Check the matrix in pushTransform (flutter/engine#8758)
Fixes flutter/flutter#31650
2019-04-26 14:09:53 -07:00
David Worsham
e35ce68264 [scenic] Purge references to Mozart (flutter/engine#8712)
We also rename all MZ-* bugs to SCN-*.

SCN-580 #comment
2019-04-24 12:26:25 -07:00
liyuqian
39e920cd1a Document that OpacityLayer's children are nonempty (flutter/engine#8707)
See https://github.com/flutter/flutter/issues/31517
2019-04-23 15:02:57 -07:00
Matthew Dempsky
2107712b0f Replace ThreadLocal with ThreadLocalUniquePtr<T> (flutter/engine#8659)
Fixes https://github.com/flutter/flutter/issues/31292.
2019-04-19 17:33:46 -07:00
liyuqian
452e630ee2 Generate layer unique id for raster cache key (flutter/engine#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
9607d1257d Reland elevation test (flutter/engine#8633)
Reland "Add a unit test for PhysicalShapeLayer (#8616)"

This reverts commit 3e1caa0959c5d9f673b2d7c7ed0d9befb1b42353.

The only change is the namespace.
2019-04-18 10:56:24 -07:00
Chinmay Garde
3e1caa0959 Revert "Add a unit test for PhysicalShapeLayer (#8616)" (flutter/engine#8627)
This reverts commit 6f4740c28475c294821aa9229c15f367bb90fa6a.
2019-04-17 17:47:58 -07:00
liyuqian
6f4740c284 Add a unit test for PhysicalShapeLayer (flutter/engine#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
27e4dac06b Rename flow namespace to flutter (flutter/engine#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
3d998a667a Remove call to SkFont::setLinearMetrics (flutter/engine#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
aa883ac3f8 [fuchsia] Fix SceneUpdateContext for new PaintContext field (flutter/engine#8608) 2019-04-17 09:58:58 -07:00
Michael Klimushyn
5df695efdf Pipe Z bounds from ViewportMetrics to Flow (flutter/engine#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
6a28ed4830 Check that TransformLayer has a finite matrix (flutter/engine#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
500f19660d Composite Embedded Views with the correct GrContext
PaintRecorder Canvases are not associated with GrContexts.
2019-04-16 14:13:34 -07:00
Jason Simmons
5be5c16460 Redo a fix for cull rect calculation on TransformLayers with a perspective transform (flutter/engine#8528)
This was originally implemented in 6eab9d08be
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
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