This reverts commit 8cb106f91850a9e9984d4bb39fc524710e51755c.
The reverted code was not the root cause of the issues with rolling
flutter into fuchsia, so adding it back.
In addition, lowering the severity of the connection error at the outset
to WARNING; since it is not a hard failure.
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.
Fixesflutter/flutter#38903
The earlier assumption was that the render target would be re-materialized per frame. The render target needs its own picture recorder to be create per frame as well. When render targets are cached in the registry, an existing target will be reused. But submitting the previous frame would have discarded the recorder already. The layer tree paint would then attempt to dererence a null canvas causing a crash at runtime.
Added tests to ensure that this does not happen both with and without a custom compositor specified by the embedder. I am going to rework this code so that the external view embedders thinks of render target access on a per frame basis but that is a larger change. This smaller patchset should unblock broken builds.
Fixes b/144093523
This fixes the selection and deletion during text editing on macOS so that it can handle selections that have a base (selection start) that is after the extent (selection end) in the string.
Apparently the insertText:replacementRange on macOS can supply an NSRange object that has negative values for the length (even though the length is an unsigned NSUInteger). This change checks for that case, and fixes the range of characters replaced in the text to have the right bounds.
Also, I added an additional updateEditState after the state is set from the framework, since there is a timing problem: when the delete key is pressed, it sends an insertText message, which updates the framework state after the framework has already sent its state update to delete the selected region. This additional updateEditState puts the engine and framework back in sync again. Ideally, we would just avoid sending the insertText message, but there's really no way for the engine to know if the pressed key is part of an edit sequence or not.
The intention of the property provider is to try to connect, not
bail out if connection is not possible.
This code tried to connect unconditionally, which is not what we wanted.
Removing this initialization code to enable a roll, and will fix in a
followup.
By default, the CAMetalLayer backing store is a framebuffer attachment that is
only optimized for display. However, effects such as backdrop filters require
renderbuffer readback. Making this calls will result in exceptions. Disable the
write only optimization on such backing store.
Fixes https://github.com/flutter/flutter/issues/43555
This resolves the following error on Fuchsia: Component fuchsia-pkg://fuchsia.com/flutter_aot_product_runner#meta/flutter_aot_product_runner.cmx is not allowed to connect to fuchsia.intl.PropertyProvider because this service is not present in the component's sandbox.
When gr context is changed (this happens when sending the app to the background and then to the foreground) we need to update it for all the platform view overlay surfaces.
The update logic was caching the previous gr context to figure if it had to be updated, but after updating it for a given overlay we were updating the cached context. In apps with multiple platform views this will result in overlays with a stale gr context.
This fixesflutter/flutter#36437
And I believe it should fixflutter/flutter#36999 as well (though I don't have repro code to verify).
Having 2 or more platform views simultaneously in the layer tree was crashing immediately on iOS with GL backend.
This regressed in #11070 which passed gl_context to a function in a loop using std::move (which meant on the second iteration the caller is no longer the owner of the field).
I added a scenarios_app test, though this test doesn't run on a physical device on CI so it would have only caught the problem when running locally (flutter/flutter#43852).
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.
This used to only be handled correctly for non-root layer backing stores. This
was mostly a side effect of the fact that we used recording canvases instead of
rendering directly into the backing store. We now use recording canvases
consistently.
Fixes b/143464703
Fixes https://github.com/flutter/flutter/issues/43732