-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed
Labels
c: API breakBackwards-incompatible API changesBackwards-incompatible API changesengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.
Description
Using the Flutter master branch, this code fails to render the image:
final recorder = ui.PictureRecorder();
final canvas = ui.Canvas(recorder, Rect.fromLTWH(0.0, 0.0, 100.0, 100.0));
final paint = ui.Paint()..color = Colors.red;
final data = base64.decode('R0lGODdhZABkAIACAAZ/fwzAwCwAAAAAZABkAAACroyPqcvtD6OctNqLs968+w+G4kiW5omm6sq27gvH8kzX9o3n+s73/g8MCofE4g6ATCqXzKbzCY1Kp9Sq9YrNarfcrvcLDovH5LL5jE6r1+y2+w2Py+f0uv2Oz+v3/L7/DxgoOEhYaHiImKi4yNjo+AgZKTlJWWl5iZmpucnZ6fkJGio6SlpqeoqaqrrK2ur6CjtmNEtba3uLm6u7y9vr+wscLDxMXGx8jJysvPxTAAA7');
final codec = await ui.instantiateImageCodec(data);
final frame = await codec.getNextFrame();
canvas.drawImage(frame.image, ui.Offset.zero, paint);
canvas.drawLine(Offset.zero, Offset(100.0, 100.0), paint);
final picture = recorder.endRecording();
final image = picture.toImage(100, 100);
final imageBytes = await image.toByteData(format:ui.ImageByteFormat.png);the resulting png only contains the line, but not the bitmap image (base64).
using flutter run --enable-software-rendering the bitmap image is rendered correctly.
This bug is not present using the Flutter tag v0.5.7, after that it stopped working.
It is related to #17687, and #21618
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
c: API breakBackwards-incompatible API changesBackwards-incompatible API changesengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.