From 6d87b4bd5c5580a8807bfec9198fab34e805fd6d Mon Sep 17 00:00:00 2001 From: Bruno Salmon Date: Wed, 11 Oct 2023 10:13:21 +0100 Subject: [PATCH] Added supportsSvgImageFormat() test method in WebFX kit --- .../spi/impl/gwt/GwtWebFxKitLauncherProvider.java | 7 ++++++- .../java/dev/webfx/kit/launcher/WebFxKitLauncher.java | 8 ++++++-- .../webfx/kit/launcher/spi/WebFxKitLauncherProvider.java | 4 +++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/webfx-kit/webfx-kit-gwt/src/main/java/dev/webfx/kit/launcher/spi/impl/gwt/GwtWebFxKitLauncherProvider.java b/webfx-kit/webfx-kit-gwt/src/main/java/dev/webfx/kit/launcher/spi/impl/gwt/GwtWebFxKitLauncherProvider.java index d69a4194d..f6fe2099f 100644 --- a/webfx-kit/webfx-kit-gwt/src/main/java/dev/webfx/kit/launcher/spi/impl/gwt/GwtWebFxKitLauncherProvider.java +++ b/webfx-kit/webfx-kit-gwt/src/main/java/dev/webfx/kit/launcher/spi/impl/gwt/GwtWebFxKitLauncherProvider.java @@ -129,7 +129,12 @@ private static Rectangle2D toRectangle2D(double width, double height) { } @Override - public boolean supportsWebP() { + public boolean supportsSvgImageFormat() { + return true; + } + + @Override + public boolean supportsWebPImageFormat() { return supportsWebPJS(); } diff --git a/webfx-kit/webfx-kit-launcher/src/main/java/dev/webfx/kit/launcher/WebFxKitLauncher.java b/webfx-kit/webfx-kit-launcher/src/main/java/dev/webfx/kit/launcher/WebFxKitLauncher.java index fcf40155d..7b71a65da 100644 --- a/webfx-kit/webfx-kit-launcher/src/main/java/dev/webfx/kit/launcher/WebFxKitLauncher.java +++ b/webfx-kit/webfx-kit-launcher/src/main/java/dev/webfx/kit/launcher/WebFxKitLauncher.java @@ -56,8 +56,12 @@ public static double getVerticalScrollbarExtraWidth() { return getProvider().getVerticalScrollbarExtraWidth(); } - public static boolean supportsWebP() { - return getProvider().supportsWebP(); + public static boolean supportsSvgImageFormat() { + return getProvider().supportsSvgImageFormat(); + } + + public static boolean supportsWebPImageFormat() { + return getProvider().supportsWebPImageFormat(); } public static FastPixelReaderWriter getFastPixelReaderWriter(Image image) { diff --git a/webfx-kit/webfx-kit-launcher/src/main/java/dev/webfx/kit/launcher/spi/WebFxKitLauncherProvider.java b/webfx-kit/webfx-kit-launcher/src/main/java/dev/webfx/kit/launcher/spi/WebFxKitLauncherProvider.java index fb48fa30b..c25aec88a 100644 --- a/webfx-kit/webfx-kit-launcher/src/main/java/dev/webfx/kit/launcher/spi/WebFxKitLauncherProvider.java +++ b/webfx-kit/webfx-kit-launcher/src/main/java/dev/webfx/kit/launcher/spi/WebFxKitLauncherProvider.java @@ -56,7 +56,9 @@ default double getVerticalScrollbarExtraWidth() { return 0; } - default boolean supportsWebP() { return false; } + default boolean supportsSvgImageFormat() { return false; } + + default boolean supportsWebPImageFormat() { return false; } FastPixelReaderWriter getFastPixelReaderWriter(Image image);