feat(android): enable impeller on capable TV devices

Impeller was blanket-disabled on TV in e759dafa as a precaution when the
Tensor/NVIDIA fallbacks landed, and #749 (API 30 Fire TV Cube freezing
until the Skia build) validated it. Flutter has since deprecated the
Impeller opt-out, so start walking the disable back where the hardware
can take it: TV devices on Android 12+ with a Vulkan 1.1 driver use
Impeller, while Fire OS (modern API levels on GPUs whose drivers can't
back it up), pre-12 boxes, and the existing NVIDIA/Huawei/e-waste quirks
stay on Skia. Tag Sentry events with the active renderer so TV
regressions are attributable while this rolls out.
This commit is contained in:
edde746
2026-07-05 02:28:51 +02:00
parent cd8212fb53
commit 7b1c150e18
2 changed files with 17 additions and 3 deletions
@@ -386,8 +386,6 @@ class MainActivity : FlutterActivity() {
}
private fun shouldDisableImpeller(): Boolean {
// Android TV devices — weaker GPUs, less Impeller testing
if (isAndroidTvDevice()) return true
if (DeviceQuirks.isEWaste) return true
// NVIDIA Tegra (Shield TV)
if (Build.MANUFACTURER.equals("NVIDIA", ignoreCase = true)) return true
@@ -397,9 +395,21 @@ class MainActivity : FlutterActivity() {
) {
return true
}
if (isAndroidTvDevice()) return !tvSupportsImpeller()
return false
}
// Impeller froze API 30 Fire TV hardware (#749) and Flutter's Vulkan → GLES
// fallback still miscompiles gradients/SVGs, so only TV devices on Android 12+
// with a Vulkan 1.1 driver leave the Skia path.
private fun tvSupportsImpeller(): Boolean {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return false
// Fire OS reports modern API levels on GPUs whose drivers can't back it up
if (Build.MANUFACTURER.equals("Amazon", ignoreCase = true)) return false
val vulkan11 = 0x401000 // FEATURE_VULKAN_HARDWARE_VERSION encodes 1.1.0 as 0x401000
return packageManager.hasSystemFeature(PackageManager.FEATURE_VULKAN_HARDWARE_VERSION, vulkan11)
}
override fun getRenderMode(): RenderMode {
// Keep Flutter in the normal View hierarchy so video/subtitle SurfaceViews
// remain the only native composition layers. This restores the pre-1.35.0
+5 -1
View File
@@ -213,7 +213,11 @@ Future<void> _bootstrapApp() async {
final commitSuffix = gitCommit.isNotEmpty ? ' (${gitCommit.substring(0, 7)})' : '';
String renderer = '';
if (Platform.isAndroid) {
renderer = ' [${await const MethodChannel('com.plezy/theme').invokeMethod<String>('getRenderer')}]';
final rendererName = await const MethodChannel('com.plezy/theme').invokeMethod<String>('getRenderer');
renderer = ' [$rendererName]';
// Tag crash reports with the active renderer while Impeller rolls back
// out to Android TV, so device-specific regressions are attributable.
unawaited(Sentry.configureScope((scope) => scope.setTag('renderer', rendererName ?? 'unknown')));
}
appLogger.i(
'Plezy v${packageInfo.version}+${packageInfo.buildNumber}$commitSuffix$renderer'