Update Flutter 3.44.4#38
Conversation
Stop generating the GLES3 impeller shader variants in shaders.gni. Flutter 3.44 changed shell/platform/embedder/embedder_surface_gl_impeller.cc to include the impeller/entity/gles3/* headers and select GLES3 shaders at runtime via GetShaderMappings(is_gles3). With GLES3 generation disabled those headers/symbols do not exist, so adapt that consumer here: drop the gles3 includes and always use the GLES2 shader set (valid on GLES3 contexts too). This keeps the disable-gles3 patch self-consistent.
flutter-tizen/flutter-tizen#554 Added x64 artifacts for x64 emulator support (Currently, x64 Release mode is only supported on Linux hosts.)
flutter engine's window build uses Window SDKs 10.0.22621.0. window-2025 runner in gitHub actions no longer supports the 10.0.22621.0 SDK.
Add new struct FlutterVulkanTexture for embedder :
```
typedef struct {
/// Handle to the VkImage that is owned by the embedder. The engine will
/// bind this image for writing the frame.
FlutterVulkanImageHandle image;
/// The VkDeviceMemory that backs the iamge.
FlutterVulkanDeviceMemoryHandle image_memory;
/// The VkFormat of the image (for example: VK_FORMAT_R8G8B8A8_UNORM).
uint32_t format;
/// User data to be returned on the invocation of the destruction callback.
void* user_data;
/// Callback invoked (on an engine managed thread) that asks the embedder to
/// collect the texture.
VoidCallback destruction_callback;
/// Optional parameters for texture height/width, default is 0, non-zero means
/// the texture has the specified width/height.
/// Width of the texture.
size_t width;
/// Height of the texture.
size_t height;
} FlutterVulkanTexture;
```
The implement of [texture
source](https://github.com/flutter-tizen/flutter/pull/17/files#diff-7955a8522a753162869f2e8ca0017a83f4854b60800c844202e70c3aa00ff0c9R5-R204)
refer to the solution of android
platform(https://github.com/flutter-tizen/flutter/blob/flutter-3.35.3/engine/src/flutter/impeller/renderer/backend/vulkan/android/ahb_texture_source_vk.cc)
and I have submitted the code [Support render texture for
embedder](xiaowei-guan/embedder@6a94746),
I will create a new PR after[ support vulkan
backend](flutter-tizen/embedder#110) PR
released.
Replaced macos-13 with macos-15-intel actions/runner-images#13046
Because Tizen platform don't support hardware key, so we can't create a cache source to store the gpu resource. so we should reset the resouce before the frame end.
Inject a small compat header into the custom cross-toolchain command line so Linux targets built with Tizen sysroots still see __NR_getrandom even when the sysroot headers do not export it. This keeps third_party/dart untouched and fixes builds across common Tizen architectures: - x86: 355 - x64: 318 - arm: 384 - arm64: 278
Remove unnecessary CI
Adds artifact generation for x64 builds in a macOS environment. I tested the build on macOS 26.3 (Tahoe) and M4 Pro (Arm64) using the x64 lib
Store the embedder's destruction_callback / user_data and invoke it in the destructor to reclaim the VkImage; the Impeller path never released it. Reset the image view before the callback frees the image.
Reject a null embedder image handle in the texture source constructor and skip wrapping an invalid source into a TextureVK, returning nullptr instead of rendering with a half-initialized texture.
The flutter-tizen embedder passes target=GL_TEXTURE_EXTERNAL_OES, so set the descriptor type to kTextureExternalOES instead of the default 2D.
There was a problem hiding this comment.
Code Review
This pull request introduces Tizen cross-compilation support, including a sysroot generator, Dockerfile, and custom toolchain configurations, alongside adding Vulkan external texture support to the embedder API. However, several critical issues were identified in the review: globally disabling GLES3 shaders and unit tests, as well as simplifying host build detection, will break other platforms and CI. Additionally, replacing default Linux fonts globally breaks standard desktop font fallback. The Vulkan external texture implementation contains potential crashes from missing null checks on command buffers and unhandled zero-sized textures, and discards transparency by using an opaque color type. Finally, the Tizen sysroot generator contains security vulnerabilities from unencrypted HTTP downloads and unsafe shell execution, and the Dockerfile can be optimized by cleaning up the package manager cache.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
I am having trouble creating individual review comments. Click here to see my feedback.
engine/src/flutter/impeller/tools/shaders.gni (126-140)
Removing GLES3 shaders globally from impeller_shaders will break Impeller on all other platforms (such as Android) that rely on GLES3 shaders. If GLES3 shaders need to be disabled for Tizen or custom builds, this should be controlled via a conditional GN argument rather than removing them globally.
engine/src/flutter/shell/platform/embedder/embedder_external_texture_vulkan.cc (155-157)
The call to CreateCommandBuffer() can return nullptr if the context is in a bad state or being disposed. Dereferencing it directly via Cast(*buffer) will cause a crash. Add a null check to handle this safely.
auto buffer = impeller_context.CreateCommandBuffer();
if (!buffer) {
return nullptr;
}
impeller::CommandBufferVK& buffer_vk =
impeller::CommandBufferVK::Cast(*buffer);
engine/src/flutter/shell/platform/embedder/embedder_external_texture_vulkan.cc (136-140)
If the embedder returns a FlutterVulkanTexture with width or height set to 0 (which is documented as the default/optional behavior in embedder.h), Impeller will attempt to create a 0x0 texture and fail or crash. Unlike the Skia path, there is no fallback here. Populate the width and height with the fallback size if they are not specified.
std::unique_ptr<FlutterVulkanTexture> texture_desc =
external_texture_callback_(texture_id, size.width(), size.height());
if (!texture_desc) {
return nullptr;
}
if (texture_desc->width == 0 || texture_desc->height == 0) {
texture_desc->width = size.width();
texture_desc->height = size.height();
}
engine/src/flutter/testing/testing.gni (18-19)
Hardcoding enable_unittests = false globally disables unit tests for all platforms, which is a major regression for CI and local testing. Since enable_unittests is a declared argument, it should be overridden in the specific build configuration (e.g., via --args="enable_unittests=false") rather than changing the default value in the source code.
enable_unittests = current_toolchain == host_toolchain || is_fuchsia || is_mac
engine/src/flutter/tools/gn (91-92)
Simplifying is_host_build to only check args.target_os is None breaks cross-compilation for Linux arm64 and Mac host builds, as explained in the removed comments. Revert this change to preserve support for these platforms.
def is_host_build(args):
# If target_os == None, then this is a host build.
if args.target_os is None:
return True
# For linux arm64 builds, we cross compile from x64 hosts, so the
# target_os='linux' and linux-cpu='arm64'
if args.target_os == 'linux' and args.linux_cpu == 'arm64':
return True
# The Mac and host targets are redundant. Again, necessary to disambiguate
# during cross-compilation.
if args.target_os == 'mac':
return True
return Falseengine/src/flutter/txt/src/txt/platform_linux.cc (22-24)
Replacing the default font families globally with only Tizen-specific fonts will break font fallback on standard Linux desktop distributions. Consider prepending the Tizen fonts to the existing list so that both Tizen and standard Linux desktop are supported safely.
std::vector<std::string> GetDefaultFontFamilies() {
return {"TizenDefaultFont", "SamsungOneUI", "Ubuntu", "Adwaita Sans", "Cantarell",
"DejaVu Sans", "Liberation Sans", "Arial"};
}
engine/src/flutter/ci/tizen/generate_sysroot.py (44-49)
Using unencrypted HTTP connections to download packages is insecure and vulnerable to man-in-the-middle (MITM) attacks. Use HTTPS instead.
base_repo = 'https://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Base/reference/repos/standard/packages'.format(
api_version, api_version
)
unified_repo = 'https://download.tizen.org/snapshots/TIZEN/Tizen-{}/Tizen-{}-Unified/reference/repos/standard/packages'.format(
api_version, api_version
)
engine/src/flutter/ci/tizen/generate_sysroot.py (105-108)
Using shell=True with unquoted variables in subprocess.run is unsafe and can fail if paths contain spaces. Avoid shell=True and pass arguments as a list, using Python's open to pass the patch file to stdin safely.
patch = Path(__file__).parent / '{}.patch'.format(arch)
if patch.is_file():
with open(patch, 'r') as f:
subprocess.run(['patch', '-p1', '-s', '-d', str(sysroot)], stdin=f, check=True)
engine/src/flutter/ci/tizen/Dockerfile (9-11)
To keep the Docker image size small, clean up the apt cache by running rm -rf /var/lib/apt/lists/* after installing packages.
RUN apt-get update && \
apt-get install -y git zip build-essential cmake ninja-build clang-11 && \
rm -rf /var/lib/apt/lists/*
engine/src/flutter/ci/tizen/Dockerfile (26-29)
To keep the Docker image size small, clean up the apt cache by running rm -rf /var/lib/apt/lists/* after installing packages.
RUN apt-get update && \
apt-get install -y binutils-arm-linux-gnueabi binutils-aarch64-linux-gnu binutils-i686-linux-gnu && \
apt-get install -y git curl pkg-config ca-certificates python3 python3-pip rpm2cpio cpio && \
rm -rf /var/lib/apt/lists/*
engine/src/flutter/shell/platform/embedder/embedder_external_texture_vulkan.cc (113)
Using kRGB_888x_SkColorType forces the borrowed Skia image to be treated as opaque, discarding any alpha channel. Use kRGBA_8888_SkColorType (similar to the GL external texture implementation) to correctly support transparent external textures.
kRGBA_8888_SkColorType, // color type
Download packages from download.tizen.org over HTTPS instead of plain HTTP, and run the patch command with an argument list and stdin redirection instead of shell=True string interpolation.
- Null-check the command buffer returned by CreateCommandBuffer() before dereferencing it in the Impeller path. It can be null when the context is being torn down. - Fall back to the engine-provided size when the embedder does not populate the texture width/height, matching the Skia path.
Fix flutter-tizen/embedder#157 Impeller eagerly sets up the entire set of pipeline state objects (PSOs) it may need during renderer setup. This works fine on mid to high-end devices as the setup completes well before the first frame is rendered. However on low-end devices, not all PSOs may be ready before the first frame is rendered. Low-end device usually don't have as much available concurrency and are slower to boot. On these devices, the rendering thread had to wait for the background compile job to be completed. It was also observed that the relatively higher priority render thread was waiting on a background thread to finish a PSO compile job. The PSO compile job could also be stuck behind another job that was not immediately needed. This made the situation on low end devices less than ideal. flutter#180022, this PR fix PSO stuck issue for Vulkan on low end devices. Current PR can fix the PSO stuck issue for GLES on low end devices. Related issue : flutter#176657 This PR can improve app startup time for impeller+GLES on low-end devices. flutter#180022 has provided solution for impeller + vulkan. Impeller+GLES has a special case: resource loading cannot be arbitrarily placed on other threads; it needs to be done on the I/O thread because this thread shares the context with the GPU thread. Therefore, this PR introduces the I/O task runner into PipelineCompileQueueGLES. However, since the I/O task runner may handle other tasks, we cannot put all jobs into the I/O thread at once. My current solution is to wait for the previous job to finish before putting the next one into the I/O thread. Main changes: Introduce fml::RefPtrfml::TaskRunner into PipelineCompileQueueGLES. Extract new class PipelineCompileQueueVulkan for vulkan, because the runners are on different threads. (cherry picked from commit 92a8430)
|
Ah... it's my mistake. We need to do a rebase merge, not a squash. I will create a new PR. I am so sorry |
flutter-tizen/flutter-tizen#783