- 24 8月, 2019 2 次提交
-
-
由 Chinmay Garde 提交于
Uses the same technique used during OpenGL composition to elide root surface access. The refactoring of this approach is tracked in https://github.com/flutter/flutter/issues/38466 Fixes https://github.com/flutter/flutter/issues/39009.
-
由 Chinmay Garde 提交于
We will end up creating fewer threads in tests.
-
- 23 8月, 2019 1 次提交
-
-
由 Chinmay Garde 提交于
-
- 22 8月, 2019 1 次提交
-
-
由 Chinmay Garde 提交于
No functional change. Just makes testing with fixture images easier. Adding a whole lot more tests that use this path for the embedder surface rotation patches. Want to land stuff in smaller chunks.
-
- 21 8月, 2019 4 次提交
-
-
由 stuartmorgan 提交于
change_install_name.py was operating on framework library files in-place, which breaks GN's timestamp analysis handling since a file can't be both an input and output of an action. As a result no-op builds on macOS were not actually no-ops. This changes the script to operate on an output copy, both fixing the no-op build issue, and simplifying the GN framework construction scripts by combining the copy step and the install-name step. Fixes https://github.com/flutter/flutter/issues/33465
-
-
由 Chinmay Garde 提交于
The root canvas is managed by the external view embedder when using a custom compositor. Due to this, frame submission on the surface will not end up flushing the same (because the surface doesn’t have it to begin with). Fixed with tests.
-
由 Jason Simmons 提交于
This test queues tasks to a custom task runner that runs the tasks on the platform thread. After shutting down the engine, the test must wait until these tasks are drained before the test exits.
-
- 20 8月, 2019 1 次提交
-
-
由 Chinmay Garde 提交于
This issue would only manifest when a custom task runner was being used with a custom compositor. Both were tested separately but not together. A new test has been added for this. We still create the GPU thread merger unnecessarily but I can patch that later. I also cleaned up the existing custom task runner test to not submit tasks on a dead engine as they just log errors unnecessarily. Filed new: https://github.com/flutter/flutter/issues/38844
-
- 14 8月, 2019 1 次提交
-
-
由 Chinmay Garde 提交于
This patch allows embedders to split the Flutter layer tree into multiple chunks. These chunks are meant to be composed one on top of another. This gives embedders a chance to interleave their own contents between these chunks. The Flutter embedder API already provides hooks for the specification of textures for the Flutter engine to compose within its own hierarchy (for camera feeds, video, etc..). However, not all embedders can render the contents of such sources into textures the Flutter engine can accept. Moreover, this composition model may have overheads that are non-trivial for certain use cases. In such cases, the embedder may choose to specify multiple render target for Flutter to render into instead of just one. The use of this API allows embedders to perform composition very similar to the iOS embedder. This composition model is used on that platform for the embedding of UIKit view such and web view and map views within the Flutter hierarchy. However, do note that iOS also has threading configurations that are currently not available to custom embedders. The embedder API updates in this patch are ABI stable and existing embedders will continue to work are normal. For embedders that want to enable this composition mode, the API is designed to make it easy to opt into the same in an incremental manner. Rendering of contents into the “root” rendering surface remains unchanged. However, now the application can push “platform views” via a scene builder. These platform views need to handled by a FlutterCompositor specified in a new field at the end of the FlutterProjectArgs struct. When a new platform view in introduced within the layer tree, the compositor will ask the embedder to create a new render target for that platform view. Render targets can currently be OpenGL framebuffers, OpenGL textures or software buffers. The type of the render target returned by the embedder must be compatible with the root render surface. That is, if the root render surface is an OpenGL framebuffer, the render target for each platform view must either be a texture or a framebuffer in the same OpenGL context. New render target types as well as root renderers for newer APIs like Metal & Vulkan can and will be added in the future. The addition of these APIs will be done in an ABI & API stable manner. As Flutter renders frames, it gives the embedder a callback with information about the position of the various platform views in the effective hierarchy. The embedder is then meant to put the contents of the render targets that it setup and had previously given to the engine onto the screen (of course interleaving the contents of the platform views). Unit-tests have been added that test not only the structure and properties of layer hierarchy given to the compositor, but also the contents of the texels rendered by a test compositor using both the OpenGL and software rendering backends. Fixes b/132812775 Fixes flutter/flutter#35410
-
- 09 8月, 2019 1 次提交
-
-
由 Chinmay Garde 提交于
-
- 07 8月, 2019 1 次提交
-
-
由 Chinmay Garde 提交于
This exposes the `Settings::leak_vm` flag to custom embedders. All embedder unit-tests now shut down the VM on the shutdown of the last engine in the process. The mechanics of VM shutdown are already tested in the Shell unit-tests harness in the DartLifecycleUnittests set of of assertions. This just exposes that functionality to custom embedders. Since it is part of the public stable API, I also switched the name of the field to be something less snarky than the field in private shell settings.
-
- 31 7月, 2019 1 次提交
-
-
由 Dan Field 提交于
-
- 23 7月, 2019 2 次提交
-
-
由 stuartmorgan 提交于
embedder.h is a C API, so has no namespace, and only uses 'Flutter' as a prefix for most symbol names. This creates potential collisions with other code; for instance, FlutterEngine is the name of a type in embedder.h, but also an ObjC class in the iOS Flutter API. This adds a macro that can be set to prefix symbol names, allowing clients (notably, the macOS embedding) to adjust the names used by the embedding API internally without breaking ABI or API compatibility for the standard engine build. Currently the macro is only applied to FlutterEngine, since that's the symbol that is currently at issue, but it can be expanded to other symbols in the future.
-
由 Jason Simmons 提交于
Declare a copy of the enable_bitcode flag within the Flutter build scripts for use in Fuchsia builds (#10003) enable_bitcode is defined in build/toolchain/clang.gni, which exists in the Flutter buildroot but not in the Fuchsia source tree.
-
- 19 7月, 2019 1 次提交
-
-
由 stuartmorgan 提交于
Debug builds log invalid file errors on launch of anything using the embedding API due to an unconditional use of assets_dir, even though only one of assets_dir or assets_path needs to be set (and the embedding API currently uses the latter). This checks that the FD has been set before trying to use it to create an asset resolver. Also eliminates a duplicate code path in embedder.cc, where it was calling RunConfiguration::InferFromSettings, then running exactly the same asset manager creation code again locally.
-
- 18 7月, 2019 1 次提交
-
-
由 Dan Field 提交于
-
- 17 7月, 2019 3 次提交
-
-
由 gaaclarke 提交于
-
由 gaaclarke 提交于
Started adding the engine hash to Flutter.framework's Info.plist.
-
由 Pierre Champion 提交于
-
- 12 7月, 2019 1 次提交
-
-
由 liyuqian 提交于
-
- 10 7月, 2019 1 次提交
-
-
由 Chinmay Garde 提交于
This patch reworks image decompression and collection in the following ways because of misbehavior in the described edge cases. The current flow for realizing a texture on the GPU from a blob of compressed bytes is to first pass it to the IO thread for image decompression and then upload to the GPU. The handle to the texture on the GPU is then passed back to the UI thread so that it can be included in subsequent layer trees for rendering. The GPU contexts on the Render & IO threads are in the same sharegroup so the texture ends up being visible to the Render Thread context during rendering. This works fine and does not block the UI thread. All references to the image are owned on UI thread by Dart objects. When the final reference to the image is dropped, the texture cannot be collected on the UI thread (because it has not GPU context). Instead, it must be passed to either the GPU or IO threads. The GPU thread is usually in the middle of a frame workload so we redirect the same to the IO thread for eventual collection. While texture collections are usually (comparatively) fast, texture decompression and upload are slow (order of magnitude of frame intervals). For application that end up creating (by not necessarily using) numerous large textures in straight-line execution, it could be the case that texture collection tasks are pending on the IO task runner after all the image decompressions (and upload) are done. Put simply, the collection of the first image could be waiting for the decompression and upload of the last image in the queue. This is exacerbated by two other hacks added to workaround unrelated issues. * First, creating a codec with a single image frame immediately kicks of decompression and upload of that frame image (even if the frame was never request from the codec). This hack was added because we wanted to get rid of the compressed image allocation ASAP. The expectation was codecs would only be created with the sole purpose of getting the decompressed image bytes. However, for applications that only create codecs to get image sizes (but never actually decompress the same), we would end up replacing the compressed image allocation with a larger allocation (device resident no less) for no obvious use. This issue is particularly insidious when you consider that the codec is usually asked for the native image size first before the frame is requested at a smaller size (usually using a new codec with same data but new targetsize). This would cause the creation of a whole extra texture (at 1:1) when the caller was trying to “optimize” for memory use by requesting a texture of a smaller size. * Second, all image collections we delayed in by the unref queue by 250ms because of observations that the calling thread (the UI thread) was being descheduled unnecessarily when a task with a timeout of zero was posted from the same (recall that a task has to be posted to the IO thread for the collection of that texture). 250ms is multiple frame intervals worth of potentially unnecessary textures. The net result of these issues is that we may end up creating textures when all that the application needs is to ask it’s codec for details about the same (but not necessarily access its bytes). Texture collection could also be delayed behind other jobs to decompress the textures on the IO thread. Also, all texture collections are delayed for an arbitrary amount of time. These issues cause applications to be susceptible to OOM situations. These situations manifest in various ways. Host memory exhaustion causes the usual OOM issues. Device memory exhaustion seems to manifest in different ways on iOS and Android. On Android, allocation of a new texture seems to be causing an assertion (in the driver). On iOS, the call hangs (presumably waiting for another thread to release textures which we won’t do because those tasks are blocked behind the current task completing). To address peak memory usage, the following changes have been made: * Image decompression and upload/collection no longer happen on the same thread. All image decompression will now be handled on a workqueue. The number of worker threads in this workqueue is equal to the number of processors on the device. These threads have a lower priority that either the UI or Render threads. These workers are shared between all Flutter applications in the process. * Both the images and their codec now report the correct allocation size to Dart for GC purposes. The Dart VM uses this to pick objects for collection. Earlier the image allocation was assumed to 32bpp with no mipmapping overhead reported. Now, the correct image size is reported and the mipmapping overhead is accounted for. Image codec sizes were not reported to the VM earlier and now are. Expect “External” VM allocations to be higher than previously reported and the numbers in Observatory to line up more closely with actual memory usage (device and host). * Decoding images to a specific size used to decode to 1:1 before performing a resize to the correct dimensions before texture upload. This has now been reworked so that images are first decompressed to a smaller size supported natively by the codec before final resizing to the requested target size. The intermediate copy is now smaller and more promptly collected. Resizing also happens on the workqueue worker. * The drain interval of the unref queue is now sub-frame-interval. I am hesitant to remove the delay entirely because I have not been able to instrument the performance overhead of the same. That is next on my list. But now, multiple frame intervals worth of textures no longer stick around. The following issues have been addressed: * https://github.com/flutter/flutter/issues/34070 Since this was the first usage of the concurrent message loops, the number of idle wakes were determined to be too high and this component has been rewritten to be simpler and not use the existing task runner and MessageLoopImpl interface. * Image decoding had no tests. The new `ui_unittests` harness has been added that sets up a GPU test harness on the host using SwiftShader. Tests have been added for image decompression, upload and resizing. * The device memory exhaustion in this benchmark has been addressed. That benchmark is still not viable for inclusion in any harness however because it creates 9 million codecs in straight-line execution. Because these codecs are destroyed in the microtask callbacks, these are referenced till those callbacks are executed. So now, instead of device memory exhaustion, this will lead to (slower) exhaustion of host memory. This is expected and working as intended. This patch only addresses peak memory use and makes collection of unused images and textures more prompt. It does NOT address memory use by images referenced strongly by the application or framework.
-
- 07 7月, 2019 1 次提交
-
-
由 Chinmay Garde 提交于
-
- 04 7月, 2019 1 次提交
-
-
- 01 7月, 2019 1 次提交
-
-
由 Jason Simmons 提交于
-
- 28 6月, 2019 1 次提交
-
-
由 Chinmay Garde 提交于
This was disabled in https://github.com/flutter/engine/pull/6798 waiting for a Dart SDK patch to land https://github.com/dart-lang/sdk/commit/e6d3a45b6a98ea36581ac375ec5cdd63dd829004 which has long since been addressed.
-
- 20 6月, 2019 1 次提交
-
-
由 chunhtai 提交于
-
- 18 6月, 2019 2 次提交
-
-
由 Jason Simmons 提交于
Applications can use an embedder API to obtain the isolate ID and then use it in calls to the Dart service protocol.
-
由 Chinmay Garde 提交于
-
- 15 6月, 2019 1 次提交
-
-
由 Jason Simmons 提交于
Messages sent to the embedder host may be one-way messages with no response handler. If the host calls FlutterEngineSendPlatformMessageResponse on a one-way message, then just delete the message response handle. Also update the documentation to indicate that FlutterEngineSendPlatformMessageResponse must be called for all messages. Previously the docs implied that some FlutterPlatformMessage objects may have a null response_handle. The embedder will now set a response_handle for every message (even if the sender does not expect a response).
-
- 14 6月, 2019 1 次提交
-
-
由 Jason Simmons 提交于
Linux target builds for non-x86/x64 platforms were failing due to the dependency on SwiftShader
-
- 13 6月, 2019 2 次提交
-
-
由 Chinmay Garde 提交于
Currently, all our host unit-tests that have rendering concerns use the software backend because of OpenGL ES availability and stability issues on the various platforms where we run host tests. Unfortunately, entire subsystems are disabled (and not tested) when rendering with the software backend. This patch pulls in SwiftShader and via pending patches in the buildroot, configures the host unit-tests to optionally use OpenGL ES in a stable manner without relying on the OpenGL drivers being present (and functional). I have wired up the embedder test fixture in this patch to use the SwiftShader based OpenGL ES driver. I will update the shell and runtime unittests in a subsequent patch as well. The on and offscreen surfaces are configured as 1x1 pbuffer surface because we should be able to write pixel tests using OpenGL directly wihout having to deal with surfaces.
-
由 Zachary Anderson 提交于
* Revert "[fuchsia] Fix alignment of Fuchsia/non-Fuchsia tracing (#9289)" This reverts commit f80ac5f5. * Revert "Align fuchsia and non-fuchsia tracing (#9199)" This reverts commit 78265484.
-
- 07 6月, 2019 1 次提交
-
-
由 liyuqian 提交于
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.
-
- 06 6月, 2019 1 次提交
-
-
由 Dan Field 提交于
-
- 29 5月, 2019 1 次提交
-
-
由 Chinmay Garde 提交于
* 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.
-
- 26 5月, 2019 1 次提交
-
-
由 Chris Bracken 提交于
Corects a bnuch of typeos throughout teh engien codebsae. Also makes a couple minor Commonwealth -> US spelling adjustments for consistency with the rest of Flutter's codebase. Made use of `misspell` tool: https://github.com/client9/misspell
-
- 22 5月, 2019 1 次提交
-
-
由 stuartmorgan 提交于
Rather than hard-coding the type of incoming events to mouse, and synthesizing a primary button press for kDown/kUp, expose device kind and buttons in the API. For backwards compatibility, if the type is not set, the old behavior is used. If an embedder sets the type to mouse explicitly, however, they must also set correct button information. For the touch type, the API abstracts away the framework's internal expectation that a button is set for touch down/move for simplicity. Fixes flutter/flutter#32854
-
- 21 5月, 2019 1 次提交
-
-
由 Matthew Dempsky 提交于
This member variable was added to three classes in #7807, but only initialized to 0 in one of them. Initialize to 0 in the other two.
-
- 14 5月, 2019 1 次提交
-
-
由 Jason Simmons 提交于
This will reduce executable size.
-