Skip to content

[Impeller] Text scale wrong rendering (Android) #182143

Description

@TheManuz

Steps to reproduce

I've recently had some graphical problems with text transforms with Impeller on Android (tested on Android 13)

Basically, if you wrap a Text inside a Tranform.scale with scaleY: 2 (any value greater than 1), the resulting text will have jagged diagonal lines, and vertical lines will have varying weights.

This doesn't happen with Skia.

Expected results

This is my test with Skia:

Image

Actual results

This is my test with Impeller:

Image

Code sample

Code sample
import 'dart:ui' as ui;

import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_file_dialog/flutter_file_dialog.dart';

void main() {
  runApp(const MainApp());
}

class MainApp extends StatefulWidget {
  const MainApp({super.key});

  @override
  State<MainApp> createState() => _MainAppState();
}

class _MainAppState extends State<MainApp> {
  final _boundaryKey = GlobalKey();

  String rendererName() =>
      ui.ImageFilter.isShaderFilterSupported ? 'impeller' : 'skia';

  Future<void> _saveImage() async {
    final RenderRepaintBoundary boundary =
        _boundaryKey.currentContext!.findRenderObject()
            as RenderRepaintBoundary;

    final image = await boundary.toImage();
    final byteData = await image.toByteData(format: ui.ImageByteFormat.png);
    final pngBytes = byteData!.buffer.asUint8List();

    final rendererName = ui.ImageFilter.isShaderFilterSupported
        ? 'impeller'
        : 'skia';
    final params = SaveFileDialogParams(
      data: pngBytes,
      fileName: "${rendererName}_output.png",
    );
    final filePath = await FlutterFileDialog.saveFile(params: params);
    if (filePath == null) {
      print("file path was null");
    } else {
      print("Saved: $filePath");
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: RepaintBoundary(
            key: _boundaryKey,
            child: Container(
              padding: const EdgeInsets.all(20),
              color: Colors.white,
              child: Column(
                mainAxisSize: .min,
                children: [
                  for (final scale in <double>[1, 1.5, 2, 2.5])
                    Padding(
                      padding: EdgeInsetsGeometry.symmetric(vertical: 8),
                      child: Transform.scale(
                        scaleY: scale,
                        child: const Text('MAN'),
                      ),
                    ),
                ],
              ),
            ),
          ),
        ),
        floatingActionButton: FloatingActionButton.extended(
          onPressed: () => _saveImage(),
          icon: Icon(Icons.screenshot_outlined),
          label: Text("Save image"),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration Image

As you can see, vertical lines change weight on the Impeller image. Diagonal lines become jagged at some scales.

Logs

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.38.9, on macOS 26.2 25C56 darwin-arm64, locale it-IT) [305ms]
    • Flutter version 3.38.9 on channel stable at /Users/emanuelesalamone/Code/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 67323de285 (13 days ago), 2026-01-28 13:43:12 -0800
    • Engine revision 587c18f873
    • Dart version 3.10.8
    • DevTools version 2.51.1
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [1.509ms]
    • Android SDK at /Users/emanuelesalamone/Library/Android/sdk
    • Emulator version 36.2.12.0 (build_id 14214601) (CL:N/A)
    • Platform android-36, build-tools 35.0.0
    • ANDROID_HOME = /Users/emanuelesalamone/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 26.2) [1.195ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17C52
    ! iOS 26.2 Simulator not installed; this may be necessary for iOS and macOS development.
      To download and install the platform, open Xcode, select Xcode > Settings > Components,
      and click the GET button for the required platform.

      For more information, please visit:
        https://developer.apple.com/documentation/xcode/installing-additional-simulator-runtimes
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [7ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Connected device (3 available) [6,7s]
    • N92 (mobile)    • N92    • android-arm64  • Android 13 (API 33)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 26.2 25C56 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 144.0.7559.133

[✓] Network resources [286ms]
    • All expected network resources are available.```

</details>

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work liste: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions