This PR simplifies the FlView GL interactions. It removes some code paths that were never being used (possibly for future use with platform views?) and complex internal APIs that could be done in a single method call. This is motivated in investigating https://github.com/ubuntu-flutter-community/software/issues/868.
I plan to take this further, since there doesn't seem to be any reason why multiple FlGLArea widgets are used - we can draw all the layers in one widget.
For reviewers - the individual commits aren't particularly interesting, I just did it that way to be sure I wasn't breaking anything along the way and help to diagnose any regressions in the future.
The structural changes that this PR is simplifying came in 0561c75b4d6036e7d2c7e06163a3f0629464db9f.
Kaushik already did most of the great work. This patch gets us to a point where
all the playgrounds tests pass and the common performance optimizations are in
place. All known non-compute Impeller features should be implemented. There are
iOS only performance optimizations that haven’t been opted into because these
are behind define guards. These need to be generalized. Without that, the
performance of this backend will lag behind that of the Metal backend but only
because it is not an apples to apples comparison.
The general rubric was to keep the code and concepts as similar to the Metal
backend as possible.
The list of updates, all to the Vulkan Impeller backend:
* MSAA is wired up.
* Depth and stencil attachments and pipeline states are wired up.
* Got rid of Vulkan specific hacks in the inline pass context that were
preventing clips from working.
* Storage modes for both device buffer and texture allocation are respected.
This includes optimal usage of tile memory for device transient attachments.
* Host coherent memory for textures is no longer a requirement with explicit
mapping management and write flushes.
* Texture uploads should be optimized for the UMA case without needing a staging
buffer. That entire pipeline has been reworked.
* Textures track their current layout and ensure they get to the right layout
based on usage without redundant transitions.
* Cube textures are now supported.
* Mipmapping has been reworked to correct image layout errors. With the new
texture layout transition management, blit passes should be a whole lot easier
to read and reason about.
* Allocator allocations are named using Vulkan debug utilities and the allocator
(VMA). Comes in handy when chasing leaks. All of which are chased down.
* Left some handy utilities in there to debug resource leaks after context
shutdown. These are validation errors.
* Debug groups are pushed around render pass command encoding as well as the
entire pass contents. This mimics the behavior of the Metal backend and it
should be easy to map traces using both backends in Xcode and RenderDoc.
* Command buffer submission allows for tracking the life cycles of all resources
referenced in the command stream and ensuring that the objects stay alive till
past the submission of the command buffer. All use-after-free issues due to
this class of issue have been chased down.
* Command pools are now context global instead of being created per pass.
* Descriptor pool are now context global instead of being created per pass.
Individual descriptor types are now reference counted and returned to the pool
when not needed. The pool is still fixed size though (and hence relatively
large).
* All instances of global waitIdle on the device are removed during normal
operation. The only times a waitIdle may happen is during swapchain recreation
and context destruction.
* Swapchain adapt to them going out of date with the underlying surface and
seamlessly resize as necessary on the next drawable acquisition.
* Playgrounds are resizable.
* Pipeline front face and cull modes are respected.
* Clears for all attachments are respected.
* Maximum textures sizes supported on the device are respected instead of
hardcoding the minimum Vulkan requirement.
Fixes https://github.com/flutter/flutter/issues/112388
Fixes https://github.com/flutter/flutter/issues/112648
Fixes https://github.com/flutter/flutter/issues/112647 and a few other issues...
Rather than explicitly delete the copy constructor and operator=, use
the standard FML_DISALLOW_COPY_AND_ASSIGN macro used elsewhere across
the codebase. Also ensure that files using this macro #include the
correct FML header directly, rather than relying on a transitive
include.
No test changes/additions since this patch introduces no semantic
changes.
Applies the FML_DISALLOW_COPY_AND_ASSIGN to non-POD types in the Windows
embedder.
No new tests since no semantic change. Only has the compile-time effect
of preventing copying of classes intended to be move-only.
Applies the FML_DISALLOW_COPY_AND_ASSIGN to non-POD types in the macOS
embedder. Specifically the following three accessibility-related
classes:
* FlutterPlatformNodeDelegateMac
* FlutterTextPlatformNode
* AccessibilityBridgeMac
No new tests since no semantic change. Only has the compile-time effect
of preventing copying of classes intended to be move-only.
Support for using dart:mirrors has been deprecated for nearly two years.
this removes support for enabling mirrors from the embedder as
documented in the deprecation comment. This was primarily added as a
workaround for an internal tooling usecase, which no longer exists.
Issue: https://github.com/flutter/flutter/issues/120924
Support for using dart:mirrors has been deprecated for nearly two years.
this removes support for enabling mirrors from the embedder as
documented in the deprecation comment. This was primarily added as a
workaround for an internal tooling usecase, which no longer exists.
Issue: https://github.com/flutter/flutter/issues/120924
This introduces `PlatformDispatcher.implicitView`, a low-level primitive for the framework's bootstrapping. Most code, including the framework after bootstrapping, will use `View.of(context)` instead of this new API. This new primitive will let us deprecate the `window` global.
Goals:
1. **Enable multi-window**. The `PlatformDispatcher.implicitView` is nullable. If `null`, the app must create a window to get a view it can draw into.
2. **Backwards compatibility**. For "single window" apps, `PlatformDispatcher.instance.implicitView` should behave as similar to `window` as possible.
1. The `PlatformDispatcher.instance.implicitView.viewId` should be `0`.
1. The `PlatformDispatcher.instance.implicitView` must be available synchronously at root isolate startup. This allows the framework to determine if it can make single window assumptions at startup.
2. The `PlatformDispatcher.instance.implicitView` reference must not change after startup: if it is null at startup, it must always be null; if it is non-null at startup, it must always be non-null. If "single window" app enters headless mode, the implicit view must remain non-null.
In the future, the embedder will control whether an implicit view is created: mobile & legacy desktop apps will have an implicit view, multi-window desktop apps won't have an implicit view. This requires updating the engine's embedder API and is out-of-scope for this change. For now, all apps will have an implicit view.
Part of https://github.com/flutter/flutter/issues/120306
This just extracts arguments to the TextInputClient.setClient async
method call into an NSDictionary local to reduce the deep
indentation of the formatted code.
While the bulk of these calls are identical and could be extracted to a
utility function, or a class extension method like
`handleDefaultSetClientCall`, the point of these tests is to exercise
FlutterTextInputPlugin, and the message protocol over the channel are
precisely what's being tested, so it makes sense to keep these
explicit.
Followup patch to https://github.com/flutter/engine/pull/39632.
Issue: https://github.com/flutter/flutter/issues/120252
* working commit
* some clean up
* white space fixes
* whitespace
* remove unused import
* Addressing PR comment, fix tests, update touch packet on Andriod
* formatting n whitespace again
* add new field to web ui pointer.dart
* update test
* whitespace
* fix test
* PR comments
* fix test
* whitespace
* fix test by factoring out logic into helper function
* whitespace
* fix malformed string
* pr comments
* fix type issue
* sigh whitespace
* revert test changes :)
* pr comments + separate out tests
* extra space
* change test name
* Implemented wide gamut images for iOS
Moved the surface to an extended range color format.
* wrong gamma but default pixel format set to bgra10_xr
* BGR10_XR add
* format
* updated todos
* updated todo with information about pixel formats
* switched logic for determining if we have a wide gamut image
* cleaned up gamut math to match style and linked source
* made the color attachment pixel format match the surface
* updated vulkan format switch
* removed comment
* added enable disable switch
* moved default to bgr10 for now since there is a bug where someone is still reading this, msaa?
* fixed the decoder settings to make sure we don't lose wide gamut colors
* fixed stored srgb gamut variable
* fixed false lint
* updated test
* added ability to grab the surface data for tests
* made the screenshot utility return the format
* added width and height to the platform channel payload
* fixed a couple of broken targets
* moved back the default pixel buffer format
* cleanup and add docstrings
* made the surfacedata feature only available in debug builds
* added decoding unit test
* fixed objc tests
* turned off by default
* bdero feedback1
* bdero2
* bdero3
* fixed merge issue
* removed using std::shared_ptr
Adds marks to cleanly separate the sections of TextInputPlugin when
viewing in XCode and other IDEs that recognise #pragma mark. This file
is getting pretty long.
No tests since this is a cleanup with no functional changes.