Compare commits

...

12 Commits

Author SHA1 Message Date
Vitaly Provodin
f8ca4def4d JBR-6246 revert default CDS archives for linux-x64 and windows-aarch64 2023-12-01 15:51:22 +07:00
Vitaly Provodin
ede444e51f JBR-6246 revert adding (re)generating cds archives at jlink step for linux 2023-12-01 05:09:32 +07:00
Vitaly Provodin
b43d800b5d JBR-6246 revert adding (re)generating cds archives at jlink step for windows-aarch64 2023-11-30 04:08:42 +07:00
Vitaly Provodin
71d7c4a14c JBR-6246 add (re)generating cds archives at jlink step 2023-11-29 14:44:58 +07:00
Vitaly Provodin
ca005a6981 Revert "Revert "JBR-6246 add default CDS archives into jbrsdk distributions and remove the step normalizing timestamp""
This reverts commit c5cda34f96.
2023-11-29 04:10:25 +07:00
Vitaly Provodin
4538355628 Revert "JBR-5965 Wayland: implement SplashScreen"
This reverts commit 825eb901
2023-11-28 20:36:22 +07:00
Vitaly Provodin
bb9479962d Revert "fixup! JBR-5965 Wayland: implement SplashScreen"
This reverts commit 0ba8323f49.
2023-11-28 20:33:39 +07:00
Vitaly Provodin
75e96569c0 Revert "fixup! JBR-5965 Wayland: implement SplashScreen"
This reverts commit 0b777f2360.
2023-11-28 20:33:39 +07:00
Vitaly Provodin
115d90bf30 Revert "fixup! JBR-5965 Wayland: implement SplashScreen"
This reverts commit 5ae7a8673a.
2023-11-28 20:33:39 +07:00
Vitaly Provodin
04d4f01d59 update exclude list on results of 21.0.1_b303.1 test runs 2023-11-28 20:33:28 +07:00
Vitaly Provodin
5b70b42311 JBR-3902 create jbr_all test group 2023-11-28 05:39:52 +07:00
Vitaly Provodin
c5cda34f96 Revert "JBR-6246 add default CDS archives into jbrsdk distributions and remove the step normalizing timestamp"
This reverts commit be6842220b.
2023-11-25 09:25:20 +07:00
37 changed files with 409 additions and 1235 deletions

View File

@@ -70,7 +70,7 @@ function create_image_bundle {
[ -d "$IMAGES_DIR"/"$__root_dir" ] && rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
$JSDK/bin/jlink \
--module-path "$__modules_path" --no-man-pages --compress=2 \
--add-modules "$__modules" --output "$IMAGES_DIR"/"$__root_dir"
--generate-cds-archive --add-modules "$__modules" --output "$IMAGES_DIR"/"$__root_dir"
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> "$IMAGES_DIR"/"$__root_dir"/release
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then

View File

@@ -77,7 +77,6 @@ function create_image_bundle {
sed 's/JBR/JBRSDK/g' "$IMAGES_DIR"/"$__root_dir"/release > release
mv release "$IMAGES_DIR"/"$__root_dir"/release
cp $IMAGES_DIR/jdk/lib/src.zip "$IMAGES_DIR"/"$__root_dir"/lib
cp $IMAGES_DIR/jdk/lib/server/*.jsa "$IMAGES_DIR"/"$__root_dir"/lib/server
copy_jmods "$__modules" "$__modules_path" "$IMAGES_DIR"/"$__root_dir"/jmods
zip_native_debug_symbols $IMAGES_DIR/jdk "${JBR}_diz"
fi

View File

@@ -58,7 +58,7 @@ function create_image_bundle {
[ -d "$IMAGES_DIR"/"$__root_dir" ] && rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
$JSDK/bin/jlink \
--module-path "$__modules_path" --no-man-pages --compress=2 \
--add-modules "$__modules" --output "$IMAGES_DIR"/"$__root_dir"
--generate-cds-archive --add-modules "$__modules" --output "$IMAGES_DIR"/"$__root_dir"
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> "$IMAGES_DIR"/"$__root_dir"/release
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then

View File

@@ -65,7 +65,7 @@ function create_image_bundle {
echo Running jlink...
"$JSDK"/bin/jlink \
--module-path "$__modules_path" --no-man-pages --compress=2 \
--add-modules "$__modules" --output "$JRE_CONTENTS/Home" || do_exit $?
--generate-cds-archive --add-modules "$__modules" --output "$JRE_CONTENTS/Home" || do_exit $?
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> "$JRE_CONTENTS/Home/release"
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
@@ -133,6 +133,8 @@ JSDK=$IMAGES_DIR/jdk-bundle/jdk-$JBSDK_VERSION.jdk/Contents/Home
JSDK_MODS_DIR=$IMAGES_DIR/jmods
JBRSDK_BUNDLE=jbrsdk
# test/jdk/jb/java/awt/Focus/FullScreenFocusStealing.java test/jdk/java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java test/jdk/java/awt/datatransfer/DataFlavor/DataFlavorRemoteTest.java test/jdk/java/awt/Robot/NonEmptyErrorStream.java
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
update_jsdk_mods "$JSDK" "$JCEF_PATH"/jmods "$JSDK"/jmods "$JSDK_MODS_DIR" || do_exit $?

View File

@@ -75,7 +75,6 @@ function create_image_bundle {
sed 's/JBR/JBRSDK/g' $__root_dir/release > release
mv release $__root_dir/release
cp $IMAGES_DIR/jdk/lib/src.zip $__root_dir/lib
cp $IMAGES_DIR/jdk/bin/server/*.jsa $__root_dir/bin/server
for dir in $(ls -d $IMAGES_DIR/jdk/*); do
rsync -amv --include="*/" --include="*.pdb" --exclude="*" $dir $__root_dir
done

View File

@@ -59,7 +59,7 @@ function create_image_bundle {
echo Running jlink ...
${JSDK}/bin/jlink \
--module-path $__modules_path --no-man-pages --compress=2 \
--add-modules $__modules --output $__root_dir || do_exit $?
--generate-cds-archive --add-modules $__modules --output $__root_dir || do_exit $?
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> $__root_dir/release
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then

View File

@@ -55,7 +55,7 @@ function create_image_bundle {
echo Running jlink ...
${JSDK}/bin/jlink \
--module-path $__modules_path --no-man-pages --compress=2 \
--add-modules $__modules --output $__root_dir || do_exit $?
--generate-cds-archive --add-modules $__modules --output $__root_dir || do_exit $?
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> $__root_dir/release
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then

View File

@@ -364,7 +364,6 @@ ifeq ($(call isTargetOs, windows macosx), false)
common/awt \
common/java2d \
common/font \
common/wayland \
#
LIBAWT_WLAWT_EXCLUDES := medialib debug opengl x11
@@ -385,7 +384,6 @@ ifeq ($(call isTargetOs, windows macosx), false)
common/font \
common/java2d/wl \
common/java2d/vulkan \
common/wayland \
libvmahpp \
#
@@ -900,7 +898,6 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
#
LIBSPLASHSCREEN_HEADER_DIRS += common/awt/utility
LIBSPLASHSCREEN_HEADER_DIRS += common/awt/systemscale
ifeq ($(USE_EXTERNAL_LIBGIF), false)
LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/giflib
@@ -956,8 +953,6 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
endif
endif
LIBSPLASHSCREEN_CFLAGS += $(CFLAGS_JDKLIB) $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS)
ifeq ($(call isTargetOs, macosx), true)
LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
@@ -972,10 +967,11 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
else ifeq ($(call isTargetOs, windows), true)
LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
else
LIBWLSPLASHSCREEN_CFLAGS := -DWITH_WL $(LIBSPLASHSCREEN_CFLAGS) $(X_CFLAGS)
LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
endif
LIBSPLASHSCREEN_LIBS :=
ifeq ($(call isTargetOs, macosx), true)
LIBSPLASHSCREEN_LIBS += \
$(LIBM) -lpthread -liconv -losxapp \
@@ -991,59 +987,48 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
endif
LIBSPLASHSCREEN_HEADER_DIRS += \
libsplashscreen \
libosxapp \
java.base:libjava \
#
LIBSPLASHSCREEN_EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c
LIBSPLASHSCREEN_LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN)
LIBSPLASHSCREEN_LIBS := $(JDKLIB_LIBS) $(LIBSPLASHSCREEN_LIBS) $(LIBZ_LIBS) $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS)
LIBSPLASHSCREEN_DISABLED_WARNINGS_gcc := sign-compare implicit-fallthrough shift-negative-value maybe-uninitialized unused-function type-limits unused-result
LIBSPLASHSCREEN_DISABLED_WARNINGS_clang := deprecated-non-prototype format-nonliteral sign-compare incompatible-pointer-types deprecated-declarations
LIBSPLASHSCREEN_DISABLED_WARNINGS_microsoft := 4018 4267 4244
LIBWLSPLASHSCREEN_HEADER_DIRS := common/wayland
LIBWLSPLASHSCREEN_EXTRA_SRC := common/wayland
$(eval $(call SetupJdkLibrary, BUILD_LIBSPLASHSCREEN, \
NAME := splashscreen, \
EXTRA_SRC := $(LIBSPLASHSCREEN_EXTRA_SRC) libxsplashscreen libsplashscreen, \
EXTRA_SRC := $(LIBSPLASHSCREEN_EXTRA_SRC), \
EXCLUDE_SRC_PATTERNS := $(LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS), \
DISABLED_WARNINGS_gcc := $(LIBSPLASHSCREEN_DISABLED_WARNINGS_gcc), \
DISABLED_WARNINGS_clang := $(LIBSPLASHSCREEN_DISABLED_WARNINGS_clang), \
DISABLED_WARNINGS_microsoft := $(LIBSPLASHSCREEN_DISABLED_WARNINGS_microsoft), \
EXCLUDE_FILES := $(LIBSPLASHSCREEN_EXCLUDE_FILES), \
EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
OPTIMIZATION := LOW, \
CFLAGS := $(LIBSPLASHSCREEN_CFLAGS), \
EXTRA_HEADER_DIRS := libxsplashscreen $(LIBSPLASHSCREEN_HEADER_DIRS), \
LDFLAGS := $(LIBSPLASHSCREEN_LDFLAGS), \
CFLAGS := $(CFLAGS_JDKLIB) $(LIBSPLASHSCREEN_CFLAGS) \
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
EXTRA_HEADER_DIRS := $(LIBSPLASHSCREEN_HEADER_DIRS), \
DISABLED_WARNINGS_gcc_dgif_lib.c := sign-compare, \
DISABLED_WARNINGS_gcc_jcmaster.c := implicit-fallthrough, \
DISABLED_WARNINGS_gcc_jdphuff.c := shift-negative-value, \
DISABLED_WARNINGS_gcc_png.c := maybe-uninitialized, \
DISABLED_WARNINGS_gcc_pngerror.c := maybe-uninitialized, \
DISABLED_WARNINGS_gcc_splashscreen_gfx_impl.c := implicit-fallthrough maybe-uninitialized, \
DISABLED_WARNINGS_gcc_splashscreen_impl.c := implicit-fallthrough sign-compare unused-function, \
DISABLED_WARNINGS_gcc_splashscreen_sys.c := type-limits unused-result, \
DISABLED_WARNINGS_clang := deprecated-non-prototype, \
DISABLED_WARNINGS_clang_dgif_lib.c := sign-compare, \
DISABLED_WARNINGS_clang_gzwrite.c := format-nonliteral, \
DISABLED_WARNINGS_clang_splashscreen_impl.c := sign-compare, \
DISABLED_WARNINGS_clang_splashscreen_png.c := incompatible-pointer-types, \
DISABLED_WARNINGS_clang_splashscreen_sys.m := deprecated-declarations, \
DISABLED_WARNINGS_microsoft_dgif_lib.c := 4018 4267, \
DISABLED_WARNINGS_microsoft_splashscreen_impl.c := 4018 4267 4244, \
DISABLED_WARNINGS_microsoft_splashscreen_png.c := 4267, \
DISABLED_WARNINGS_microsoft_splashscreen_sys.c := 4267 4244, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_macosx := -L$(INSTALL_LIBRARIES_HERE), \
LDFLAGS_windows := -delayload:user32.dll, \
LIBS := $(LIBSPLASHSCREEN_LIBS), \
LIBS_aix := -liconv, \
))
$(eval $(call SetupJdkLibrary, BUILD_LIBWLSPLASHSCREEN, \
NAME := wlsplashscreen, \
EXTRA_SRC := $(LIBSPLASHSCREEN_EXTRA_SRC) $(LIBWLSPLASHSCREEN_EXTRA_SRC) libwlsplashscreen libsplashscreen, \
EXCLUDE_SRC_PATTERNS := $(LIBSPLASHSCREEN_EXCLUDE_SRC_PATTERNS), \
DISABLED_WARNINGS_gcc := $(LIBSPLASHSCREEN_DISABLED_WARNINGS_gcc), \
DISABLED_WARNINGS_clang := $(LIBSPLASHSCREEN_DISABLED_WARNINGS_clang), \
EXCLUDE_FILES := $(LIBSPLASHSCREEN_EXCLUDE_FILES), \
EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
OPTIMIZATION := LOW, \
CFLAGS := $(LIBWLSPLASHSCREEN_CFLAGS), \
EXTRA_HEADER_DIRS := $(LIBSPLASHSCREEN_HEADER_DIRS) $(LIBWLSPLASHSCREEN_HEADER_DIRS) libwlsplashscreen, \
LDFLAGS := $(LIBSPLASHSCREEN_LDFLAGS) -lrt, \
LIBS := -lwayland-client -lwayland-cursor $(LIBSPLASHSCREEN_LIBS) -lrt, \
LIBS := $(JDKLIB_LIBS) $(LIBSPLASHSCREEN_LIBS) $(LIBZ_LIBS) \
$(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(PNG_LIBS), \
LIBS_aix := -liconv, \
))
TARGETS += $(BUILD_LIBSPLASHSCREEN)
ifeq ($(call isTargetOs, linux), true)
TARGETS += $(BUILD_LIBWLSPLASHSCREEN)
endif
ifeq ($(call isTargetOs, macosx), true)
$(BUILD_LIBSPLASHSCREEN): $(call FindLib, $(MODULE), osxapp)

View File

@@ -154,17 +154,6 @@
/* Store the name of the executable once computed */
static char *execname = NULL;
typedef enum awt_toolkit {
TK_UNKNOWN = 0,
TK_X11 = 1,
TK_WAYLAND = 2
} awt_toolkit;
// TODO when wayland support will be fully implemented change to TK_UNKNOWN
// currently wayland support is not Production-Ready ready so default awt toolkit is X11
// wayland could be chosen manually via passing -Dawt.toolkit.name=WLToolkit argument
static awt_toolkit _awt_toolkit = TK_X11;
/*
* execname accessor from other parts of platform dependent logic
*/
@@ -657,6 +646,7 @@ SetExecname(char **argv)
}
/* --- Splash Screen shared library support --- */
static const char* SPLASHSCREEN_SO = JNI_LIB_NAME("splashscreen");
static void* hSplashLib = NULL;
void* SplashProcAddress(const char* name) {
@@ -669,15 +659,8 @@ void* SplashProcAddress(const char* name) {
JLI_ReportErrorMessage(JRE_ERROR1);
return NULL;
}
#if defined(__linux__)
const char* splash_screen_so = _awt_toolkit == TK_WAYLAND ?
JNI_LIB_NAME("wlsplashscreen") : JNI_LIB_NAME("splashscreen");
#else
const char* splash_screen_so = JNI_LIB_NAME("splashscreen");
#endif
ret = JLI_Snprintf(splashPath, sizeof(splashPath), "%s/lib/%s",
jrePath, splash_screen_so);
jrePath, SPLASHSCREEN_SO);
if (ret >= (int) sizeof(splashPath)) {
JLI_ReportErrorMessage(JRE_ERROR11);
@@ -764,34 +747,11 @@ CallJavaMainInNewThread(jlong stack_size, void* args) {
/* Coarse estimation of number of digits assuming the worst case is a 64-bit pid. */
#define MAX_PID_STR_SZ 20
static char*
getToolkitNameByEnv() {
if (_awt_toolkit == TK_UNKNOWN) {
char *xdg_session_type = getenv("XDG_SESSION_TYPE");
if (xdg_session_type != NULL && strcmp(xdg_session_type, "wayland") == 0) {
_awt_toolkit = TK_WAYLAND;
} else if (xdg_session_type != NULL && strcmp(xdg_session_type, "x11") == 0) {
_awt_toolkit = TK_X11;
} else if (getenv("DISPLAY") != NULL) {
_awt_toolkit = TK_X11;
} else if (getenv("WAYLAND_DISPLAY") != NULL) {
_awt_toolkit = TK_WAYLAND;
}
}
return _awt_toolkit == TK_WAYLAND ? "WLToolkit" : "XToolkit";
}
int
JVMInit(InvocationFunctions* ifn, jlong threadStackSize,
int argc, char **argv,
int mode, char *what, int ret)
{
char *toolkit_name = getToolkitNameByEnv();
size_t toolkit_name_size = JLI_StrLen("-Dawt.toolkit.name=") + JLI_StrLen(toolkit_name) + 1;
char *toolkit_option = (char *)JLI_MemAlloc(toolkit_name_size);
snprintf(toolkit_option, toolkit_name_size, "-Dawt.toolkit.name=%s", toolkit_name);
AddOption(toolkit_option, NULL);
ShowSplashScreen();
return ContinueInNewThread(ifn, threadStackSize, argc, argv, mode, what, ret);
}
@@ -808,16 +768,11 @@ RegisterThread()
// stubbed out for windows and *nixes.
}
/*
* on unix, we return a false to indicate this option is not applicable
*/
jboolean
ProcessPlatformOption(const char *arg)
{
if (JLI_StrCCmp(arg, "-Dawt.toolkit.name=WLToolkit") == 0) {
_awt_toolkit = TK_WAYLAND;
return JNI_TRUE;
} else if (JLI_StrCCmp(arg, "-Dawt.toolkit.name=XToolkit") == 0) {
_awt_toolkit = TK_X11;
return JNI_TRUE;
}
return JNI_FALSE;
}

View File

@@ -70,7 +70,4 @@ public class PlatformGraphicsInfo {
"but this program performed an operation which requires it.";
}
public static String getSplashScreenLib() {
return "splashscreen";
}
}

View File

@@ -288,7 +288,7 @@ SplashRedrawWindow(Splash * splash) {
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
// drop the reference to the old view and image
[splash->window setContentView: nil];
SplashUpdateScreenData(splash, false);
SplashUpdateScreenData(splash);
// NSDeviceRGBColorSpace vs. NSCalibratedRGBColorSpace ?
NSBitmapImageRep * rep = [[NSBitmapImageRep alloc]

View File

@@ -29,7 +29,6 @@ import java.awt.image.*;
import java.net.URL;
import java.net.URLConnection;
import java.io.File;
import sun.awt.PlatformGraphicsInfo;
import sun.util.logging.PlatformLogger;
import sun.awt.image.SunWritableRaster;
@@ -133,7 +132,7 @@ public final class SplashScreen {
java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<Void>() {
public Void run() {
System.loadLibrary(PlatformGraphicsInfo.getSplashScreenLib());
System.loadLibrary("splashscreen");
return null;
}
});

View File

@@ -29,10 +29,6 @@
/* splashscreen_gfx is a general purpose code for converting pixmaps between various visuals
it is not very effective, but is universal and concise */
#if !defined(WITH_WIN32)
#include "splashscreen_config_common.h"
#endif
#include "splashscreen_config.h"
enum

View File

@@ -25,8 +25,6 @@
#include "splashscreen_gfx_impl.h"
#include <stddef.h>
/* *INDENT-OFF* */
const byte_t baseDitherMatrix[DITHER_SIZE][DITHER_SIZE] = {
/* Bayer's order-4 dither array. Generated by the code given in

View File

@@ -132,7 +132,7 @@ SplashIsStillLooping(Splash * splash)
}
void
SplashUpdateScreenData(Splash * splash, bool reuseScreenData)
SplashUpdateScreenData(Splash * splash)
{
ImageRect srcRect, dstRect;
if (splash->currentFrame < 0) {
@@ -142,7 +142,7 @@ SplashUpdateScreenData(Splash * splash, bool reuseScreenData)
initRect(&srcRect, 0, 0, splash->width, splash->height, 1,
splash->width * sizeof(rgbquad_t),
splash->frames[splash->currentFrame].bitmapBits, &splash->imageFormat);
if (splash->screenData && !reuseScreenData) {
if (splash->screenData) {
free(splash->screenData);
}
splash->screenStride = splash->width * splash->screenFormat.depthBytes;
@@ -151,9 +151,7 @@ SplashUpdateScreenData(Splash * splash, bool reuseScreenData)
(splash->screenStride + splash->byteAlignment - 1) &
~(splash->byteAlignment - 1);
}
if (!reuseScreenData) {
splash->screenData = malloc(splash->height * splash->screenStride);
}
splash->screenData = malloc(splash->height * splash->screenStride);
initRect(&dstRect, 0, 0, splash->width, splash->height, 1,
splash->screenStride, splash->screenData, &splash->screenFormat);
if (splash->overlayData) {

View File

@@ -26,19 +26,10 @@
#ifndef SPLASHSCREEN_IMPL_H
#define SPLASHSCREEN_IMPL_H
#if !defined(WITH_WIN32)
#include "splashscreen_config_common.h"
#include "systemScale.h"
#include <pthread.h>
#endif
#include "splashscreen_config.h"
#include "splashscreen_gfx.h"
#include "jni.h"
#include <string.h>
#include <stdbool.h>
JNIEXPORT int
SplashLoadMemory(void *pdata, int size); /* requires preloading the file */
@@ -77,12 +68,6 @@ typedef struct SplashImage
#define SPLASH_COLOR_MAP_SIZE 0x100
typedef struct ScreenInfo {
int width;
int height;
int scale;
} ScreenInfo;
typedef struct Splash
{
ImageFormat screenFormat; /* must be preset before image decoding */
@@ -101,7 +86,6 @@ typedef struct Splash
ImageFormat overlayFormat;
void *screenData;
int screenStride; /* stored scanline length in bytes */
ScreenInfo screenInfo;
int currentFrame; // currentFrame==-1 means image is not loaded
int loopCount;
int x, y;
@@ -127,15 +111,6 @@ typedef struct Splash
pthread_mutex_t lock;
Cursor cursor;
XWMHints* wmHints;
#elif defined(WITH_WL)
int controlpipe[2];
Buffer main_buffer;
Buffer *buffers;
wayland_state *state;
int window_width;
int window_height;
int native_scale;
pthread_mutex_t lock;
#elif defined(WITH_MACOSX)
pthread_mutex_t lock;
int controlpipe[2];
@@ -176,7 +151,7 @@ void SplashNextFrame(Splash * splash);
void SplashStart(Splash * splash);
void SplashDone(Splash * splash);
void SplashUpdateScreenData(Splash * splash, bool reuseData);
void SplashUpdateScreenData(Splash * splash);
void SplashCleanup(Splash * splash);

View File

@@ -148,11 +148,4 @@ public class PlatformGraphicsInfo {
but this program performed an operation which requires it,
""";
}
public static String getSplashScreenLib() {
if (PlatformGraphicsInfo.getToolkitID() == PlatformGraphicsInfo.TK_WAYLAND) {
return "wlsplashscreen";
}
return "splashscreen";
}
}

View File

@@ -1,89 +0,0 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, JetBrains s.r.o.. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include "memory_utils.h"
#include <unistd.h>
#include <time.h>
#include <string.h>
#include <sys/mman.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
static void
RandomName(char *buf) {
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
long r = ts.tv_nsec;
while (*buf) {
*buf++ = 'A' + (r & 15) + (r & 16) * 2;
r >>= 5;
}
}
static int
CreateSharedMemoryFile(const char* baseName) {
// constructing the full name of the form /baseName-XXXXXX
int baseLen = strlen(baseName);
char *name = (char*) malloc(baseLen + 9);
if (!name)
return -1;
name[0] = '/';
strcpy(name + 1, baseName);
strcpy(name + baseLen + 1, "-XXXXXX");
int retries = 100;
do {
RandomName(name + baseLen + 2);
--retries;
int fd = shm_open(name, O_RDWR | O_CREAT | O_EXCL, 0600);
if (fd >= 0) {
shm_unlink(name);
free(name);
return fd;
}
} while (retries > 0 && errno == EEXIST);
free(name);
return -1;
}
int
AllocateSharedMemoryFile(size_t size, const char* baseName) {
int fd = CreateSharedMemoryFile(baseName);
if (fd < 0)
return -1;
int ret;
do {
ret = ftruncate(fd, size);
} while (ret < 0 && errno == EINTR);
if (ret < 0) {
close(fd);
return -1;
}
return fd;
}

View File

@@ -1,36 +0,0 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, JetBrains s.r.o.. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifndef MEMORY_UTILS_H
#define MEMORY_UTILS_H
#include <stdlib.h>
int
AllocateSharedMemoryFile(size_t size, const char* baseName);
#endif // MEMORY_UTILS_H

View File

@@ -50,7 +50,6 @@
#include "sun_awt_wl_WLToolkit.h"
#include "WLRobotPeer.h"
#include "WLGraphicsEnvironment.h"
#include "memory_utils.h"
#include "java_awt_event_KeyEvent.h"
#ifdef WAKEFIELD_ROBOT
@@ -1079,6 +1078,59 @@ void awt_output_flush()
wlFlushToServer(getEnv());
}
static void
RandomName(char *buf) {
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
long r = ts.tv_nsec;
while (*buf) {
*buf++ = 'A' + (r & 15) + (r & 16) * 2;
r >>= 5;
}
}
static int
CreateSharedMemoryFile(const char* baseName) {
// constructing the full name of the form /baseName-XXXXXX
int baseLen = strlen(baseName);
char *name = (char*) malloc(baseLen + 9);
if (!name)
return -1;
name[0] = '/';
strcpy(name + 1, baseName);
strcpy(name + baseLen + 1, "-XXXXXX");
int retries = 100;
do {
RandomName(name + baseLen + 2);
--retries;
int fd = shm_open(name, O_RDWR | O_CREAT | O_EXCL, 0600);
if (fd >= 0) {
shm_unlink(name);
free(name);
return fd;
}
} while (retries > 0 && errno == EEXIST);
free(name);
return -1;
}
static int
AllocateSharedMemoryFile(size_t size, const char* baseName) {
int fd = CreateSharedMemoryFile(baseName);
if (fd < 0)
return -1;
int ret;
do {
ret = ftruncate(fd, size);
} while (ret < 0 && errno == EINTR);
if (ret < 0) {
close(fd);
return -1;
}
return fd;
}
struct wl_shm_pool *CreateShmPool(size_t size, const char *name, void **data) {
if (size <= 0)
return NULL;

View File

@@ -30,7 +30,20 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/shape.h>
#include <sys/types.h>
#include <unistd.h>
#include <pthread.h>
#include <signal.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "systemScale.h"
typedef uint32_t rgbquad_t;
typedef uint16_t word_t;
typedef uint8_t byte_t;
typedef XRectangle RECT_T;
#define RECT_EQ_X(r1,r2) ((r1).x==(r2).x && (r1).width==(r2).width)
@@ -38,4 +51,10 @@ typedef XRectangle RECT_T;
(r).height=(hh);
#define RECT_INC_HEIGHT(r) (r).height++;
#define SPLASHCTL_QUIT 'Q'
#define SPLASHCTL_UPDATE 'U'
#define SPLASHCTL_RECONFIGURE 'R'
#define INLINE static
#endif

View File

@@ -1,43 +0,0 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, JetBrains s.r.o.. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifndef SPLASHSCREEN_CONFIG_COMMON_H
#define SPLASHSCREEN_CONFIG_COMMON_H
#include <inttypes.h>
typedef uint32_t rgbquad_t;
typedef uint16_t word_t;
typedef uint8_t byte_t;
#define SPLASHCTL_QUIT 'Q'
#define SPLASHCTL_UPDATE 'U'
#define SPLASHCTL_RECONFIGURE 'R'
#define INLINE static
#endif

View File

@@ -24,25 +24,85 @@
*/
#include "splashscreen_impl.h"
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/shape.h>
#include <X11/Xmd.h>
#include <X11/Xatom.h>
#include <X11/cursorfont.h>
#include <sys/types.h>
#include <pthread.h>
#include <signal.h>
#include <unistd.h>
#include <sys/time.h>
#include <errno.h>
#include <iconv.h>
#include <langinfo.h>
#include <locale.h>
#include <fcntl.h>
#include <poll.h>
#include <sizecalc.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "jni.h"
static Bool shapeSupported;
static int shapeEventBase, shapeErrorBase;
void SplashRemoveDecoration(Splash * splash);
/* Could use npt but decided to cut down on linked code size */
char* SplashConvertStringAlloc(const char* in, int* size) {
const char *codeset;
const char *codeset_out;
iconv_t cd;
size_t rc;
char *buf = NULL, *out;
size_t bufSize, inSize, outSize;
const char* old_locale;
if (!in) {
return NULL;
}
old_locale = setlocale(LC_ALL, "");
codeset = nl_langinfo(CODESET);
if ( codeset == NULL || codeset[0] == 0 ) {
goto done;
}
/* we don't need BOM in output so we choose native BE or LE encoding here */
codeset_out = (platformByteOrder()==BYTE_ORDER_MSBFIRST) ?
"UCS-2BE" : "UCS-2LE";
cd = iconv_open(codeset_out, codeset);
if (cd == (iconv_t)-1 ) {
goto done;
}
inSize = strlen(in);
buf = SAFE_SIZE_ARRAY_ALLOC(malloc, inSize, 2);
if (!buf) {
return NULL;
}
bufSize = inSize*2; // need 2 bytes per char for UCS-2, this is
// 2 bytes per source byte max
out = buf; outSize = bufSize;
/* linux iconv wants char** source and solaris wants const char**...
cast to void* */
rc = iconv(cd, (void*)&in, &inSize, &out, &outSize);
iconv_close(cd);
if (rc == (size_t)-1) {
free(buf);
buf = NULL;
} else {
if (size) {
*size = (bufSize-outSize)/2; /* bytes to wchars */
}
}
done:
setlocale(LC_ALL, old_locale);
return buf;
}
void
SplashInitFrameShape(Splash * splash, int imageIndex) {
ImageRect maskRect;
@@ -76,6 +136,25 @@ SplashInitFrameShape(Splash * splash, int imageIndex) {
free(rects);
}
unsigned
SplashTime(void) {
struct timeval tv;
struct timezone tz;
unsigned long long msec;
gettimeofday(&tv, &tz);
msec = (unsigned long long) tv.tv_sec * 1000 +
(unsigned long long) tv.tv_usec / 1000;
return (unsigned) msec;
}
void
msec2timeval(unsigned time, struct timeval *tv) {
tv->tv_sec = time / 1000;
tv->tv_usec = (time % 1000) * 1000;
}
int
GetNumAvailableColors(Display * display, Screen * screen, unsigned map_entries) {
unsigned long pmr[1];
@@ -129,8 +208,7 @@ FreeColors(Display * display, Screen * screen, int numColors,
XFreeColors(display, cmap, pr, numColors, 0);
}
static void
SplashCenter(Splash * splash) {
static void SplashCenter(Splash * splash) {
Atom type, atom, actual_type;
int status, actual_format;
unsigned long nitems, bytes_after;
@@ -158,8 +236,7 @@ SplashCenter(Splash * splash) {
splash->y = (XHeightOfScreen(splash->screen) - splash->height) / 2;
}
static void
SplashUpdateSizeHints(Splash * splash) {
static void SplashUpdateSizeHints(Splash * splash) {
if (splash->window) {
XSizeHints sizeHints;
@@ -172,7 +249,7 @@ SplashUpdateSizeHints(Splash * splash) {
}
}
bool
void
SplashCreateWindow(Splash * splash) {
XSizeHints sizeHints;
@@ -200,8 +277,6 @@ SplashCreateWindow(Splash * splash) {
splash->wmHints->initial_state = NormalState;
XSetWMHints(splash->display, splash->window, splash->wmHints);
}
return (bool) splash->window;
}
/* for changing the visible shape of a window to an nonrectangular form */
@@ -258,7 +333,7 @@ SplashRedrawWindow(Splash * splash) {
// much sense as SplashUpdateScreenData always re-generates
// the image completely, so whole window is always redrawn
SplashUpdateScreenData(splash, false);
SplashUpdateScreenData(splash);
ximage = XCreateImage(splash->display, splash->visual,
splash->screenFormat.depthBytes * 8, ZPixmap, 0, (char *) NULL,
splash->width, splash->height, 8, 0);
@@ -277,8 +352,7 @@ SplashRedrawWindow(Splash * splash) {
XFlush(splash->display);
}
void
SplashReconfigureNow(Splash * splash) {
void SplashReconfigureNow(Splash * splash) {
SplashCenter(splash);
if (splash->window) {
XUnmapWindow(splash->display, splash->window);
@@ -295,6 +369,15 @@ SplashReconfigureNow(Splash * splash) {
SplashRedrawWindow(splash);
}
void
sendctl(Splash * splash, char code) {
// if (splash->isVisible>0) {
if (splash && splash->controlpipe[1]) {
write(splash->controlpipe[1], &code, 1);
}
}
int
HandleError(Display * disp, XErrorEvent * err) {
// silently ignore non-fatal errors
@@ -465,38 +548,93 @@ SplashDonePlatform(Splash * splash) {
XCloseDisplay(splash->display);
}
bool
FlushEvents(Splash * splash) {
return true;
}
void
SplashEventLoop(Splash * splash) {
bool
DispatchEvents(Splash * splash) {
// we're not using "while(XPending)", processing one event
// at a time to avoid control pipe starvation
if (XPending(splash->display)) {
XEvent evt;
/* Different from win32 implementation - this loop
uses poll timeouts instead of a timer */
/* we should have splash _locked_ on entry!!! */
XNextEvent(splash->display, &evt);
switch (evt.type) {
case Expose:
if (splash->isVisible>0) {
// we're doing full redraw so we just
// skip the remaining painting events in the queue
while(XCheckTypedEvent(splash->display, Expose,
&evt));
SplashRedrawWindow(splash);
int xconn = XConnectionNumber(splash->display);
while (1) {
struct pollfd pfd[2];
int timeout = -1;
int ctl = splash->controlpipe[0];
int rc;
int pipes_empty;
pfd[0].fd = xconn;
pfd[0].events = POLLIN | POLLPRI;
pfd[1].fd = ctl;
pfd[1].events = POLLIN | POLLPRI;
errno = 0;
if (splash->isVisible>0 && SplashIsStillLooping(splash)) {
timeout = splash->time + splash->frames[splash->currentFrame].delay
- SplashTime();
if (timeout < 0) {
timeout = 0;
}
}
SplashUnlock(splash);
rc = poll(pfd, 2, timeout);
SplashLock(splash);
if (splash->isVisible > 0 && splash->currentFrame >= 0 &&
SplashTime() >= splash->time + splash->frames[splash->currentFrame].delay) {
SplashNextFrame(splash);
SplashUpdateShape(splash);
SplashRedrawWindow(splash);
}
if (rc <= 0) {
errno = 0;
continue;
}
pipes_empty = 0;
while(!pipes_empty) {
char buf;
pipes_empty = 1;
if (read(ctl, &buf, sizeof(buf)) > 0) {
pipes_empty = 0;
switch (buf) {
case SPLASHCTL_UPDATE:
if (splash->isVisible>0) {
SplashRedrawWindow(splash);
}
break;
case SPLASHCTL_RECONFIGURE:
if (splash->isVisible>0) {
SplashReconfigureNow(splash);
}
break;
case SPLASHCTL_QUIT:
return;
}
break;
/* ... */
}
// we're not using "while(XPending)", processing one event
// at a time to avoid control pipe starvation
if (XPending(splash->display)) {
XEvent evt;
pipes_empty = 0;
XNextEvent(splash->display, &evt);
switch (evt.type) {
case Expose:
if (splash->isVisible>0) {
// we're doing full redraw so we just
// skip the remaining painting events in the queue
while(XCheckTypedEvent(splash->display, Expose,
&evt));
SplashRedrawWindow(splash);
}
break;
/* ... */
}
}
}
}
return true;
}
int
GetDisplayFD(Splash * splash) {
return XConnectionNumber(splash->display);
}
/* we can't use OverrideRedirect for the window as the window should not be
@@ -587,13 +725,93 @@ SplashRemoveDecoration(Splash * splash) {
}
void
SplashSetup(Splash * splash) {
SplashRemoveDecoration(splash);
XStoreName(splash->display, splash->window, "Java");
XMapRaised(splash->display, splash->window);
SplashUpdateShape(splash);
SplashPThreadDestructor(void *arg) {
/* this will be used in case of emergency thread exit on xlib error */
Splash *splash = (Splash *) arg;
if (splash) {
SplashCleanup(splash);
}
}
void *
SplashScreenThread(void *param) {
Splash *splash = (Splash *) param;
// pthread_key_t key;
// pthread_key_create(&key, SplashPThreadDestructor);
// pthread_setspecific(key, splash);
SplashLock(splash);
pipe(splash->controlpipe);
fcntl(splash->controlpipe[0], F_SETFL,
fcntl(splash->controlpipe[0], F_GETFL, 0) | O_NONBLOCK);
splash->time = SplashTime();
SplashCreateWindow(splash);
fflush(stdout);
if (splash->window) {
SplashRemoveDecoration(splash);
XStoreName(splash->display, splash->window, "Java");
XMapRaised(splash->display, splash->window);
SplashUpdateShape(splash);
SplashRedrawWindow(splash);
//map the splash coordinates as per system scale
splash->x /= splash->scaleFactor;
splash->y /= splash->scaleFactor;
SplashEventLoop(splash);
}
SplashUnlock(splash);
SplashDone(splash);
splash->isVisible=-1;
return 0;
}
void
SplashUpdateCursor(Splash * splash) {
}
SplashCreateThread(Splash * splash) {
pthread_t thr;
pthread_attr_t attr;
int rc;
pthread_attr_init(&attr);
rc = pthread_create(&thr, &attr, SplashScreenThread, (void *) splash);
}
void
SplashLock(Splash * splash) {
pthread_mutex_lock(&splash->lock);
}
void
SplashUnlock(Splash * splash) {
pthread_mutex_unlock(&splash->lock);
}
void
SplashClosePlatform(Splash * splash) {
sendctl(splash, SPLASHCTL_QUIT);
}
void
SplashUpdate(Splash * splash) {
sendctl(splash, SPLASHCTL_UPDATE);
}
void
SplashReconfigure(Splash * splash) {
sendctl(splash, SPLASHCTL_RECONFIGURE);
}
JNIEXPORT jboolean
SplashGetScaledImageName(const char* jarName, const char* fileName,
float *scaleFactor, char *scaledImgName,
const size_t scaledImageNameLength)
{
*scaleFactor = 1;
#ifndef __linux__
return JNI_FALSE;
#endif
*scaleFactor = (float)getNativeScaleFactor(NULL, 1);
return GetScaledImageName(fileName, scaledImgName, scaleFactor, scaledImageNameLength);
}

View File

@@ -1,272 +0,0 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, JetBrains s.r.o.. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include "splashscreen_impl.h"
#include <sys/time.h>
#include <iconv.h>
#include <langinfo.h>
#include <locale.h>
#include <fcntl.h>
#include <poll.h>
#include <sizecalc.h>
#include <pthread.h>
#include <unistd.h>
const int POLL_EVENT_TIMEOUT = 50;
void SplashEventLoop(Splash * splash);
bool SplashCreateWindow(Splash * splash);
void SplashRedrawWindow(Splash * splash);
void SplashUpdateCursor(Splash * splash);
void SplashSetup(Splash * splash);
void SplashUpdateShape(Splash * splash);
bool SplashReconfigureNow(Splash * splash);
bool FlushEvents(Splash * splash);
bool DispatchEvents(Splash * splash);
int GetDisplayFD(Splash * splash);
/* Could use npt but decided to cut down on linked code size */
char*
SplashConvertStringAlloc(const char* in, int* size) {
const char *codeset;
const char *codeset_out;
iconv_t cd;
size_t rc;
char *buf = NULL, *out;
size_t bufSize, inSize, outSize;
const char* old_locale;
if (!in) {
return NULL;
}
old_locale = setlocale(LC_ALL, "");
codeset = nl_langinfo(CODESET);
if ( codeset == NULL || codeset[0] == 0 ) {
goto done;
}
/* we don't need BOM in output so we choose native BE or LE encoding here */
codeset_out = (platformByteOrder()==BYTE_ORDER_MSBFIRST) ?
"UCS-2BE" : "UCS-2LE";
cd = iconv_open(codeset_out, codeset);
if (cd == (iconv_t)-1 ) {
goto done;
}
inSize = strlen(in);
buf = SAFE_SIZE_ARRAY_ALLOC(malloc, inSize, 2);
if (!buf) {
return NULL;
}
bufSize = inSize*2; // need 2 bytes per char for UCS-2, this is
// 2 bytes per source byte max
out = buf; outSize = bufSize;
/* linux iconv wants char** source and solaris wants const char**...
cast to void* */
rc = iconv(cd, (void*)&in, &inSize, &out, &outSize);
iconv_close(cd);
if (rc == (size_t)-1) {
free(buf);
buf = NULL;
} else {
if (size) {
*size = (bufSize-outSize)/2; /* bytes to wchars */
}
}
done:
setlocale(LC_ALL, old_locale);
return buf;
}
void
SplashEventLoop(Splash * splash) {
struct pollfd pfd[2];
int rc;
unsigned lastCursorUpdate;
pfd[0].fd = splash->controlpipe[0];
pfd[0].events = POLLIN | POLLPRI;
pfd[0].revents = 0;
pfd[1].fd = GetDisplayFD(splash);
pfd[1].events = POLLIN | POLLPRI;
pfd[1].revents = 0;
lastCursorUpdate = SplashTime();
while (true) {
if (!FlushEvents(splash)) {
break;
}
if (splash->isVisible > 0 && splash->currentFrame >= 0 && SplashIsStillLooping(splash) &&
SplashTime() >= splash->time + splash->frames[splash->currentFrame].delay) {
SplashNextFrame(splash);
SplashUpdateShape(splash);
SplashRedrawWindow(splash);
}
SplashUnlock(splash);
rc = poll(pfd, 2, POLL_EVENT_TIMEOUT);
SplashLock(splash);
if (SplashTime() - lastCursorUpdate > 100) {
SplashUpdateCursor(splash);
lastCursorUpdate = SplashTime();
}
if (rc <= 0) {
continue;
}
if (pfd[1].revents) {
if (!DispatchEvents(splash)) {
break;
}
}
if (pfd[0].revents) {
char buf;
if (read(splash->controlpipe[0], &buf, sizeof(buf)) > 0) {
switch (buf) {
case SPLASHCTL_UPDATE:
if (splash->isVisible > 0) {
SplashRedrawWindow(splash);
}
break;
case SPLASHCTL_RECONFIGURE:
if (splash->isVisible > 0) {
if (!SplashReconfigureNow(splash)) {
return;
}
}
break;
case SPLASHCTL_QUIT:
return;
}
}
}
}
}
unsigned
SplashTime(void) {
struct timeval tv;
struct timezone tz;
unsigned long long msec;
gettimeofday(&tv, &tz);
msec = (unsigned long long) tv.tv_sec * 1000 + (unsigned long long) tv.tv_usec / 1000;
return (unsigned) msec;
}
void
SplashPThreadDestructor(void *data) {
Splash *splash = data;
if (splash) {
SplashCleanup(splash);
}
}
void *
SplashScreenThread(void *data) {
Splash *splash = data;
SplashLock(splash);
pipe(splash->controlpipe);
fcntl(splash->controlpipe[0], F_SETFL, fcntl(splash->controlpipe[0], F_GETFL, 0) | O_NONBLOCK);
splash->time = SplashTime();
bool init = SplashCreateWindow(splash);
fflush(stdout);
if (init) {
SplashSetup(splash);
SplashRedrawWindow(splash);
SplashEventLoop(splash);
}
SplashUnlock(splash);
SplashDone(splash);
splash->isVisible=-1;
return 0;
}
void
SplashCreateThread(Splash * splash) {
pthread_t thr;
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_create(&thr, &attr, SplashScreenThread, (void *) splash);
}
void
sendctl(Splash * splash, char code) {
if (splash && splash->controlpipe[1]) {
write(splash->controlpipe[1], &code, 1);
}
}
void
SplashLock(Splash * splash) {
pthread_mutex_lock(&splash->lock);
}
void
SplashUnlock(Splash * splash) {
pthread_mutex_unlock(&splash->lock);
}
void
SplashClosePlatform(Splash * splash) {
sendctl(splash, SPLASHCTL_QUIT);
}
void
SplashUpdate(Splash * splash) {
sendctl(splash, SPLASHCTL_UPDATE);
}
void
SplashReconfigure(Splash * splash) {
sendctl(splash, SPLASHCTL_RECONFIGURE);
}
JNIEXPORT jboolean
SplashGetScaledImageName(const char* jarName, const char* fileName,
float *scaleFactor, char *scaledImgName,
const size_t scaledImageNameLength) {
*scaleFactor = 1;
#ifndef __linux__
return JNI_FALSE;
#endif
*scaleFactor = (float) getNativeScaleFactor(NULL, 1);
return GetScaledImageName(fileName, scaledImgName, scaleFactor, scaledImageNameLength);
}

View File

@@ -1,67 +0,0 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, JetBrains s.r.o.. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifndef SPLASHSCREEN_CONFIG_H
#define SPLASHSCREEN_CONFIG_H
#include <stdbool.h>
typedef struct Buffer {
void *data;
int size;
struct wl_buffer *wl_buffer;
bool available;
} Buffer;
typedef struct wayland_state {
struct wl_display *wl_display;
struct wl_registry *wl_registry;
struct wl_shm *wl_shm;
struct wl_compositor *wl_compositor;
struct wl_subcompositor *wl_subcompositor;
struct wl_output *wl_output;
struct wl_seat *wl_seat;
struct wl_pointer *pointer;
struct xdg_wm_base *xdg_wm_base;
struct wl_surface *wl_surface;
struct wl_surface *wl_subsurfaces_surface;
struct wl_subsurface *wl_subsurfaces_subsurface;
struct xdg_surface *xdg_surface;
struct xdg_toplevel *xdg_toplevel;
struct wl_cursor_theme *cursor_theme;
struct wl_cursor *default_cursor;
struct wl_surface *cursor_surface;
} wayland_state;
// Actually the following Rect machinery is unused since we don't use shapes
typedef int RECT_T;
#define RECT_EQ_X(r1,r2) ((r1) == (r2))
#define RECT_SET(r,xx,yy,ww,hh) ;
#define RECT_INC_HEIGHT(r) ;
#endif

View File

@@ -1,517 +0,0 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, JetBrains s.r.o.. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include "splashscreen_impl.h"
#include <fcntl.h>
#include <wayland-client.h>
#include <wayland-cursor.h>
#include <pthread.h>
#include <sys/mman.h>
#include <unistd.h>
#include "memory_utils.h"
#include "xdg-shell-client-protocol.h"
static const int BUFFERS_COUNT = 3;
static bool is_cursor_animated = false;
#define NULL_CHECK_CLEANUP(val, message) if (val == NULL) { fprintf(stderr, "%s\n", message); goto cleanup; }
#define NULL_CHECK(val, message) if (val == NULL) { fprintf(stderr, "%s\n", message); return false; }
#define DESTROY_NOT_NULL(val, destructor) if (val != NULL) { destructor(val); }
bool SplashReconfigureNow(Splash * splash);
void SplashRedrawWindow(Splash * splash);
void SplashReconfigure(Splash * splash);
static bool
alloc_buffer(int width, int height, struct wl_shm *wl_shm, Buffer *buffer, int format, int format_size) {
int size = width * height * format_size;
int fd = AllocateSharedMemoryFile(size, "splashscreen");
buffer->size = size;
if (fd == -1) {
return false;
}
buffer->data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (buffer->data == MAP_FAILED) {
close(fd);
return false;
}
struct wl_shm_pool *pool = wl_shm_create_pool(wl_shm, fd, size);
buffer->wl_buffer = wl_shm_pool_create_buffer(pool, 0, width, height, width * format_size, format);
if (buffer->wl_buffer == NULL) {
return false;
}
wl_shm_pool_destroy(pool);
close(fd);
return true;
}
static void
destroy_buffer(Buffer *buffer) {
if (buffer->data != MAP_FAILED && buffer->data != NULL) {
munmap(buffer->data, buffer->size);
}
if (buffer->wl_buffer) {
wl_buffer_destroy(buffer->wl_buffer);
}
}
static void
registry_global(void *data, struct wl_registry *wl_registry, uint32_t name, const char *interface, uint32_t version) {
wayland_state *state = data;
if (strcmp(interface, wl_shm_interface.name) == 0) {
state->wl_shm = wl_registry_bind(
wl_registry, name, &wl_shm_interface, 1);
} else if (strcmp(interface, wl_compositor_interface.name) == 0) {
state->wl_compositor = wl_registry_bind(
wl_registry, name, &wl_compositor_interface, 4);
} else if (strcmp(interface, wl_seat_interface.name) == 0) {
state->wl_seat = wl_registry_bind(
wl_registry, name, &wl_seat_interface, 1);
} else if (strcmp(interface, wl_subcompositor_interface.name) == 0) {
state->wl_subcompositor = wl_registry_bind(
wl_registry, name, &wl_subcompositor_interface, 1);
} else if (strcmp(interface, xdg_wm_base_interface.name) == 0) {
state->xdg_wm_base = wl_registry_bind(
wl_registry, name, &xdg_wm_base_interface, 1);
} else if (strcmp(interface, wl_output_interface.name) == 0) {
state->wl_output = wl_registry_bind(
wl_registry, name, &wl_output_interface, 2);
}
}
static void
registry_global_remove(void *data, struct wl_registry *wl_registry, uint32_t name) {
}
static const struct wl_registry_listener wl_registry_listener = {
.global = registry_global,
.global_remove = registry_global_remove,
};
static void
wl_buffer_release(void *data, struct wl_buffer *wl_buffer) {
Buffer* buffer = data;
buffer->available = true;
}
static const struct wl_buffer_listener wl_buffer_listener = {
.release = wl_buffer_release,
};
static void
wl_output_geometry(void *data, struct wl_output * wl_output, int32_t x, int32_t y, int32_t physical_width,
int32_t physical_height, int32_t subpixel, const char *make, const char *model, int32_t transform) {
}
static void
wl_output_scale(void *data, struct wl_output *wl_output, int32_t factor) {
ScreenInfo *output = data;
output->scale = factor;
}
static void
wl_output_mode(
void *data,
struct wl_output *wl_output,
uint32_t flags,
int32_t width,
int32_t height,
int32_t refresh) {
ScreenInfo *output = data;
output->width = width;
output->height = height;
}
static void
wl_output_done(
void *data,
struct wl_output *wl_output) {
}
struct wl_output_listener wl_output_listener = {
.geometry = &wl_output_geometry,
.mode = &wl_output_mode,
.done = &wl_output_done,
.scale = &wl_output_scale
};
void
xdg_surface_configure(void *data, struct xdg_surface *xdg_surface, uint32_t serial) {
struct Splash *splash = data;
xdg_surface_ack_configure(xdg_surface, serial);
SplashReconfigure(splash);
}
static const struct xdg_surface_listener xdg_surface_listener = {
.configure = xdg_surface_configure,
};
static void
handle_toplevel_configure(void *data, struct xdg_toplevel *toplevel, int32_t width, int32_t height,
struct wl_array *states) {
struct Splash *splash = data;
if (width > 0 && height > 0 && (splash->window_width == 0 || splash->window_height == 0)) {
splash->window_width = width;
splash->window_height = height;
}
SplashReconfigure(splash);
}
static const struct xdg_toplevel_listener xdg_toplevel_listener = {
.configure = handle_toplevel_configure,
};
static void
pointer_handle_enter(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface,
wl_fixed_t sx, wl_fixed_t sy) {
wayland_state *state = data;
is_cursor_animated = true;
struct wl_cursor_image *image = state->default_cursor->images[0];
wl_pointer_set_cursor(pointer, serial, state->cursor_surface, image->hotspot_x, image->hotspot_y);
}
static void
pointer_handle_leave(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface) {
is_cursor_animated = false;
}
static void
pointer_handle_motion(void *data, struct wl_pointer *pointer, uint32_t time, wl_fixed_t sx, wl_fixed_t sy) {
}
static void
pointer_handle_button(void *data, struct wl_pointer *wl_pointer,
uint32_t serial, uint32_t time, uint32_t button, uint32_t state) {
}
static const struct wl_pointer_listener pointer_listener = {
.enter = pointer_handle_enter,
.leave = pointer_handle_leave,
.motion = pointer_handle_motion,
.button = pointer_handle_button,
};
static void
seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps) {
wayland_state *state = data;
if ((caps & WL_SEAT_CAPABILITY_POINTER) && !state->pointer) {
state->pointer = wl_seat_get_pointer(seat);
wl_pointer_add_listener(state->pointer, &pointer_listener, state);
} else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && state->pointer) {
wl_pointer_destroy(state->pointer);
state->pointer = NULL;
}
}
static const struct wl_seat_listener wl_seat_listener = {
.capabilities = seat_handle_capabilities,
};
static void
xdg_wm_base_ping(void *data, struct xdg_wm_base *xdg_wm_base, uint32_t serial) {
xdg_wm_base_pong(xdg_wm_base, serial);
}
static const struct xdg_wm_base_listener xdg_wm_base_listener = {
.ping = xdg_wm_base_ping,
};
bool
SplashCreateWindow(Splash * splash) {
splash->native_scale = getNativeScaleFactor(NULL, 1);
if (splash->native_scale == -1.0) {
splash->native_scale = 1.0;
}
wl_output_add_listener(splash->state->wl_output, &wl_output_listener, &splash->screenInfo);
splash->state->wl_surface = wl_compositor_create_surface(splash->state->wl_compositor);
NULL_CHECK(splash->state->wl_surface, "Cannot create surface\n")
splash->state->wl_subsurfaces_surface = wl_compositor_create_surface(splash->state->wl_compositor);
NULL_CHECK(splash->state->wl_subsurfaces_surface, "Cannot create surface\n")
wl_surface_set_buffer_scale(splash->state->wl_subsurfaces_surface, (int) splash->scaleFactor);
wl_surface_set_buffer_scale(splash->state->wl_surface, splash->native_scale);
xdg_wm_base_add_listener(splash->state->xdg_wm_base, &xdg_wm_base_listener, splash->state);
splash->state->xdg_surface = xdg_wm_base_get_xdg_surface(splash->state->xdg_wm_base, splash->state->wl_surface);
NULL_CHECK(splash->state->xdg_surface, "Cannot get xdg_surface\n")
xdg_surface_add_listener(splash->state->xdg_surface, &xdg_surface_listener, splash);
splash->state->xdg_toplevel = xdg_surface_get_toplevel(splash->state->xdg_surface);
NULL_CHECK(splash->state->xdg_toplevel, "Cannot get xdg_toplevel\n")
xdg_toplevel_set_maximized(splash->state->xdg_toplevel);
xdg_toplevel_add_listener(splash->state->xdg_toplevel, &xdg_toplevel_listener, splash);
splash->state->cursor_surface = wl_compositor_create_surface(splash->state->wl_compositor);
NULL_CHECK(splash->state->cursor_surface, "Cannot get cursor_surface\n")
wl_seat_add_listener(splash->state->wl_seat, &wl_seat_listener, splash->state);
splash->state->wl_subsurfaces_subsurface = wl_subcompositor_get_subsurface(
splash->state->wl_subcompositor, splash->state->wl_subsurfaces_surface, splash->state->wl_surface);
NULL_CHECK(splash->state->wl_subsurfaces_subsurface, "Cannot create subsurface\n")
wl_subsurface_set_desync(splash->state->wl_subsurfaces_subsurface);
splash->state->cursor_theme = wl_cursor_theme_load(NULL, 32, splash->state->wl_shm);
NULL_CHECK(splash->state->cursor_theme, "unable to load default theme\n")
splash->state->default_cursor = wl_cursor_theme_get_cursor(splash->state->cursor_theme, "watch");
NULL_CHECK(splash->state->default_cursor, "unable to load pointer\n")
return true;
}
int
SplashInitPlatform(Splash * splash) {
pthread_mutex_init(&splash->lock, NULL);
splash->buffers = 0;
splash->window_width = 0;
splash->window_height = 0;
splash->state = malloc(sizeof(wayland_state));
NULL_CHECK_CLEANUP(splash->state, "Cannot allocate enough memory\n")
splash->buffers = malloc(sizeof(Buffer) * BUFFERS_COUNT);
NULL_CHECK_CLEANUP(splash->buffers, "Cannot allocate enough memory\n")
splash->state->wl_display = NULL;
splash->state->wl_registry = NULL;
splash->state->wl_shm = NULL;
splash->state->wl_compositor = NULL;
splash->state->wl_subcompositor = NULL;
splash->state->wl_seat = NULL;
splash->state->xdg_wm_base = NULL;
splash->state->wl_subsurfaces_subsurface = NULL;
splash->state->wl_surface = NULL;
splash->state->wl_subsurfaces_surface = NULL;
splash->state->xdg_surface = NULL;
splash->state->xdg_toplevel = NULL;
splash->state->pointer = NULL;
splash->state->cursor_surface = NULL;
splash->main_buffer.wl_buffer = NULL;
splash->main_buffer.data = NULL;
for (int i = 0; i < BUFFERS_COUNT; i++) {
splash->buffers[i].wl_buffer = NULL;
splash->buffers[i].data = NULL;
splash->buffers[i].available = false;
}
splash->byteAlignment = 1;
splash->maskRequired = 0;
initFormat(&splash->screenFormat, 0xff0000, 0xff00, 0xff, 0xff000000);
splash->screenFormat.byteOrder = BYTE_ORDER_LSBFIRST;
splash->screenFormat.depthBytes = 4;
splash->state->wl_display = wl_display_connect(NULL);
NULL_CHECK_CLEANUP(splash->state->wl_display, "Cannot connect to display\n")
splash->state->wl_registry = wl_display_get_registry(splash->state->wl_display);
NULL_CHECK_CLEANUP(splash->state->wl_registry, "Cannot get display's registry\n")
wl_registry_add_listener(splash->state->wl_registry, &wl_registry_listener, splash->state);
wl_display_roundtrip(splash->state->wl_display);
NULL_CHECK_CLEANUP(splash->state->wl_shm, "wl_shm not initialized\n")
NULL_CHECK_CLEANUP(splash->state->wl_compositor, "wl_compositor not initialized\n")
NULL_CHECK_CLEANUP(splash->state->wl_subcompositor, "wl_subcompositor not initialized\n")
NULL_CHECK_CLEANUP(splash->state->wl_seat, "wl_seat not initialized\n")
NULL_CHECK_CLEANUP(splash->state->xdg_wm_base, "xdg_wm_base not initialized\n")
NULL_CHECK_CLEANUP(splash->state->wl_output, "wl_output not initialized\n")
return true;
cleanup:
SplashDonePlatform(splash);
return false;
}
bool
SplashReconfigureNow(Splash * splash) {
int splash_scale = (int) splash->scaleFactor;
int offsetX = splash->screenInfo.width - splash->window_width * splash->screenInfo.scale;
int offsetY = splash->screenInfo.height - splash->window_height * splash->screenInfo.scale;
splash->x = (splash->screenInfo.width - splash->width / splash_scale) / 2;
splash->y = (splash->screenInfo.height - splash->height / splash_scale) / 2;
int localX = (splash->x - offsetX) / splash->screenInfo.scale;
int localY = (splash->y - offsetY) / splash->screenInfo.scale;
wl_subsurface_set_position(splash->state->wl_subsurfaces_subsurface, localX, localY);
destroy_buffer(&splash->main_buffer);
for (int i = 0; i < BUFFERS_COUNT; i++) {
destroy_buffer(&splash->buffers[i]);
splash->buffers[i].available = false;
}
struct wl_region *region = wl_compositor_create_region(splash->state->wl_compositor);
wl_region_subtract(region, 0, 0, splash->window_width, splash->window_height);
wl_region_add(region, localX, localY, splash->width / splash_scale, splash->height / splash_scale);
wl_surface_set_input_region(splash->state->wl_surface, region);
wl_surface_set_opaque_region(splash->state->wl_surface, region);
wl_region_destroy(region);
for (int i = 0; i < BUFFERS_COUNT; i++) {
if (!alloc_buffer(splash->width, splash->height, splash->state->wl_shm, &splash->buffers[i],
WL_SHM_FORMAT_XRGB8888, 4)) {
fprintf(stderr, "%s\n", "Cannot allocate enough memory");
return false;
}
wl_buffer_add_listener(splash->buffers[i].wl_buffer, &wl_buffer_listener, &splash->buffers[i]);
splash->buffers[i].available = true;
}
if (!alloc_buffer(splash->window_width * splash->native_scale, splash->window_height * splash->native_scale,
splash->state->wl_shm, &splash->main_buffer, WL_SHM_FORMAT_ARGB8888, 4)) {
fprintf(stderr, "%s\n", "Cannot allocate enough memory");
return false;
}
memset(splash->main_buffer.data, 0, splash->window_width * splash->window_height * 4);
wl_surface_attach(splash->state->wl_surface, splash->main_buffer.wl_buffer, 0, 0);
wl_surface_damage(splash->state->wl_surface, 0, 0, splash->window_width, splash->window_height);
wl_surface_commit(splash->state->wl_surface);
SplashRedrawWindow(splash);
return true;
}
void
SplashRedrawWindow(Splash * splash) {
for (int i = 0; i < BUFFERS_COUNT; i++) {
if (splash->buffers[i].available) {
splash->screenData = splash->buffers[i].data;
SplashUpdateScreenData(splash, true);
wl_surface_attach(splash->state->wl_subsurfaces_surface, splash->buffers[i].wl_buffer, 0, 0);
wl_surface_damage(splash->state->wl_subsurfaces_surface, 0, 0, splash->window_width, splash->window_height);
wl_surface_commit(splash->state->wl_subsurfaces_surface);
splash->buffers[i].available = false;
break;
}
}
}
bool
FlushEvents(Splash * splash) {
return wl_display_flush(splash->state->wl_display) != -1;
}
bool
DispatchEvents(Splash * splash) {
return wl_display_dispatch(splash->state->wl_display) != -1;
}
int
GetDisplayFD(Splash * splash) {
return wl_display_get_fd(splash->state->wl_display);
}
void
SplashUpdateCursor(Splash * splash) {
static int index = 0;
if (is_cursor_animated) {
wayland_state *state = splash->state;
struct wl_buffer *buffer;
struct wl_cursor *cursor = state->default_cursor;
struct wl_cursor_image *image;
if (cursor) {
image = state->default_cursor->images[index];
index = (index + 1) % (state->default_cursor->image_count);
buffer = wl_cursor_image_get_buffer(image);
if (!buffer)
return;
wl_surface_attach(state->cursor_surface, buffer, 0, 0);
wl_surface_damage(state->cursor_surface, 0, 0, image->width, image->height);
wl_surface_commit(state->cursor_surface);
}
}
}
void
SplashCleanupPlatform(Splash * splash) {
}
void
SplashDonePlatform(Splash * splash) {
pthread_mutex_destroy(&splash->lock);
if (splash == NULL) {
return;
}
DESTROY_NOT_NULL(splash->state->wl_shm, wl_shm_destroy)
DESTROY_NOT_NULL(splash->state->wl_compositor, wl_compositor_destroy)
DESTROY_NOT_NULL(splash->state->wl_subcompositor, wl_subcompositor_destroy)
DESTROY_NOT_NULL(splash->state->wl_seat, wl_seat_destroy)
DESTROY_NOT_NULL(splash->state->xdg_wm_base, xdg_wm_base_destroy)
DESTROY_NOT_NULL(splash->state->wl_subsurfaces_subsurface, wl_subsurface_destroy)
DESTROY_NOT_NULL(splash->state->wl_surface, wl_surface_destroy)
DESTROY_NOT_NULL(splash->state->wl_subsurfaces_surface, wl_surface_destroy)
DESTROY_NOT_NULL(splash->state->xdg_surface, xdg_surface_destroy)
DESTROY_NOT_NULL(splash->state->xdg_toplevel, xdg_toplevel_destroy)
DESTROY_NOT_NULL(splash->state->pointer, wl_pointer_destroy)
DESTROY_NOT_NULL(splash->state->cursor_surface, wl_surface_destroy)
destroy_buffer(&splash->main_buffer);
if (splash->buffers) {
for (int i = 0; i < BUFFERS_COUNT; i++) {
destroy_buffer(&splash->buffers[i]);
}
free(splash->buffers);
}
if (splash->state->wl_display) {
wl_display_flush(splash->state->wl_display);
wl_display_disconnect(splash->state->wl_display);
}
free(splash->state);
}
void
SplashSetup(Splash * splash) {
}
void
SplashUpdateShape(Splash * splash) {
}
void
SplashInitFrameShape(Splash * splash, int imageIndex) {
}

View File

@@ -55,7 +55,4 @@ public class PlatformGraphicsInfo {
"but this program performed an operation which requires it.";
}
public static String getSplashScreenLib() {
return "splashscreen";
}
}

View File

@@ -218,7 +218,7 @@ SplashRedrawWindow(Splash * splash)
return;
}
SplashUpdateScreenData(splash, false);
SplashUpdateScreenData(splash);
if (splash->isLayered) {
BLENDFUNCTION bf;
POINT ptSrc;

View File

@@ -47,7 +47,6 @@
# :hotspot_compiler
compiler/c2/irTests/TestVectorConditionalMove.java NOBUG windows-aarch64 # compiler.lib.ir_framework.driver.irmatching.IRViolationException: There were one or multiple IR rule failures. Please check stderr for more information.
compiler/ciReplay/TestInlining.java 8300210 generic-all
compiler/ciReplay/TestIncrementalInlining.java NOBUG generic-all
compiler/ciReplay/TestInliningProtectionDomain.java NOBUG generic-all
@@ -59,7 +58,6 @@ compiler/ciReplay/TestUnresolvedClasses.java NOBUG generic-all
# :hotspot_gc
gc/stress/gcold/TestGCOldWithShenandoah.java#iu-aggressive NOBUG generic-all timeout
#############################################################################
@@ -71,7 +69,7 @@ runtime/cds/appcds/dynamicArchive/TestDynamicDumpAtOom.java JBR-6291 generic-all
# :hotspot_serviceability
serviceability/sa/ClhsdbCDSCore.java NOBUG macosx-all Can't attach to the core file
serviceability/sa/ClhsdbCDSCore.java initial_run,NOBUG generic-aarch64,macosx-all Can't attach to the core file
#############################################################################

View File

@@ -89,6 +89,7 @@ compiler/rtm/locking/TestUseRTMDeopt.java 8183263 generic-x64
compiler/rtm/locking/TestUseRTMXendForLockBusy.java 8183263 generic-x64
compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java 8183263 generic-x64
compiler/c2/irTests/TestVectorConditionalMove.java 8306922 generic-all
compiler/c2/Test8004741.java 8235801 generic-all
compiler/vectorapi/VectorCastShape64Test.java initial_run generic-aarch64
@@ -110,7 +111,10 @@ gc/stress/TestJNIBlockFullGC/TestJNIBlockFullGC.java 8192647 generic-all
gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java 8241293 macosx-x64
gc/metaspace/TestMetaspacePerfCounters.java#id3 initial_run generic-all
gc/stress/gcold/TestGCOldWithShenandoah.java initial_run windows-all
gc/stress/gcold/TestGCOldWithShenandoah.java#aggressive NOBUG generic-all timeout
gc/stress/gcold/TestGCOldWithShenandoah.java#iu-aggressive NOBUG generic-all timeout
gc/TestAllocHumongousFragment.java#iu-aggressive 8298781 generic-all
#############################################################################
@@ -153,6 +157,8 @@ runtime/reflect/ReflectOutOfMemoryError.java 8316060 generic-all
serviceability/dcmd/vm/TrimLibcHeapTest.java 8312625 linux-all
serviceability/sa/sadebugd/DebugdConnectTest.java 8239062,8270326 macosx-x64,macosx-aarch64
serviceability/sa/TestJmapCore.java 8294316,8267433 macosx-x64
serviceability/sa/TestJmapCoreMetaspace.java 8294316,8267433 macosx-x64
serviceability/sa/TestRevPtrsForInvokeDynamic.java 8241235 generic-all
serviceability/jvmti/ModuleAwareAgents/ThreadStart/MAAThreadStart.java 8225354 windows-all
@@ -214,6 +220,7 @@ vmTestbase/nsk/jdi/LaunchingConnector/launchnosuspend/launchnosuspend001/TestDes
vmTestbase/nsk/jdi/ThreadReference/stop/stop001/TestDescription.java 7034630 generic-all
vmTestbase/nsk/jdi/ReferenceType/instances/instances002/instances002.java initial_run linux-all
vmTestbase/nsk/jdi/Value/type/type003/TestDescription.java time_out_intermittent macosx-all
vmTestbase/nsk/jdi/VirtualMachine/canGetMonitorInfo/cangetmonitorinfo001/TestDescription.java JBR-6361 macosx-all
vmTestbase/metaspace/gc/firstGC_10m/TestDescription.java 8208250 generic-all
vmTestbase/metaspace/gc/firstGC_50m/TestDescription.java 8208250 generic-all
@@ -224,6 +231,7 @@ vmTestbase/nsk/jvmti/AttachOnDemand/attach045/TestDescription.java 8202971 gener
vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/TestDescription.java 8219652 aix-ppc64
vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/TestDescription.java 8219652 aix-ppc64
vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab001/TestDescription.java 8219652 aix-ppc64
vmTestbase/nsk/jvmti/scenarios/capability/CM03/cm03t001/TestDescription.java 8073470 linux-all
vmTestbase/nsk/jvmti/scenarios/sampling/SP04/sp04t001/TestDescription.java initial_run windows-x64
vmTestbase/nsk/jvmti/scenarios/sampling/SP04/sp04t002/TestDescription.java initial_run windows-x64
@@ -244,7 +252,7 @@ vmTestbase/vm/mlvm/indy/func/jvmti/redefineClassInBootstrap/TestDescription.java
vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2none_a/TestDescription.java 8013267 generic-all
vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2manyDiff_b/TestDescription.java 8013267 generic-all
vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2manySame_b/TestDescription.java 8013267 generic-all
vmTestbase/vm/mlvm/meth/stress/compiler/deoptimize/Test.java#id0 8269393 macos-aarch64
vmTestbase/vm/mlvm/meth/stress/compiler/deoptimize/Test.java#id0 8269393 macosx-aarch64
vmTestbase/nsk/jdwp/ThreadReference/ForceEarlyReturn/forceEarlyReturn001/forceEarlyReturn001.java 7199837 generic-all

View File

@@ -429,10 +429,14 @@ jfc_demo = \
jdk_editpad = \
jdk/editpad
jbr_all = \
jb
jdk_desktop = \
:jdk_desktop_part1 \
:jdk_desktop_part2 \
:jdk_desktop_part3
:jdk_desktop_part3 \
:jbr_all
jdk_desktop_part1 = \
:jdk_client_sanity \

View File

@@ -111,9 +111,12 @@
############################################################################
java/awt/event/MouseEvent/AcceptExtraButton/AcceptExtraButton.java JBR-6353 linux-x64,windows-aarch64,macosx-all
java/awt/FlowLayout/PreferredLayoutSize.java JBR-6349 linux-all
java/awt/Frame/GetGraphicsStressTest/GetGraphicsStressTest.java NOBUG windows-all timeout
java/awt/MenuItem/EnableTest.java NOBUG windows-all timeout
java/awt/Robot/NonEmptyErrorStream.java JBR-6275 macosx-all
javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedPerPixelTranslucentGradient.java 8233582,JBR-6360 linux-all,windows-all
javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java NOBUG macosx-all Synth ButtonUI does not handle PRESSED & MOUSE_OVER state
javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java JBR-5952,JBR-6274 windows-x64,macosx-all

View File

@@ -49,7 +49,7 @@ javax/swing/SwingWorker/TestDoneBeforeDoInBackground.java JBR-5442 linux-all
javax/swing/text/html/StyleSheet/bug4936917.java JBR-899,JBR-5510,JBR-5442 windows-all,linux-all
javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java JBR-5952,JBR-5442 windows-x64,linux-all
java/awt/event/MouseEvent/AcceptExtraButton/AcceptExtraButton.java JBR-6353 linux-x64,windows-aarch64,macosx-all
java/awt/Choice/ChoiceGeneratesItemEvents.java JBR-551 linux-all
java/awt/Choice/ChoiceStaysOpenedOnTAB.java JBR-5510 linux-all
java/awt/Choice/PopdownGeneratesMouseEvents/PopdownGeneratesMouseEvents.java JBR-5510 linux-all
@@ -57,6 +57,7 @@ java/awt/ColorClass/AlphaColorTest.java JBR-5359,JBR-5510 windows-aarch64,linux-
java/awt/Component/RepaintTest.java JBR-5359,JBR-5510 windows-aarch64,linux-all
java/awt/Dialog/DialogAboveFrame/DialogAboveFrameTest.java JBR-5210,JBR-5510 windows-all,linux-all
java/awt/dnd/DnDTestWithHIDPI/DragTestWithHIDPI.java NOBUG linux-all
java/awt/FlowLayout/PreferredLayoutSize.java JBR-6349 linux-all
java/awt/Frame/InvisibleOwner/InvisibleOwner.java JBR-5359,JBR-5510 windows-aarch64,linux-all
java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java JBR-5210 windows-all,linux-all
java/awt/Graphics/XORPaint.java#id2 NOBUG linux-all

View File

@@ -1187,6 +1187,7 @@ java/awt/TextArea/TextAreaTwicePack/TextAreaTwicePack.java 8253184 windows-all
java/awt/TextField/OverScrollTest/OverScrollTest.java 8253184 windows-all
java/awt/event/MouseEvent/SpuriousExitEnter/SpuriousExitEnter.java 8254841 macosx-all
java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest1.java 8256289,JBR-5359 windows-x64,windows-aarch64
java/awt/Focus/RequestFocusByCause/RequestFocusByCauseTest.java JBR-6335 linux-all
java/awt/Focus/RemoveAfterRequest/RemoveAfterRequest.java JBR-6052 macosx-all,linux-all
java/awt/Focus/RowToleranceTransitivityTest.java JBR-5751 windows-all
java/awt/FullScreen/TranslucentWindow/TranslucentWindow.java 8258103,8253184 linux-all,windows-all

View File

@@ -4,6 +4,7 @@ java/awt/datatransfer/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.java JBR-6027 wind
java/awt/dnd/MissedDragEnterTest.java JBR-6091 windows-all
java/awt/event/KeyEvent/ExtendedModifiersTest/ExtendedModifiersTest.java JBR-6292 windows-all
java/awt/event/KeyEvent/KeyMaskTest/KeyMaskTest.java JBR-6292 windows-all
java/awt/event/MouseEvent/AcceptExtraButton/AcceptExtraButton.java JBR-6353 linux-x64,windows-aarch64,macosx-all
java/awt/event/MouseEvent/FrameMouseEventAbsoluteCoordsTest/FrameMouseEventAbsoluteCoordsTest.java 8238720,JBR-6095 windows-all,linux-all
java/awt/event/StressTest/MouseAndKeyEventStressTest.java JBR-6090 windows-all
java/awt/Focus/6378278/InputVerifierTest.java JBR-6090 windows-all