Commit Graph

28 Commits

Author SHA1 Message Date
gaaclarke 89e395853c Refactor to passing functions by const ref (#13975)
Moved our code to passing functions by const ref
2019-11-22 12:20:02 -08:00
Michael Klimushyn 8a99d10748 Turn on RasterCache based on view hierarchy (#13762)
This is a duplicate of flutter/engine#13360 with the test switched to use the software backend instead of the GL backend.

After some debugging and testing on another GL embedder I think the issue with the test is some bug having to do with the GL implementation in the test harness specifically. 

Fixes flutter/flutter#38903
2019-11-08 17:14:50 -08:00
Michael Klimushyn e609577d12 Revert "Turn on RasterCache based on view hierarchy (#13360)" (#13442)
This caused EmbedderTest.VerifyB143464703 to fail after merging into
master.

```
../../flutter/shell/platform/embedder/tests/embedder_unittests.cc:3111: Failure
Value of: ImageMatchesFixture("verifyb143464703.png", renderered_scene)
  Actual: false
Expected: true
[  FAILED  ] EmbedderTest.VerifyB143464703 (2507 ms)
```

This reverts commit 3ad3bc76a5.
2019-10-30 11:25:29 -07:00
Michael Klimushyn 3ad3bc76a5 Turn on RasterCache based on view hierarchy (#13360)
Previously the cache was disabled on whether or not PlatformViews were
globally enabled. Instead track their existence in the view hierarchy
and only disable RasterCache if a PlatformView is actually present.
2019-10-30 10:45:15 -07:00
Chinmay Garde bf81971f7a Allow embedders to specify a render task runner description. (#13124)
Embedders may use this to specify a thread whose event loop is managed by them
instead of the engine. In addition, specifying the same task runner for both
the platform and render task runners allows embedders to effectively perform
GPU rendering operations on the platform thread.

To affect this change, the following non breaking changes to the API have been
made:

* The `FlutterCustomTaskRunners` struct now has a new field `render_task_runner`
  for the specification of a custom render task runner.
* The `FlutterTaskRunnerDescription` has a new field `identifier`. Embedders
  must supply a unique identifier for each task runner they specify. In
  addition, when describing multiple task runners that run their tasks on the
  same thread, their identifiers must match.
* The embedder may need to process tasks during `FlutterEngineRun` and
  `FlutterEngineShutdown`. However, the embedder doesn't have the Flutter engine
  handle before `FlutterEngineRun` and is supposed to relinquish handle right
  before `FlutterEngineShutdown`. Since the embedder needs the Flutter engine
  handle to service tasks on other threads while these calls are underway,
  there exist opportunities for deadlock. To work around this scenario, three
  new calls have been added that allow more deliberate management of the Flutter
  engine instance.
  * `FlutterEngineRun` can be replaced with `FlutterEngineInitialize` and
    `FlutterEngineRunInitialized`. The embedder can obtain a handle to the
    engine after the first call but the engine will not post any tasks to custom
    task runners specified by the embedder till the
    `FlutterEngineRunInitialized` call. Embedders can guard the Flutter engine
    handle behind a mutex for safe task runner interop.
  * `FlutterEngineShutdown` can be preceded by the `FlutterEngineDeinitialize`
    call. After this call the Flutter engine will no longer post tasks onto
    embedder managed task runners. It is still embedder responsibility to
    collect the Flutter engine handle via `FlutterEngineShutdown`.
* To maintain backwards compatibility with the old APIs, `FlutterEngineRun` is
  now just a convenience for `FlutterEngineInitialize` and
  `FlutterEngineRunInitilaized`. `FlutterEngineShutdown` now implicitly calls
  `FlutterEngineDeinitialize` as well. This allows existing users who don't care
  are custom task runner interop to keep using the old APIs.
* Adds complete test coverage for both old and new paths.

Fixes https://github.com/flutter/flutter/issues/42460
Prerequisite for https://github.com/flutter/flutter/issues/17579
2019-10-15 14:26:31 -07:00
chunhtai aadd5a346b Add system font change listener for windows (#12276)
* Add windows font change logic

* update

* fix comment
2019-09-23 13:23:46 -07:00
Dan Field ed8e35c4cf Remove get engine (#9747) 2019-07-30 17:11:04 -07:00
Chinmay Garde b84f89b44b Allow embedders to add callbacks for responses to platform messages from the framework. (#9655)
Fixes https://github.com/flutter/flutter/issues/18852
2019-07-03 15:44:39 -07:00
Zachary Anderson 0a2e28d797 Revert tracing changes (#9296)
* Revert "[fuchsia] Fix alignment of Fuchsia/non-Fuchsia tracing (#9289)"

This reverts commit f80ac5f571.

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

This reverts commit 7826548462.
2019-06-12 10:25:49 -07:00
Dan Field 7826548462 Align fuchsia and non-fuchsia tracing (#9199) 2019-06-05 15:14:27 -07:00
Chinmay Garde 56052c70af Rename the shell namespace to flutter. (#8520) 2019-04-09 17:10:46 -07:00
Chinmay Garde eec74e5c92 Rename the blink namespace to flutter. (#8517)
Some components in the Flutter engine were derived from the forked blink codebase. While the forked components have either been removed or rewritten, the use of the blink namespace has mostly (and inconsistently) remained. This renames the blink namesapce to flutter for consistency. There are no functional changes in this patch.
2019-04-09 12:44:42 -07:00
Chinmay Garde cb8eb801a4 Allow embedders to specify their own task runner interfaces. (#8273)
Currently, all Flutter threads are managed by the engine itself. This works for
all threads except the platform thread. On this thread, the engine cannot see
the underlying event multiplexing mechanism. Using the new task runner
interfaces, the engine can relinquish the task of setting up the event
multiplexing mechanism and instead have the embedder provide one for it during
setup.

This scheme is only wired up for the platform thread. But, the eventual goal
is to expose this message loop interoperability for all threads.
2019-03-27 16:16:59 -07:00
Chinmay Garde 3c8ef04e91 Allow embedders to post tasks onto the render thread. (#8089)
Some embedders may have to wait on fences asynchronously before committing
contents. This allows them to post a task onto the engine managed thread used
for rendering.
2019-03-08 16:30:48 -08:00
Chinmay Garde 33bb91cc15 Allow embedders to specify a vsync waiter. (#7914)
Fixes https://github.com/flutter/flutter/issues/28240
2019-02-21 23:02:32 -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
nathanrogersgoogle e2394ad77e Add flow events connecting pointer events to frames (#7807) 2019-02-13 22:27:12 -08:00
Chinmay Garde 26e02aaa23 Wire up support for external OpenGL textures for the embedder. (#7087) 2019-01-09 15:21:39 -08:00
Chris Bracken 08465e8000 Verify RunConfiguration is valid before running (#6922)
In cases where a valid IsolateConfiguration cannot be inferred, (e.g.,
settings.kernel_list_asset is missing) RunConfiguration can be created
with a null IsolateConfiguration. In such cases, bail out early with
kInvalidSettings.

Also adds a redundant paranoid check to EmbedderEngine::Run.
2018-12-16 14:07:42 -08:00
Michael Goderbauer 70a1106b50 Unify copyright lines (#6757) 2018-11-07 12:24:35 -08:00
Chinmay Garde ba8f6aa71c Handle Windows headers defining ERROR to 0 in log levels. (#6677) 2018-10-26 16:47:14 -07:00
Dan Field 89516aad94 Engine::Run returns enum: success, failure, or isolate already running (#6324)
* If isolate is already running, return true

* Use shell::Engine::RunStatus as result of Engine::Run
2018-09-24 18:01:22 -04:00
Chinmay Garde 9f8285ac6c Remove all dependencies on Garnet. (#5869) 2018-07-26 12:49:34 -07:00
Chinmay Garde 58e84c8bf0 Re-land "Support multiple shells in a single process. (#4932)" (#4998)
* Re-land "Support multiple shells in a single process. (#4932)"

This reverts commit 723c7d0143.
2018-04-13 13:48:15 -07:00
Vyacheslav Egorov 723c7d0143 Revert "Re-land "Support multiple shells in a single process. (#4932)" (#4977)" (#4981)
This reverts commit a3327bff86.
2018-04-12 18:28:55 +02:00