Skip to content

Commit b973c1a

Browse files
committed
Checks for hardware acceleration support
Verifies hardware acceleration capabilities on Android views by checking `IsHardwareAccelerated` and `LayerType`. * Ensures the view is hardware accelerated. * Adds debug logging to indicate hardware acceleration status.
1 parent e9c9907 commit b973c1a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

AuroraControlsMaui/Extensions/ImageSourceExtensions.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,15 +335,19 @@ public static Page SetSvgIcon(this Page page, string svgName, double squareSize
335335
private static bool SupportsHardwareAcceleration(this Element view)
336336
{
337337
bool supportsHardwareAcceleration = true;
338-
/*
338+
339339
#if ANDROID
340340
supportsHardwareAcceleration =
341341
view.Handler?.PlatformView is Android.Views.View
342342
{
343343
IsHardwareAccelerated: true,
344+
LayerType: Android.Views.LayerType.Hardware,
344345
};
346+
#if DEBUG
347+
Console.WriteLine($"Control is hardware accelerated: {supportsHardwareAcceleration}");
348+
#endif
345349
#endif
346-
*/
350+
347351
return supportsHardwareAcceleration;
348352
}
349353
}

0 commit comments

Comments
 (0)