Skip to content

Update Flutter 3.44.4#38

Open
JSUYA wants to merge 27 commits into
flutter-tizen:flutter-3.44.4from
JSUYA:flutter-3.44.4-candidate.1
Open

Update Flutter 3.44.4#38
JSUYA wants to merge 27 commits into
flutter-tizen:flutter-3.44.4from
JSUYA:flutter-3.44.4-candidate.1

Conversation

@JSUYA

@JSUYA JSUYA commented Jul 2, 2026

Copy link
Copy Markdown
Member

JSUYA and others added 25 commits July 2, 2026 18:26
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.
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
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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

critical

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)

high

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)

high

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)

high

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)

high

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 False

engine/src/flutter/txt/src/txt/platform_linux.cc (22-24)

high

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)

security-medium medium

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)

security-medium medium

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)

medium

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)

medium

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)

medium

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

JSUYA added 2 commits July 2, 2026 20:35
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants