[Impeller] fix scaling of trampoline import of GLES textures into Vulkan. (#161331)

Not sure if this just needs the dpr transform or the entire canvas
transform.

Fixes https://github.com/flutter/flutter/issues/159688

## Before


![flutter_04](https://github.com/user-attachments/assets/be60b1d0-4e94-491c-b1da-a03d66897f12)


## After


![flutter_03](https://github.com/user-attachments/assets/64cca8b7-3ae7-4f40-af26-ae61d9ec6290)
This commit is contained in:
Jonah Williams
2025-01-09 12:39:29 -08:00
committed by GitHub
parent a38abc864c
commit 96dffbeda5
5 changed files with 211 additions and 5 deletions

View File

@@ -0,0 +1,54 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:android_driver_extensions/extension.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_driver/driver_extension.dart';
import 'src/allow_list_devices.dart';
const MethodChannel _channel = MethodChannel('other_face_texture');
Future<int> _fetchTexture(int width, int height) async {
final int? result = await _channel.invokeMethod<int>('initTexture', <String, int>{
'width': width,
'height': height,
});
return result!;
}
void main() async {
ensureAndroidOrIosDevice();
enableFlutterDriverExtension(commands: <CommandExtension>[nativeDriverCommands]);
// Run on full screen.
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
// Fetch the texture ID.
final Future<int> textureId = _fetchTexture(512, 512);
runApp(MainApp(textureId));
}
final class MainApp extends StatelessWidget {
const MainApp(this.textureId, {super.key});
final Future<int> textureId;
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: FutureBuilder<int>(
future: textureId,
builder: (BuildContext context, AsyncSnapshot<int> snapshot) {
if (snapshot.hasData) {
return Texture(textureId: snapshot.data!);
}
return const CircularProgressIndicator();
},
),
);
}
}