Compare commits

..

17 Commits

Author SHA1 Message Date
Nikita Gubarkov
02d36310f5 Lower Spir-V target version to match Vulkan 1.2 2023-09-06 15:19:44 +02:00
Nikita Gubarkov
afdfd15c92 Make dynamic rendering optional. 2023-09-06 15:19:44 +02:00
Nikita Gubarkov
bd7e216e4f Lower Vulkan version to 1.2 and use dynamic rendering extension. 2023-09-06 15:19:44 +02:00
Nikita Gubarkov
5ac65d371f Make synchronization2 optional. 2023-09-06 15:19:43 +02:00
Nikita Gubarkov
001e63aa13 Separate method for attaching native surface data to Java object. 2023-09-06 15:19:43 +02:00
Nikita Gubarkov
86bb3a5441 Memory management via VMA, vertex buffer pool, shader push constants. 2023-09-06 15:19:43 +02:00
Nikita Gubarkov
85811e97dd Enable logicOp feature for XOR painting mode. 2023-09-06 15:19:43 +02:00
Nikita Gubarkov
4618419f78 Shader compilation, test pipeline.
Shaders are compiled with glslc or glslangValidator and bytecode is inlined directly into libawt_wlawt
2023-09-06 15:19:43 +02:00
Nikita Gubarkov
634910f86c Split command recording into primary and secondary command buffers.
This allows us to record commands "in the past", before current render pass started, which gives possibility for some heavy optimizations:
1. When we suddenly need some texture in the middle of the render pass - no need to stop render pass in order to insert necessary synchronization - we can do it as if we knew it beforehand.
2. When we draw something and then clear the surface - just erase all commands inside current render pass we recorded earlier, so the actual drawing will never happen.
2023-09-06 15:19:43 +02:00
Nikita Gubarkov
544a6771c6 Each device has a single timeline semaphore (basically 64-bit counter), monotonically increasing as device executes our commands, allowing us to track the state of the submitted batches and reuse resources which are no longer in use. 2023-09-06 15:19:43 +02:00
Nikita Gubarkov
a554ca9888 State management, synchronization & layout transition.
Now using dynamic render passes and synchronization2 from Vulkan 1.3
2023-09-06 15:19:43 +02:00
Nikita Gubarkov
71224a9c95 Refactored native surface data hierarchy.
There was a C-style "inheritance" model with VKSDOps having an SurfaceDataOps as its first member and conversions back and forth between them. And then also privOps - pointer to the platform-specific part (WLVK).

This was refactored into plain inheritance:
SurfaceDataOps -> VKSurfaceData -> VKSwapchainSurfaceData -> WLVKSurfaceData

Also replaced pthread mutexes with std::recursive_mutex to move this abstraction up the hierarchy.
2023-09-06 15:19:43 +02:00
Nikita Gubarkov
dc03522baa Moved platform-independent part of WLVKSurfaceData into VKSwapchainSurfaceData 2023-09-06 15:19:43 +02:00
Nikita Gubarkov
57d46f4f82 Make debug messenger part of graphics configuration 2023-09-06 15:19:43 +02:00
Nikita Gubarkov
0e7602d8e1 Report which device was created 2023-09-06 15:19:43 +02:00
Nikita Gubarkov
ebba8f1aba Fixed validation errors (only). Added basic synchronization.
Merged physical and logical device into single entity.
Other refactoring.
2023-09-06 15:19:42 +02:00
Nikita Gubarkov
aa1d84f9e1 Get rid of maxTextureSize in Vulkan code.
This concept was introduced to fix macOS-specific bugs and don't map well to Vulkan implementation, as this value is tied to specific device and texture format, so get rid of it for now and see whether we need it at all.
2023-09-06 15:19:42 +02:00
32 changed files with 224 additions and 1313 deletions

View File

@@ -25,13 +25,9 @@
package com.jetbrains.internal;
import sun.security.action.GetBooleanAction;
import java.io.Serial;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@@ -101,8 +97,7 @@ import static java.lang.invoke.MethodHandles.Lookup;
* user to directly create proxy object.
*/
public class JBRApi {
@SuppressWarnings("removal")
static final boolean VERBOSE = AccessController.doPrivileged(new GetBooleanAction("jetbrains.api.verbose"));
static final boolean VERBOSE = Boolean.getBoolean("jetbrains.api.verbose");
private static final Map<String, RegisteredProxyInfo> registeredProxyInfoByInterfaceName = new HashMap<>();
private static final Map<String, RegisteredProxyInfo> registeredProxyInfoByTargetName = new HashMap<>();
@@ -210,22 +205,19 @@ public class JBRApi {
return this;
}
@SuppressWarnings("removal")
public Object build() {
return AccessController.doPrivileged((PrivilegedAction<Object>) () -> {
ProxyInfo info = ProxyInfo.resolve(this.info);
if (info == null) return null;
ProxyGenerator generator = new ProxyGenerator(info);
if (!generator.areAllMethodsImplemented()) return null;
generator.defineClasses();
MethodHandle constructor = generator.findConstructor();
generator.init();
try {
return constructor.invoke();
} catch (Throwable e) {
throw new RuntimeException(e);
}
});
ProxyInfo info = ProxyInfo.resolve(this.info);
if (info == null) return null;
ProxyGenerator generator = new ProxyGenerator(info);
if (!generator.areAllMethodsImplemented()) return null;
generator.defineClasses();
MethodHandle constructor = generator.findConstructor();
generator.init();
try {
return constructor.invoke();
} catch (Throwable e) {
throw new RuntimeException(e);
}
}
}

View File

@@ -190,10 +190,6 @@ public final class LWCToolkit extends LWToolkit {
return getKeyboardLayoutList(false).contains(layoutName);
}
public static boolean isKeyboardLayoutInstalled(String layoutName) {
return getKeyboardLayoutList(true).contains(layoutName);
}
// Listens to EDT state in invokeAndWait() and disposes the invocation event
// when EDT becomes free but the invocation event is not yet dispatched (considered lost).
// This prevents a deadlock and makes the invocation return some default result.

View File

@@ -36,14 +36,9 @@ import java.util.stream.Collectors;
public class FontExtensions {
private interface FontExtension {
FontExtension INSTANCE = (FontExtension) JBRApi.internalServiceBuilder(MethodHandles.lookup())
.withStatic("getFeatures", "getFeatures", "java.awt.Font")
.withStatic("isComplexRendering", "isComplexRendering", "java.awt.Font")
.withStatic("isKerning", "isKerning", "java.awt.Font")
.build();
.withStatic("getFeatures", "getFeatures", "java.awt.Font").build();
TreeMap<String, Integer> getFeatures(Font font);
boolean isComplexRendering(Font font);
boolean isKerning(Font font);
}
public static String[] featuresToStringArray(Map<String, Integer> features) {
@@ -54,12 +49,4 @@ public class FontExtensions {
public static TreeMap<String, Integer> getFeatures(Font font) {
return FontExtension.INSTANCE.getFeatures(font);
}
public static boolean isComplexRendering(Font font) {
return FontExtension.INSTANCE.isComplexRendering(font);
}
public static boolean isKerning(Font font) {
return FontExtension.INSTANCE.isKerning(font);
}
}

View File

@@ -2719,17 +2719,29 @@ public class Font implements java.io.Serializable
(limit - beginIndex));
}
FontDesignMetrics metrics = FontDesignMetrics.getMetrics(this, frc);
return metrics.charsBounds(chars, beginIndex, limit - beginIndex);
}
// this code should be in textlayout
// quick check for simple text, assume GV ok to use if simple
private static boolean isComplexRendering(Font font) {
return (font.values != null && (font.values.getLigatures() != 0 || font.values.getTracking() != 0 ||
font.values.getBaselineTransform() != null)) || font.anyEnabledFeatures();
}
boolean simple = (values == null ||
(values.getKerning() == 0
&& values.getLigatures() == 0
&& values.getTracking() == 0
&& values.getBaselineTransform() == null)) && !anyEnabledFeatures();
if (simple) {
simple = ! FontUtilities.isComplexText(chars, beginIndex, limit);
}
private static boolean isKerning(Font font) {
return font.values != null && (font.values.getKerning() != 0);
if (simple || ((limit - beginIndex) == 0)) {
FontDesignMetrics metrics = FontDesignMetrics.getMetrics(this, frc);
return metrics.getSimpleBounds(chars, beginIndex, limit-beginIndex);
} else {
// need char array constructor on textlayout
String str = new String(chars, beginIndex, limit - beginIndex);
TextLayout tl = new TextLayout(str, this, frc);
return new Rectangle2D.Float(0, -tl.getAscent(), tl.getAdvance(),
tl.getAscent() + tl.getDescent() +
tl.getLeading());
}
}
/**

View File

@@ -38,11 +38,8 @@ import java.io.ObjectOutputStream;
import java.io.Serial;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.SoftReference;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.jetbrains.desktop.FontExtensions;
import sun.java2d.Disposer;
import sun.java2d.DisposerRecord;
@@ -435,13 +432,16 @@ public final class FontDesignMetrics extends FontMetrics {
return frc;
}
private float preciseCharWidth(char ch) {
// default metrics for compatibility with legacy code
return (ch < 0x100) ? getLatinCharWidth(ch) : handleCharWidth(ch);
}
public int charWidth(char ch) {
return Math.round(preciseCharWidth(ch));
// default metrics for compatibility with legacy code
float w;
if (ch < 0x100) {
w = getLatinCharWidth(ch);
}
else {
w = handleCharWidth(ch);
}
return (int)(0.5 + w);
}
public int charWidth(int ch) {
@@ -451,111 +451,93 @@ public final class FontDesignMetrics extends FontMetrics {
float w = handleCharWidth(ch);
return Math.round(w);
}
private Rectangle2D.Float textLayoutBounds(Object data, int off, int len) {
String str = data instanceof String ? ((String) data).substring(off, off + len) :
new String((char[]) data, off, len);
TextLayout tl = new TextLayout(str, font, frc);
return new Rectangle2D.Float(0, -tl.getAscent(),
tl.getAdvance(), tl.getAscent() + tl.getDescent() + tl.getLeading());
}
private char getChar(Object data, int i) {
return data instanceof String ? ((String) data).charAt(i) : ((char[]) data)[i];
}
final int ADVANCES_FAST_KEY_LIMIT = 0x100;
private HashMap<Integer, Float> advances = new HashMap<>();
private float[] advancesFast = new float[ADVANCES_FAST_KEY_LIMIT * ADVANCES_FAST_KEY_LIMIT];
private Rectangle2D.Float dataBounds(Object data, int off, int len) {
assert (data instanceof String || data instanceof char[]);
float width = 0;
if (FontExtensions.isComplexRendering(font) && len > 0) {
return textLayoutBounds(data, off, len);
}
float height = ascent + descent + leading;
if (len == 0 || len == 1 && !FontUtilities.isNonSimpleChar(getChar(data, off))) {
width = len > 0 ? preciseCharWidth(getChar(data, off)) : 0f;
return new Rectangle2D.Float(0f, -ascent, width, height);
}
boolean isKerning = FontExtensions.isKerning(font);
float consecutiveDoubleCharacterWidth = 0f;
char prev = 0;
for (int i = off; i < off + len; i++) {
char cur = getChar(data, i);
if (FontUtilities.isNonSimpleChar(cur)) {
return textLayoutBounds(data, off, len);
} else {
// Correct width of string with kerning calculates by text LayoutBounds but it could be slow.
// Below is description of optimized algorithm for correct calculating width of text with kerning:
// proof:
// base: kerningWidth('c1') = plainWidth('c1')
// induction: kerningWidth('c1..cN-1cN') =
// kerningWidth('c1..cN-1') + kerningWidth('cN-1cN') - plainWidth('cN-1')
// final: kerningWidth('c1..cN') = kerningWidth('c1c2') + ... + kerningWidth('cN-1cN')
// - (plainWidth('c2') + ... + plainWidth('cN-1'))
// remark: for reducing calculation of kerningWidth('c1c2') using caching
if (isKerning && i > off) {
// fast path
if (prev < ADVANCES_FAST_KEY_LIMIT && cur < ADVANCES_FAST_KEY_LIMIT) {
int key = (prev << 8) | cur;
if (advancesFast[key] == 0.0f) {
advancesFast[key] = textLayoutBounds(data, i - 1, 2).width;
}
consecutiveDoubleCharacterWidth += advancesFast[key];
// common solution
} else {
int key = (prev << 16) | (0xffff & cur);
advances.putIfAbsent(key, textLayoutBounds(data, i - 1, 2).width);
consecutiveDoubleCharacterWidth += advances.get(key);
}
}
width += preciseCharWidth(cur);
}
prev = cur;
}
if (isKerning) {
width = consecutiveDoubleCharacterWidth -
(width - preciseCharWidth(getChar(data, off)) - preciseCharWidth(getChar(data, off + len - 1)));
}
return new Rectangle2D.Float(0f, -ascent, width, height);
}
public Rectangle2D.Float charsBounds(char[] data, int off, int len) {
return dataBounds(data, off, len);
}
private int dataWidth(Object data, int off, int len) {
return Math.round((float) dataBounds(data, off, len).getWidth());
return (int)(0.5 + w);
}
public int stringWidth(String str) {
if (str == null) {
throw new NullPointerException("str is null");
float width = 0;
if (font.hasLayoutAttributes()) {
/* TextLayout throws IAE for null, so throw NPE explicitly */
if (str == null) {
throw new NullPointerException("str is null");
}
if (str.length() == 0) {
return 0;
}
width = new TextLayout(str, font, frc).getAdvance();
} else {
int length = str.length();
for (int i=0; i < length; i++) {
char ch = str.charAt(i);
if (ch < 0x100) {
width += getLatinCharWidth(ch);
} else if (FontUtilities.isNonSimpleChar(ch)) {
width = new TextLayout(str, font, frc).getAdvance();
break;
} else {
width += handleCharWidth(ch);
}
}
}
return dataWidth(str, 0, str.length());
return (int) (0.5 + width);
}
public int charsWidth(char[] data, int off, int len) {
/* Explicit test needed to satisfy superclass spec */
if (len < 0) {
throw new IndexOutOfBoundsException("len="+len);
float width = 0;
if (font.hasLayoutAttributes()) {
if (len == 0) {
return 0;
}
String str = new String(data, off, len);
width = new TextLayout(str, font, frc).getAdvance();
} else {
/* Explicit test needed to satisfy superclass spec */
if (len < 0) {
throw new IndexOutOfBoundsException("len="+len);
}
int limit = off + len;
for (int i=off; i < limit; i++) {
char ch = data[i];
if (ch < 0x100) {
width += getLatinCharWidth(ch);
} else if (FontUtilities.isNonSimpleChar(ch)) {
String str = new String(data, off, len);
width = new TextLayout(str, font, frc).getAdvance();
break;
} else {
width += handleCharWidth(ch);
}
}
}
return dataWidth(data, off, len);
return (int) (0.5 + width);
}
/**
* This method is called from java.awt.Font only after verifying
* the arguments and that the text is simple and there are no
* layout attributes, font transform etc.
*/
public Rectangle2D getSimpleBounds(char[] data, int off, int len) {
float width = 0;
int limit = off + len;
for (int i=off; i < limit; i++) {
char ch = data[i];
if (ch < 0x100) {
width += getLatinCharWidth(ch);
} else {
width += handleCharWidth(ch);
}
}
float height = ascent + descent + leading;
return new Rectangle2D.Float(0f, -ascent, width, height);
}
/**
* Gets the advance widths of the first 256 characters in the
* {@code Font}. The advance is the
@@ -575,7 +557,7 @@ public final class FontDesignMetrics extends FontMetrics {
if (w == UNKNOWN_WIDTH) {
w = advCache[ch] = handleCharWidth(ch);
}
widths[ch] = Math.round(w);
widths[ch] = (int) (0.5 + w);
}
return widths;
}

View File

@@ -34,8 +34,6 @@
#define VALIDATION_LAYER_NAME "VK_LAYER_KHRONOS_validation"
static const uint32_t REQUIRED_VULKAN_VERSION = VK_MAKE_API_VERSION(0, 1, 2, 0);
bool VKGraphicsEnvironment::_verbose = false;
int VKGraphicsEnvironment::_requested_device_number = -1;
std::unique_ptr<VKGraphicsEnvironment> VKGraphicsEnvironment::_ge_instance = nullptr;
// ========== Graphics environment ==========
@@ -189,33 +187,11 @@ VKGraphicsEnvironment::VKGraphicsEnvironment() :
throw std::runtime_error("Vulkan: No suitable device found");
}
// Create virtual device for a physical device.
// TODO system property for manual choice of GPU
// TODO integrated/discrete presets
// TODO performance/power saving mode switch on the fly?
int _default_device_number = 0; // TODO pick first just to check that virtual device creation works
if (_verbose) {
fprintf(stderr, "Vulkan graphics devices:\n");
}
_requested_device_number = (_requested_device_number == -1) ? 0 : _requested_device_number;
if (_requested_device_number < 0 || _requested_device_number >= static_cast<int>(_devices.size())) {
if (_verbose) {
fprintf(stderr, " Requested device number (%d) not found, fallback to 0\n", _requested_device_number);
}
_requested_device_number = 0;
}
_default_device_number = _requested_device_number;
if (_verbose) {
for (auto devIter = _devices.begin(); devIter != _devices.end(); devIter++) {
auto devNum = std::distance(begin(_devices), devIter);
fprintf(stderr, " %c%ld: %s\n", devNum == _default_device_number ? '*' : ' ',
devNum, (*devIter)->name().c_str());
}
fprintf(stderr, "\n");
}
_default_device = &*_devices[_default_device_number]; // TODO pick first just to check hat virtual device creation works
_default_device = &*_devices[0]; // TODO pick first just to check hat virtual device creation works
_default_device->init();
}
vk::raii::Instance& VKGraphicsEnvironment::vk_instance() {
@@ -438,9 +414,8 @@ void VKDevice::submitCommandBuffer(vk::raii::CommandBuffer&& primary,
waitStages.clear();
}
extern "C" jboolean VK_Init(jboolean verbose, jint requestedDevice) {
VKGraphicsEnvironment::set_verbose(verbose);
VKGraphicsEnvironment::set_requested_device(requestedDevice);
extern "C" jboolean VK_Init() {
if (VKGraphicsEnvironment::graphics_environment() != nullptr) {
return true;
}

View File

@@ -126,10 +126,6 @@ public:
explicit operator bool() const { // Initialized or not
return *((const vk::raii::Device&) *this);
}
const std::string& name() {
return _name;
}
};
class VKGraphicsEnvironment {
@@ -140,13 +136,9 @@ class VKGraphicsEnvironment {
#endif
std::vector<std::unique_ptr<VKDevice>> _devices;
VKDevice* _default_device;
static bool _verbose;
static int _requested_device_number;
static std::unique_ptr<VKGraphicsEnvironment> _ge_instance;
VKGraphicsEnvironment();
public:
static void set_verbose(bool verbose) { _verbose = verbose; }
static void set_requested_device(int requested_device) { _requested_device_number = requested_device; }
static VKGraphicsEnvironment* graphics_environment();
static void dispose();
VKDevice& default_device();
@@ -156,7 +148,7 @@ public:
extern "C" {
#endif //__cplusplus
jboolean VK_Init(jboolean verbose, jint requestedDevice);
jboolean VK_Init();
#ifdef __cplusplus
}

View File

@@ -28,7 +28,7 @@
#ifndef VULKAN_ENABLED
#include "jni.h"
jboolean VK_Init(jboolean verbose, jint requestedDevice) {
jboolean VK_Init() {
return 0;
}

View File

@@ -234,11 +234,11 @@ public class WLComponentPeer implements ComponentPeer {
this.visible = v;
if (this.visible) {
final String title = getTitle();
final boolean isWlPopup = targetIsWlPopup();
final boolean isPopup = target instanceof Window window && window.getType() == Window.Type.POPUP;
final int thisWidth = getWidth();
final int thisHeight = getHeight();
performLocked(() -> {
if (isWlPopup) {
if (isPopup) {
Window popup = (Window) target;
final Component popupParent = AWTAccessor.getWindowAccessor().getPopupParent(popup);
final int parentWidth = popupParent.getWidth();
@@ -281,16 +281,6 @@ public class WLComponentPeer implements ComponentPeer {
}
}
/**
* Returns true if our target should be treated as a popup in Wayland's sense,
* i.e. it has to have a parent to position relative to.
*/
private boolean targetIsWlPopup() {
return target instanceof Window window
&& window.getType() == Window.Type.POPUP
&& AWTAccessor.getWindowAccessor().getPopupParent(window) != null;
}
void configureWLSurface() {
synchronized (sizeLock) {
if (log.isLoggable(PlatformLogger.Level.FINE)) {
@@ -383,24 +373,23 @@ public class WLComponentPeer implements ComponentPeer {
WLToolkit.postEvent(new ComponentEvent(getTarget(), ComponentEvent.COMPONENT_MOVED));
}
Rectangle oldBounds = getVisibleBounds();
final boolean sizeChanged = oldBounds.width != width || oldBounds.height != height;
if (sizeChanged) {
synchronized (sizeLock) {
synchronized(sizeLock) {
final boolean sizeChanged = this.width != width || this.height != height;
if (sizeChanged) {
this.width = width;
this.height = height;
}
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine(String.format("%s is resizing its buffer to %dx%d with %dx scale", this, getBufferWidth(), getBufferHeight(), getBufferScale()));
}
SurfaceData.convertTo(WLSurfaceDataExt.class, surfaceData).revalidate(
getBufferWidth(), getBufferHeight(), getBufferScale());
updateWindowGeometry();
layout();
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine(String.format("%s is resizing its buffer to %dx%d with %dx scale", this, getBufferWidth(), getBufferHeight(), getBufferScale()));
}
SurfaceData.convertTo(WLSurfaceDataExt.class, surfaceData).revalidate(
getBufferWidth(), getBufferHeight(), getBufferScale());
updateWindowGeometry();
layout();
WLToolkit.postEvent(new ComponentEvent(getTarget(), ComponentEvent.COMPONENT_RESIZED));
WLToolkit.postEvent(new ComponentEvent(getTarget(), ComponentEvent.COMPONENT_RESIZED));
}
postPaintEvent();
}
postPaintEvent();
}
public Rectangle getVisibleBounds() {
@@ -830,10 +819,6 @@ public class WLComponentPeer implements ComponentPeer {
performLocked(() -> nativeRequestUnsetFullScreen(nativePtr));
}
final void activate() {
performLocked(() -> nativeActivate(nativePtr));
}
private static native void initIDs();
protected native long nativeCreateFrame();
@@ -868,7 +853,6 @@ public class WLComponentPeer implements ComponentPeer {
private static native void nativeSetCursor(long pData);
private static native long nativeGetPredefinedCursor(String name);
private native void nativeShowWindowMenu(long ptr, int x, int y);
private native void nativeActivate(long ptr);
static long getParentNativePtr(Component target) {
Component parent = target.getParent();
@@ -1018,11 +1002,11 @@ public class WLComponentPeer implements ComponentPeer {
log.fine(String.format("%s configured to %dx%d", this, newWidth, newHeight));
}
boolean isWlPopup = targetIsWlPopup();
final boolean isPopup = target instanceof Window window && window.getType() == Window.Type.POPUP;
if (newWidth != 0 && newHeight != 0) performUnlocked(() ->target.setSize(newWidth, newHeight));
if (newWidth == 0 || newHeight == 0 || isWlPopup) {
if (newWidth == 0 || newHeight == 0 || isPopup) {
// From xdg-shell.xml: "If the width or height arguments are zero,
// it means the client should decide its own window dimension".

View File

@@ -127,6 +127,11 @@ public class WLFramePeer extends WLDecoratedPeer implements FramePeer {
throw new UnsupportedOperationException();
}
@Override
public void toFront() {
//throw new UnsupportedOperationException();
}
@Override
public void toBack() {
throw new UnsupportedOperationException();

View File

@@ -73,9 +73,10 @@ public abstract class WLGraphicsConfig extends GraphicsConfiguration {
@Override
public AffineTransform getNormalizingTransform() {
double xScale = device.getResolutionX(this) / 72.0;
double yScale = device.getResolutionY(this) / 72.0;
return new AffineTransform(xScale, 0.0, 0.0, yScale, 0.0, 0.0);
// TODO: may not be able to implement this fully, but we can try
// obtaining physical width/height from wl_output.geometry event.
// Those may be 0, of course.
return getDefaultTransform();
}
@Override

View File

@@ -31,7 +31,6 @@ import sun.java2d.vulkan.WLVKGraphicsConfig;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.Window;
@@ -40,7 +39,6 @@ import java.awt.Window;
* in the multi-monitor setup. Whenever those change, this device is re-created.
*/
public class WLGraphicsDevice extends GraphicsDevice {
private static final double MM_IN_INCH = 25.4;
/**
* ID of the corresponding wl_output object received from Wayland.
*/
@@ -62,21 +60,16 @@ public class WLGraphicsDevice extends GraphicsDevice {
*/
private volatile int y; // only changes when the device gets invalidated
private final int widthMm;
private final int heightMm;
// Configs are always the same in size and scale
private volatile GraphicsConfiguration[] configs = null;
private volatile WLGraphicsConfig[] configs = null;
// The default config is an object from the configs array
private volatile WLGraphicsConfig defaultConfig = null;
private WLGraphicsDevice(int id, int x, int y, int widthMm, int heightMm) {
private WLGraphicsDevice(int id, int x, int y) {
this.wlID = id;
this.x = x;
this.y = y;
this.widthMm = widthMm;
this.heightMm = heightMm;
}
int getID() {
@@ -84,30 +77,23 @@ public class WLGraphicsDevice extends GraphicsDevice {
}
void updateConfiguration(String name, int width, int height, int scale) {
this.name = name;
this.name = name == null ? "wl_output." + wlID : name;
WLGraphicsConfig config = defaultConfig;
// Note that all configs are of equal size and scale
if (config == null || config.differsFrom(width, height, scale)) {
GraphicsConfiguration[] newConfigs;
WLGraphicsConfig newDefaultConfig;
if (configs == null || configs[0].differsFrom(width, height, scale)) {
// It is necessary to create a new object whenever config changes as its
// identity is used to detect changes in scale, among other things.
if (WLGraphicsEnvironment.isVulkanEnabled()) {
newDefaultConfig = WLVKGraphicsConfig.getConfig(this, width, height, scale);
newConfigs = new GraphicsConfiguration[1];
newConfigs[0] = newDefaultConfig;
defaultConfig = WLVKGraphicsConfig.getConfig(this, width, height, scale);
configs = new WLGraphicsConfig[1];
configs[0] = defaultConfig;
} else {
// TODO: Actually, Wayland may support a lot more shared memory buffer configurations, need to
// subscribe to the wl_shm:format event and get the list from there.
newDefaultConfig = WLSMGraphicsConfig.getConfig(this, width, height, scale, false);
newConfigs = new GraphicsConfiguration[2];
newConfigs[0] = newDefaultConfig;
newConfigs[1] = WLSMGraphicsConfig.getConfig(this, width, height, scale, true);
defaultConfig = WLSMGraphicsConfig.getConfig(this, width, height, scale, false);
configs = new WLGraphicsConfig[2];
configs[0] = defaultConfig;
configs[1] = WLSMGraphicsConfig.getConfig(this, width, height, scale, true);
}
configs = newConfigs;
defaultConfig = newDefaultConfig;
}
}
@@ -121,17 +107,13 @@ public class WLGraphicsDevice extends GraphicsDevice {
this.x = similarDevice.x;
this.y = similarDevice.y;
int newScale = similarDevice.getScale();
Rectangle newBounds = similarDevice.defaultConfig.getBounds();
final int newScale = similarDevice.getScale();
final Rectangle newBounds = similarDevice.defaultConfig.getBounds();
updateConfiguration(similarDevice.name, newBounds.width, newBounds.height, newScale);
}
public static WLGraphicsDevice createWithConfiguration(int id, String name,
int x, int y,
int width, int height,
int widthMm, int heightMm,
int scale) {
WLGraphicsDevice device = new WLGraphicsDevice(id, x, y, widthMm, heightMm);
public static WLGraphicsDevice createWithConfiguration(int id, String name, int x, int y, int width, int height, int scale) {
final WLGraphicsDevice device = new WLGraphicsDevice(id, x, y);
device.updateConfiguration(name, width, height, scale);
return device;
}
@@ -145,17 +127,11 @@ public class WLGraphicsDevice extends GraphicsDevice {
}
boolean hasSameNameAs(WLGraphicsDevice otherDevice) {
var localName = name;
var otherName = otherDevice.name;
return localName != null && localName.equals(otherName);
return name != null && otherDevice.name != null && name.equals(otherDevice.name);
}
boolean hasSameSizeAs(WLGraphicsDevice modelDevice) {
var config = defaultConfig;
var modelConfig = modelDevice.defaultConfig;
return config != null
&& modelConfig != null
&& config.getBounds().equals(modelConfig.getBounds());
return defaultConfig != null && modelDevice.defaultConfig != null && defaultConfig.getBounds().equals(modelDevice.defaultConfig.getBounds());
}
@Override
@@ -187,27 +163,6 @@ public class WLGraphicsDevice extends GraphicsDevice {
return defaultConfig.getScale();
}
int getResolution() {
Rectangle bounds = defaultConfig.getBounds();
if (bounds.width == 0 || bounds.height == 0) return 0;
double diagonalPixel = Math.sqrt(bounds.width * bounds.width + bounds.height * bounds.height);
double diagonalMm = Math.sqrt(widthMm * widthMm + heightMm * heightMm);
return (int) (diagonalPixel / diagonalMm * MM_IN_INCH);
}
int getResolutionX(WLGraphicsConfig config) {
Rectangle bounds = config.getBounds();
if (bounds.width == 0) return 0;
return (int)((double)bounds.width / widthMm * MM_IN_INCH);
}
int getResolutionY(WLGraphicsConfig config) {
Rectangle bounds = config.getBounds();
if (bounds.height == 0) return 0;
return (int)((double)bounds.height / heightMm * MM_IN_INCH);
}
@Override
public boolean isFullScreenSupported() {
return true;
@@ -256,13 +211,8 @@ public class WLGraphicsDevice extends GraphicsDevice {
@Override
public String toString() {
var config = defaultConfig;
return String.format("WLGraphicsDevice: '%s' id=%d at (%d, %d) with %s",
name, wlID, x, y,
config != null ? config : "<no configs>");
}
public Insets getInsets() {
return new Insets(0, 0, 0, 0);
return String.format("WLGraphicsDevice: id=%d at (%d, %d) with %s",
wlID, x, y,
defaultConfig != null ? defaultConfig : "<no configs>");
}
}

View File

@@ -45,43 +45,23 @@ public class WLGraphicsEnvironment extends SunGraphicsEnvironment {
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.wl.WLGraphicsEnvironment");
private static boolean vulkanEnabled = false;
private static boolean verboseVulkanStatus = false;
private static boolean vulkanRequested = false;
private static int vulkanRequestedDeviceNumber = -1;
@SuppressWarnings("removal")
private static String vulkanOption =
private static boolean vulkanRequested =
AccessController.doPrivileged(
(PrivilegedAction<String>) () -> System.getProperty("sun.java2d.vulkan", ""));
@SuppressWarnings("removal")
private static String vulkanOptionDeviceNumber =
AccessController.doPrivileged(
(PrivilegedAction<String>) () -> System.getProperty("sun.java2d.vulkan.deviceNumber", "0"));
(PrivilegedAction<Boolean>) () ->
"true".equals(System.getProperty("sun.java2d.vulkan")));
static {
vulkanRequested = "true".equalsIgnoreCase(vulkanOption);
try {
vulkanRequestedDeviceNumber = Integer.parseInt(vulkanOptionDeviceNumber);
} catch (NumberFormatException e) {
log.warning("Invalid Vulkan device number:" + vulkanOptionDeviceNumber);
}
verboseVulkanStatus = "True".equals(vulkanOption);
System.loadLibrary("awt");
SurfaceManagerFactory.setInstance(new UnixSurfaceManagerFactory());
if (vulkanRequested) {
vulkanEnabled = initVKWL(verboseVulkanStatus, vulkanRequestedDeviceNumber);
vulkanEnabled = initVKWL();
}
if (log.isLoggable(Level.FINE)) {
log.fine("Vulkan rendering enabled: " + (vulkanEnabled?"YES":"NO"));
}
// Make sure the toolkit is loaded because otherwise this GE is going to be empty
WLToolkit.isInitialized();
}
private static native boolean initVKWL(boolean verbose, int deviceNumber);
private static native boolean initVKWL();
private WLGraphicsEnvironment() {
}
@@ -120,8 +100,7 @@ public class WLGraphicsEnvironment extends SunGraphicsEnvironment {
private final List<WLGraphicsDevice> devices = new ArrayList<>(5);
private void notifyOutputConfigured(String name, String make, String model, int wlID,
int x, int y, int width, int height, int widthMm, int heightMm,
private void notifyOutputConfigured(String name, int wlID, int x, int y, int width, int height,
int subpixel, int transform, int scale) {
// Called from native code whenever a new output appears or an existing one changes its properties
// NB: initially called during WLToolkit.initIDs() on the main thread; later on EDT.
@@ -129,10 +108,6 @@ public class WLGraphicsEnvironment extends SunGraphicsEnvironment {
log.fine(String.format("Output configured id=%d at (%d, %d) %dx%d %dx scale", wlID, x, y, width, height, scale));
}
String humanID =
(name != null ? name + " " : "")
+ (make != null ? make + " " : "")
+ (model != null ? model : "");
synchronized (devices) {
boolean newOutput = true;
for (int i = 0; i < devices.size(); i++) {
@@ -140,10 +115,9 @@ public class WLGraphicsEnvironment extends SunGraphicsEnvironment {
if (gd.getID() == wlID) {
newOutput = false;
if (gd.isSameDeviceAs(wlID, x, y)) {
gd.updateConfiguration(humanID, width, height, scale);
gd.updateConfiguration(name, width, height, scale);
} else {
final WLGraphicsDevice updatedDevice = WLGraphicsDevice.createWithConfiguration(wlID, humanID,
x, y, width, height, widthMm, heightMm, scale);
final WLGraphicsDevice updatedDevice = WLGraphicsDevice.createWithConfiguration(wlID, name, x, y, width, height, scale);
devices.set(i, updatedDevice);
gd.invalidate(updatedDevice);
}
@@ -151,8 +125,7 @@ public class WLGraphicsEnvironment extends SunGraphicsEnvironment {
}
}
if (newOutput) {
final WLGraphicsDevice gd = WLGraphicsDevice.createWithConfiguration(wlID, humanID, x, y,
width, height, widthMm, heightMm, scale);
final WLGraphicsDevice gd = WLGraphicsDevice.createWithConfiguration(wlID, name, x, y, width, height, scale);
devices.add(gd);
}
}

View File

@@ -35,7 +35,7 @@ public class WLKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl {
@Override
public void setCurrentFocusOwner(Component comp) {
if (comp != null && comp != currentFocusedWindow) {
if (comp != currentFocusedWindow) {
// In Wayland, only Window can be focused, not any widget in it.
focusLog.severe("Unexpected focus owner set in a Window: " + comp);
}

View File

@@ -234,7 +234,7 @@ public class WLToolkit extends UNIXToolkit implements Runnable {
* the next click is considered separate and not part of multi-click event.
* @return maximum milliseconds between same mouse button clicks for them to be a multiclick
*/
static int getMulticlickTime() {
static long getMulticlickTime() {
/* TODO: get from the system somehow */
return AWT_MULTICLICK_DEFAULT_TIME_MS;
}
@@ -814,8 +814,8 @@ public class WLToolkit extends UNIXToolkit implements Runnable {
@Override
public int getScreenResolution() {
var defaultScreen = (WLGraphicsDevice)WLGraphicsEnvironment.getSingleInstance().getDefaultScreenDevice();
return defaultScreen.getResolution();
// TODO
return 150;
}
/**
@@ -855,14 +855,8 @@ public class WLToolkit extends UNIXToolkit implements Runnable {
protected void initializeDesktopProperties() {
super.initializeDesktopProperties();
desktopProperties.put("DnD.Autoscroll.initialDelay", 50);
desktopProperties.put("DnD.Autoscroll.interval", 50);
desktopProperties.put("DnD.Autoscroll.cursorHysteresis", 5);
desktopProperties.put("Shell.shellFolderManager", "sun.awt.shell.ShellFolderManager");
if (!GraphicsEnvironment.isHeadless()) {
desktopProperties.put("awt.multiClickInterval", getMulticlickTime());
desktopProperties.put("awt.mouse.numButtons", getNumberOfButtons());
desktopProperties.put("awt.mouse.numButtons", MOUSE_BUTTONS_COUNT);
}
}
@@ -1002,17 +996,6 @@ public class WLToolkit extends UNIXToolkit implements Runnable {
flushImpl();
}
@Override
public Insets getScreenInsets(final GraphicsConfiguration gc) {
final GraphicsDevice gd = gc.getDevice();
if (gd instanceof WLGraphicsDevice device) {
Insets insets = device.getInsets();
return (Insets) insets.clone();
} else {
return super.getScreenInsets(gc);
}
}
private native int readEvents();
private native void dispatchEventsOnEDT();
private native void flushImpl();

View File

@@ -89,7 +89,7 @@ public class WLWindowPeer extends WLComponentPeer implements WindowPeer {
@Override
public void toFront() {
activate();
// TODO
}
@Override

View File

@@ -82,9 +82,22 @@ ReportFatalError(const char* file, int line, const char *msg)
assert(0);
}
static inline void
AssertCalledOnEDT(const char* file, int line)
{
char threadName[16];
pthread_getname_np(pthread_self(), threadName, sizeof(threadName));
if (strncmp(threadName, "AWT-EventQueue", 14) != 0) {
fprintf(stderr, "Assert failed (called on %s instead of EDT) at %s:%d\n", threadName, file, line);
fflush(stderr);
assert(0);
}
}
static void
AssertDrawLockIsHeld(WLSurfaceBufferManager* manager, const char * file, int line);
#define ASSERT_ON_EDT() AssertCalledOnEDT(__FILE__, __LINE__)
#define WL_FATAL_ERROR(msg) ReportFatalError(__FILE__, __LINE__, msg)
#define ASSERT_DRAW_LOCK_IS_HELD(manager) AssertDrawLockIsHeld(manager, __FILE__, __LINE__)
#define ASSERT_SHOW_LOCK_IS_HELD(manager) AssertShowLockIsHeld(manager, __FILE__, __LINE__)
@@ -757,7 +770,7 @@ WLSBM_Create(jint width, jint height, jint scale, jint bgPixel, jint wlShmFormat
// both read from and written to (when scrolling, for instance).
// So it needs to be able to be "locked" twice: once for writing and
// once for reading.
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
pthread_mutex_init(&manager->drawLock, &attr);
DrawBufferCreate(manager);
ShowBufferCreate(manager);

View File

@@ -261,7 +261,7 @@ Java_sun_java2d_wl_WLSMSurfaceData_initOps(JNIEnv *env, jobject wsd,
// Recursive mutex is required because blit can be done with both source
// and destination being the same surface (during scrolling, for example).
// So WLSD_Lock() should be able to lock the same surface twice in a row.
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
pthread_mutex_init(&wsdo->lock, &attr);
#endif /* !HEADLESS */
}

View File

@@ -44,53 +44,12 @@ static jmethodID notifyConfiguredMID;
static jmethodID notifyEnteredOutputMID;
static jmethodID notifyLeftOutputMID;
struct activation_token_list_item {
struct xdg_activation_token_v1 *token;
struct activation_token_list_item *next_item;
};
static struct activation_token_list_item *add_token(struct activation_token_list_item *list,
struct xdg_activation_token_v1 *token_to_add) {
struct activation_token_list_item *new_item =
(struct activation_token_list_item *) calloc(1, sizeof(struct activation_token_list_item));
new_item->token = token_to_add;
new_item->next_item = list;
return new_item;
}
static struct activation_token_list_item *delete_last_token(struct activation_token_list_item *list) {
assert(list);
xdg_activation_token_v1_destroy(list->token);
struct activation_token_list_item *next_item = list->next_item;
free(list);
return next_item;
}
static struct activation_token_list_item *delete_token(struct activation_token_list_item *list,
struct xdg_activation_token_v1 *token_to_delete) {
if (list == NULL) {
return NULL;
} else if (list->token == token_to_delete) {
return delete_last_token(list);
} else {
list->next_item = delete_token(list->next_item, token_to_delete);
return list;
}
}
static void delete_all_tokens(struct activation_token_list_item *list) {
while (list) {
list = delete_last_token(list);
}
}
struct WLFrame {
jobject nativeFramePeer; // weak reference
struct wl_surface *wl_surface;
struct xdg_surface *xdg_surface;
struct WLFrame *parent;
struct xdg_positioner *xdg_positioner;
struct activation_token_list_item *activation_token_list;
jboolean toplevel;
union {
struct xdg_toplevel *xdg_toplevel;
@@ -265,22 +224,6 @@ static const struct xdg_popup_listener xdg_popup_listener = {
.popup_done = xdg_popup_done,
};
static void
xdg_activation_token_v1_done(void *data,
struct xdg_activation_token_v1 *xdg_activation_token_v1,
const char *token) {
struct WLFrame *frame = (struct WLFrame *) data;
assert(frame);
struct wl_surface *surface = frame->wl_surface;
assert(surface);
xdg_activation_v1_activate(xdg_activation_v1, token, surface);
frame->activation_token_list = delete_token(frame->activation_token_list, xdg_activation_token_v1);
}
static const struct xdg_activation_token_v1_listener xdg_activation_token_v1_listener = {
.done = xdg_activation_token_v1_done,
};
JNIEXPORT void JNICALL
Java_sun_awt_wl_WLComponentPeer_initIDs
(JNIEnv *env, jclass clazz)
@@ -497,8 +440,6 @@ DoHide(struct WLFrame *frame)
}
xdg_surface_destroy(frame->xdg_surface);
wl_surface_destroy(frame->wl_surface);
delete_all_tokens(frame->activation_token_list);
frame->activation_token_list = NULL;
frame->wl_surface = NULL;
frame->xdg_surface = NULL;
frame->xdg_toplevel = NULL;
@@ -584,20 +525,3 @@ JNIEXPORT void JNICALL Java_sun_awt_wl_WLComponentPeer_nativeShowWindowMenu
xdg_toplevel_show_window_menu(frame->xdg_toplevel, wl_seat, last_mouse_pressed_serial, x, y);
}
}
JNIEXPORT void JNICALL
Java_sun_awt_wl_WLComponentPeer_nativeActivate
(JNIEnv *env, jobject obj, jlong ptr)
{
struct WLFrame *frame = jlong_to_ptr(ptr);
if (frame->wl_surface && xdg_activation_v1 && wl_seat) {
struct xdg_activation_token_v1 *token = xdg_activation_v1_get_activation_token(xdg_activation_v1);
xdg_activation_token_v1_add_listener(token, &xdg_activation_token_v1_listener, frame);
xdg_activation_token_v1_set_serial(token, last_input_or_focus_serial, wl_seat);
if (wl_surface_in_focus) {
xdg_activation_token_v1_set_surface(token, wl_surface_in_focus);
}
xdg_activation_token_v1_commit(token);
frame->activation_token_list = add_token(frame->activation_token_list, token);
}
}

View File

@@ -43,15 +43,11 @@ typedef struct WLOutput {
int32_t y;
int32_t width;
int32_t height;
int32_t width_mm;
int32_t height_mm;
uint32_t subpixel;
uint32_t transform;
uint32_t scale;
char * make;
char * model;
char * name;
} WLOutput;
@@ -83,10 +79,6 @@ wl_output_geometry(
output->y = y;
output->subpixel = subpixel;
output->transform = transform;
output->width_mm = physical_width;
output->height_mm = physical_height;
output->make = make != NULL ? strdup(make) : NULL;
output->model = model != NULL ? strdup(model) : NULL;
}
static void
@@ -146,23 +138,16 @@ wl_output_done(
JNIEnv *env = getEnv();
jobject obj = (*env)->CallStaticObjectMethod(env, geClass, getSingleInstanceMID);
JNU_CHECK_EXCEPTION(env);
CHECK_NULL_THROW_IE(env, obj, "WLGraphicsEnvironment.getSingleInstance() returned null");
jstring name = output->name ? JNU_NewStringPlatform(env, output->name) : NULL;
jstring make = output->make ? JNU_NewStringPlatform(env, output->make) : NULL;
jstring model = output->model ? JNU_NewStringPlatform(env, output->model) : NULL;
jstring outputName = output->name ? JNU_NewStringPlatform(env, output->name) : NULL;
JNU_CHECK_EXCEPTION(env);
(*env)->CallVoidMethod(env, obj, notifyOutputConfiguredMID,
name,
make,
model,
outputName,
output->id,
output->x,
output->y,
output->width,
output->height,
output->width_mm,
output->height_mm,
(jint)output->subpixel,
(jint)output->transform,
(jint)output->scale);
@@ -197,7 +182,7 @@ WLGraphicsEnvironment_initIDs
CHECK_NULL_RETURN(
notifyOutputConfiguredMID = (*env)->GetMethodID(env, clazz,
"notifyOutputConfigured",
"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IIIIIIIIII)V"),
"(Ljava/lang/String;IIIIIIII)V"),
JNI_FALSE);
CHECK_NULL_RETURN(
notifyOutputDestroyedMID = (*env)->GetMethodID(env, clazz,
@@ -236,8 +221,6 @@ WLOutputDeregister(struct wl_registry *wl_registry, uint32_t id)
wl_output_destroy(cur->wl_output);
WLOutput * next = cur->next;
free(cur->name);
free(cur->make);
free(cur->model);
free(cur);
cur = next;
} else {
@@ -283,7 +266,7 @@ WLOutputByID(uint32_t id)
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL
Java_sun_awt_wl_WLGraphicsEnvironment_initVKWL(JNIEnv *env, jclass wlge, jboolean verbose, jint requestedDevice)
Java_sun_awt_wl_WLGraphicsEnvironment_initVKWL(JNIEnv *env, jclass wlge)
{
jboolean vkwlAvailable = JNI_FALSE;
/* TODO: The following sequence lead to uninitialized awt lock
@@ -295,7 +278,7 @@ Java_sun_awt_wl_WLGraphicsEnvironment_initVKWL(JNIEnv *env, jclass wlge, jboolea
WLGraphicsEnvironment.initVKWL()
*/
//AWT_LOCK();
vkwlAvailable = VK_Init(verbose, requestedDevice);
vkwlAvailable = VK_Init();
//AWT_UNLOCK();
return vkwlAvailable;
}

View File

@@ -58,7 +58,6 @@ struct wl_display *wl_display = NULL;
struct wl_shm *wl_shm = NULL;
struct wl_compositor *wl_compositor = NULL;
struct xdg_wm_base *xdg_wm_base = NULL;
struct xdg_activation_v1 *xdg_activation_v1 = NULL;
struct wl_seat *wl_seat = NULL;
struct wl_keyboard *wl_keyboard;
@@ -66,11 +65,8 @@ struct wl_pointer *wl_pointer;
struct wl_cursor_theme *wl_cursor_theme = NULL;
struct wl_surface *wl_surface_in_focus = NULL;
uint32_t last_mouse_pressed_serial = 0;
uint32_t last_pointer_enter_serial = 0;
uint32_t last_input_or_focus_serial = 0;
static uint32_t num_of_outstanding_sync = 0;
@@ -315,7 +311,6 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer, uint32_t serial,
pointer_event.button = button,
pointer_event.state = state;
if (state) {
last_input_or_focus_serial = serial;
last_mouse_pressed_serial = serial;
}
}
@@ -457,9 +452,6 @@ static void
wl_keyboard_enter(void *data, struct wl_keyboard *wl_keyboard,
uint32_t serial, struct wl_surface *surface, struct wl_array *keys)
{
wl_surface_in_focus = surface;
last_input_or_focus_serial = serial;
JNIEnv* env = getEnv();
(*env)->CallStaticVoidMethod(env,
tkClass,
@@ -489,8 +481,6 @@ static void
wl_keyboard_key(void *data, struct wl_keyboard *wl_keyboard,
uint32_t serial, uint32_t time, uint32_t evdev_key, uint32_t state)
{
last_input_or_focus_serial = serial;
const uint32_t scancode = evdev_key + 8;
const uint32_t keychar32 = xkb_ifs.xkb_state_key_get_utf32(xkb_state, scancode);
const xkb_keysym_t keysym = xkb_ifs.xkb_state_key_get_one_sym(xkb_state, scancode);
@@ -513,8 +503,6 @@ static void
wl_keyboard_leave(void *data, struct wl_keyboard *wl_keyboard,
uint32_t serial, struct wl_surface *surface)
{
wl_surface_in_focus = NULL;
JNIEnv* env = getEnv();
(*env)->CallStaticVoidMethod(env,
tkClass,
@@ -530,8 +518,6 @@ wl_keyboard_modifiers(void *data, struct wl_keyboard *wl_keyboard,
uint32_t mods_latched, uint32_t mods_locked,
uint32_t group)
{
last_input_or_focus_serial = serial;
xkb_ifs.xkb_state_update_mask(xkb_state,
mods_depressed,
mods_latched,
@@ -682,8 +668,6 @@ registry_global(void *data, struct wl_registry *wl_registry,
} else if (strcmp(interface, wl_output_interface.name) == 0) {
WLOutputRegister(wl_registry, name);
process_new_listener_before_end_of_init();
} else if (strcmp(interface, xdg_activation_v1_interface.name) == 0) {
xdg_activation_v1 = wl_registry_bind(wl_registry, name, &xdg_activation_v1_interface, 1);
}
#ifdef WAKEFIELD_ROBOT
else if (strcmp(interface, wakefield_interface.name) == 0) {

View File

@@ -26,7 +26,6 @@
#include <wayland-client.h>
#include <wayland-cursor.h>
#include "xdg-shell-client-protocol.h"
#include "xdg-activation-v1-client-protocol.h"
#define CHECK_NULL_THROW_OOME_RETURN(env, x, msg, z)\
do { \
@@ -49,14 +48,10 @@ extern struct wl_display *wl_display;
extern struct wl_pointer *wl_pointer;
extern struct wl_compositor *wl_compositor;
extern struct xdg_wm_base *xdg_wm_base;
extern struct xdg_activation_v1 *xdg_activation_v1;
extern struct wl_cursor_theme *wl_cursor_theme;
extern struct wl_surface *wl_surface_in_focus;
extern uint32_t last_mouse_pressed_serial;
extern uint32_t last_pointer_enter_serial;
extern uint32_t last_input_or_focus_serial;
JNIEnv *getEnv();

View File

@@ -1,413 +0,0 @@
/* Generated by wayland-scanner 1.18.0 */
#ifndef XDG_ACTIVATION_V1_CLIENT_PROTOCOL_H
#define XDG_ACTIVATION_V1_CLIENT_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @page page_xdg_activation_v1 The xdg_activation_v1 protocol
* Protocol for requesting activation of surfaces
*
* @section page_desc_xdg_activation_v1 Description
*
* The way for a client to pass focus to another toplevel is as follows.
*
* The client that intends to activate another toplevel uses the
* xdg_activation_v1.get_activation_token request to get an activation token.
* This token is then forwarded to the client, which is supposed to activate
* one of its surfaces, through a separate band of communication.
*
* One established way of doing this is through the XDG_ACTIVATION_TOKEN
* environment variable of a newly launched child process. The child process
* should unset the environment variable again right after reading it out in
* order to avoid propagating it to other child processes.
*
* Another established way exists for Applications implementing the D-Bus
* interface org.freedesktop.Application, which should get their token under
* XDG_ACTIVATION_TOKEN on their platform_data.
*
* In general activation tokens may be transferred across clients through
* means not described in this protocol.
*
* The client to be activated will then pass the token
* it received to the xdg_activation_v1.activate request. The compositor can
* then use this token to decide how to react to the activation request.
*
* The token the activating client gets may be ineffective either already at
* the time it receives it, for example if it was not focused, for focus
* stealing prevention. The activating client will have no way to discover
* the validity of the token, and may still forward it to the to be activated
* client.
*
* The created activation token may optionally get information attached to it
* that can be used by the compositor to identify the application that we
* intend to activate. This can for example be used to display a visual hint
* about what application is being started.
*
* Warning! The protocol described in this file is currently in the testing
* phase. Backward compatible changes may be added together with the
* corresponding interface version bump. Backward incompatible changes can
* only be done by creating a new major version of the extension.
*
* @section page_ifaces_xdg_activation_v1 Interfaces
* - @subpage page_iface_xdg_activation_v1 - interface for activating surfaces
* - @subpage page_iface_xdg_activation_token_v1 - an exported activation handle
* @section page_copyright_xdg_activation_v1 Copyright
* <pre>
*
* Copyright © 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
* Copyright © 2020 Carlos Garnacho <carlosg@gnome.org>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct wl_seat;
struct wl_surface;
struct xdg_activation_token_v1;
struct xdg_activation_v1;
/**
* @page page_iface_xdg_activation_v1 xdg_activation_v1
* @section page_iface_xdg_activation_v1_desc Description
*
* A global interface used for informing the compositor about applications
* being activated or started, or for applications to request to be
* activated.
* @section page_iface_xdg_activation_v1_api API
* See @ref iface_xdg_activation_v1.
*/
/**
* @defgroup iface_xdg_activation_v1 The xdg_activation_v1 interface
*
* A global interface used for informing the compositor about applications
* being activated or started, or for applications to request to be
* activated.
*/
extern const struct wl_interface xdg_activation_v1_interface;
/**
* @page page_iface_xdg_activation_token_v1 xdg_activation_token_v1
* @section page_iface_xdg_activation_token_v1_desc Description
*
* An object for setting up a token and receiving a token handle that can
* be passed as an activation token to another client.
*
* The object is created using the xdg_activation_v1.get_activation_token
* request. This object should then be populated with the app_id, surface
* and serial information and committed. The compositor shall then issue a
* done event with the token. In case the request's parameters are invalid,
* the compositor will provide an invalid token.
* @section page_iface_xdg_activation_token_v1_api API
* See @ref iface_xdg_activation_token_v1.
*/
/**
* @defgroup iface_xdg_activation_token_v1 The xdg_activation_token_v1 interface
*
* An object for setting up a token and receiving a token handle that can
* be passed as an activation token to another client.
*
* The object is created using the xdg_activation_v1.get_activation_token
* request. This object should then be populated with the app_id, surface
* and serial information and committed. The compositor shall then issue a
* done event with the token. In case the request's parameters are invalid,
* the compositor will provide an invalid token.
*/
extern const struct wl_interface xdg_activation_token_v1_interface;
#define XDG_ACTIVATION_V1_DESTROY 0
#define XDG_ACTIVATION_V1_GET_ACTIVATION_TOKEN 1
#define XDG_ACTIVATION_V1_ACTIVATE 2
/**
* @ingroup iface_xdg_activation_v1
*/
#define XDG_ACTIVATION_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_v1
*/
#define XDG_ACTIVATION_V1_GET_ACTIVATION_TOKEN_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_v1
*/
#define XDG_ACTIVATION_V1_ACTIVATE_SINCE_VERSION 1
/** @ingroup iface_xdg_activation_v1 */
static inline void
xdg_activation_v1_set_user_data(struct xdg_activation_v1 *xdg_activation_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) xdg_activation_v1, user_data);
}
/** @ingroup iface_xdg_activation_v1 */
static inline void *
xdg_activation_v1_get_user_data(struct xdg_activation_v1 *xdg_activation_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) xdg_activation_v1);
}
static inline uint32_t
xdg_activation_v1_get_version(struct xdg_activation_v1 *xdg_activation_v1)
{
return wl_proxy_get_version((struct wl_proxy *) xdg_activation_v1);
}
/**
* @ingroup iface_xdg_activation_v1
*
* Notify the compositor that the xdg_activation object will no longer be
* used.
*
* The child objects created via this interface are unaffected and should
* be destroyed separately.
*/
static inline void
xdg_activation_v1_destroy(struct xdg_activation_v1 *xdg_activation_v1)
{
wl_proxy_marshal((struct wl_proxy *) xdg_activation_v1,
XDG_ACTIVATION_V1_DESTROY);
wl_proxy_destroy((struct wl_proxy *) xdg_activation_v1);
}
/**
* @ingroup iface_xdg_activation_v1
*
* Creates an xdg_activation_token_v1 object that will provide
* the initiating client with a unique token for this activation. This
* token should be offered to the clients to be activated.
*/
static inline struct xdg_activation_token_v1 *
xdg_activation_v1_get_activation_token(struct xdg_activation_v1 *xdg_activation_v1)
{
struct wl_proxy *id;
id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_activation_v1,
XDG_ACTIVATION_V1_GET_ACTIVATION_TOKEN, &xdg_activation_token_v1_interface, NULL);
return (struct xdg_activation_token_v1 *) id;
}
/**
* @ingroup iface_xdg_activation_v1
*
* Requests surface activation. It's up to the compositor to display
* this information as desired, for example by placing the surface above
* the rest.
*
* The compositor may know who requested this by checking the activation
* token and might decide not to follow through with the activation if it's
* considered unwanted.
*
* Compositors can ignore unknown activation tokens when an invalid
* token is passed.
*/
static inline void
xdg_activation_v1_activate(struct xdg_activation_v1 *xdg_activation_v1, const char *token, struct wl_surface *surface)
{
wl_proxy_marshal((struct wl_proxy *) xdg_activation_v1,
XDG_ACTIVATION_V1_ACTIVATE, token, surface);
}
#ifndef XDG_ACTIVATION_TOKEN_V1_ERROR_ENUM
#define XDG_ACTIVATION_TOKEN_V1_ERROR_ENUM
enum xdg_activation_token_v1_error {
/**
* The token has already been used previously
*/
XDG_ACTIVATION_TOKEN_V1_ERROR_ALREADY_USED = 0,
};
#endif /* XDG_ACTIVATION_TOKEN_V1_ERROR_ENUM */
/**
* @ingroup iface_xdg_activation_token_v1
* @struct xdg_activation_token_v1_listener
*/
struct xdg_activation_token_v1_listener {
/**
* the exported activation token
*
* The 'done' event contains the unique token of this activation
* request and notifies that the provider is done.
* @param token the exported activation token
*/
void (*done)(void *data,
struct xdg_activation_token_v1 *xdg_activation_token_v1,
const char *token);
};
/**
* @ingroup iface_xdg_activation_token_v1
*/
static inline int
xdg_activation_token_v1_add_listener(struct xdg_activation_token_v1 *xdg_activation_token_v1,
const struct xdg_activation_token_v1_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) xdg_activation_token_v1,
(void (**)(void)) listener, data);
}
#define XDG_ACTIVATION_TOKEN_V1_SET_SERIAL 0
#define XDG_ACTIVATION_TOKEN_V1_SET_APP_ID 1
#define XDG_ACTIVATION_TOKEN_V1_SET_SURFACE 2
#define XDG_ACTIVATION_TOKEN_V1_COMMIT 3
#define XDG_ACTIVATION_TOKEN_V1_DESTROY 4
/**
* @ingroup iface_xdg_activation_token_v1
*/
#define XDG_ACTIVATION_TOKEN_V1_DONE_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_token_v1
*/
#define XDG_ACTIVATION_TOKEN_V1_SET_SERIAL_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_token_v1
*/
#define XDG_ACTIVATION_TOKEN_V1_SET_APP_ID_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_token_v1
*/
#define XDG_ACTIVATION_TOKEN_V1_SET_SURFACE_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_token_v1
*/
#define XDG_ACTIVATION_TOKEN_V1_COMMIT_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_token_v1
*/
#define XDG_ACTIVATION_TOKEN_V1_DESTROY_SINCE_VERSION 1
/** @ingroup iface_xdg_activation_token_v1 */
static inline void
xdg_activation_token_v1_set_user_data(struct xdg_activation_token_v1 *xdg_activation_token_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) xdg_activation_token_v1, user_data);
}
/** @ingroup iface_xdg_activation_token_v1 */
static inline void *
xdg_activation_token_v1_get_user_data(struct xdg_activation_token_v1 *xdg_activation_token_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) xdg_activation_token_v1);
}
static inline uint32_t
xdg_activation_token_v1_get_version(struct xdg_activation_token_v1 *xdg_activation_token_v1)
{
return wl_proxy_get_version((struct wl_proxy *) xdg_activation_token_v1);
}
/**
* @ingroup iface_xdg_activation_token_v1
*
* Provides information about the seat and serial event that requested the
* token.
*
* The serial can come from an input or focus event. For instance, if a
* click triggers the launch of a third-party client, the launcher client
* should send a set_serial request with the serial and seat from the
* wl_pointer.button event.
*
* Some compositors might refuse to activate toplevels when the token
* doesn't have a valid and recent enough event serial.
*
* Must be sent before commit. This information is optional.
*/
static inline void
xdg_activation_token_v1_set_serial(struct xdg_activation_token_v1 *xdg_activation_token_v1, uint32_t serial, struct wl_seat *seat)
{
wl_proxy_marshal((struct wl_proxy *) xdg_activation_token_v1,
XDG_ACTIVATION_TOKEN_V1_SET_SERIAL, serial, seat);
}
/**
* @ingroup iface_xdg_activation_token_v1
*
* The requesting client can specify an app_id to associate the token
* being created with it.
*
* Must be sent before commit. This information is optional.
*/
static inline void
xdg_activation_token_v1_set_app_id(struct xdg_activation_token_v1 *xdg_activation_token_v1, const char *app_id)
{
wl_proxy_marshal((struct wl_proxy *) xdg_activation_token_v1,
XDG_ACTIVATION_TOKEN_V1_SET_APP_ID, app_id);
}
/**
* @ingroup iface_xdg_activation_token_v1
*
* This request sets the surface requesting the activation. Note, this is
* different from the surface that will be activated.
*
* Some compositors might refuse to activate toplevels when the token
* doesn't have a requesting surface.
*
* Must be sent before commit. This information is optional.
*/
static inline void
xdg_activation_token_v1_set_surface(struct xdg_activation_token_v1 *xdg_activation_token_v1, struct wl_surface *surface)
{
wl_proxy_marshal((struct wl_proxy *) xdg_activation_token_v1,
XDG_ACTIVATION_TOKEN_V1_SET_SURFACE, surface);
}
/**
* @ingroup iface_xdg_activation_token_v1
*
* Requests an activation token based on the different parameters that
* have been offered through set_serial, set_surface and set_app_id.
*/
static inline void
xdg_activation_token_v1_commit(struct xdg_activation_token_v1 *xdg_activation_token_v1)
{
wl_proxy_marshal((struct wl_proxy *) xdg_activation_token_v1,
XDG_ACTIVATION_TOKEN_V1_COMMIT);
}
/**
* @ingroup iface_xdg_activation_token_v1
*
* Notify the compositor that the xdg_activation_token_v1 object will no
* longer be used.
*/
static inline void
xdg_activation_token_v1_destroy(struct xdg_activation_token_v1 *xdg_activation_token_v1)
{
wl_proxy_marshal((struct wl_proxy *) xdg_activation_token_v1,
XDG_ACTIVATION_TOKEN_V1_DESTROY);
wl_proxy_destroy((struct wl_proxy *) xdg_activation_token_v1);
}
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,84 +0,0 @@
/* Generated by wayland-scanner 1.18.0 */
/*
* Copyright © 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
* Copyright © 2020 Carlos Garnacho <carlosg@gnome.org>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
#define WL_PRIVATE __attribute__ ((visibility("hidden")))
#else
#define WL_PRIVATE
#endif
extern const struct wl_interface wl_seat_interface;
extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface xdg_activation_token_v1_interface;
static const struct wl_interface *xdg_activation_v1_types[] = {
NULL,
&xdg_activation_token_v1_interface,
NULL,
&wl_surface_interface,
NULL,
&wl_seat_interface,
&wl_surface_interface,
};
static const struct wl_message xdg_activation_v1_requests[] = {
{ "destroy", "", xdg_activation_v1_types + 0 },
{ "get_activation_token", "n", xdg_activation_v1_types + 1 },
{ "activate", "so", xdg_activation_v1_types + 2 },
};
WL_PRIVATE const struct wl_interface xdg_activation_v1_interface = {
"xdg_activation_v1", 1,
3, xdg_activation_v1_requests,
0, NULL,
};
static const struct wl_message xdg_activation_token_v1_requests[] = {
{ "set_serial", "uo", xdg_activation_v1_types + 4 },
{ "set_app_id", "s", xdg_activation_v1_types + 0 },
{ "set_surface", "o", xdg_activation_v1_types + 6 },
{ "commit", "", xdg_activation_v1_types + 0 },
{ "destroy", "", xdg_activation_v1_types + 0 },
};
static const struct wl_message xdg_activation_token_v1_events[] = {
{ "done", "s", xdg_activation_v1_types + 0 },
};
WL_PRIVATE const struct wl_interface xdg_activation_token_v1_interface = {
"xdg_activation_token_v1", 1,
5, xdg_activation_token_v1_requests,
1, xdg_activation_token_v1_events,
};

View File

@@ -53,9 +53,7 @@ gtest/MetaspaceGtests.java#balanced-no-ccs initial_run generic-all
gtest/MetaspaceGtests.java#reclaim-aggressive-ndebug initial_run generic-all
gtest/LargePageGtests.java#use-large-pages initial_run linux-all,windows-all
gtest/NMTGtests.java#nmt-detail JBR-5718 generic-all
gtest/NMTGtests.java#nmt-off JBR-5718 generic-all
gtest/NMTGtests.java#nmt-summary JBR-5718 generic-all
gtest/NMTGtests.java JBR-5718 generic-all
gc/stress/TestReclaimStringsLeaksMemory.java initial_run windows-all
@@ -258,11 +256,13 @@ vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Multi/Multi005/TestDescription
gc/shenandoah/mxbeans/TestChurnNotifications.java#aggressive NO_BUG macosx_all
runtime/cds/appcds/CommandLineFlagCombo.java NO_BUG generic_all
runtime/cds/appcds/TestDumpClassListSource.java NO_BUG generic_all
runtime/cds/appcds/CommandLineFlagCombo.java NO_BUG generic_all
runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchiveNoDefaultArchive.java NO_BUG generic_all
runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchiveUpgrade.java NO_BUG generic_all
runtime/cds/CheckDefaultArchiveFile.java NO_BUG generic_all
serviceability/jvmti/SetBreakpoint/TestManyBreakpoints.java NO_BUG linux_aarch64
vmTestbase/nsk/stress/thread/thread008.java initial_run windows-all
compiler/vectorapi/VectorRebracket128Test.java NO_BUG linux_aarch64

View File

@@ -785,251 +785,3 @@ jdk_containers_extended = \
:jdk_io \
:jdk_nio \
:jdk_svc
# Wayland tests to be executed with -Dawt.toolkit.name=WLToolkit
jdk_awt_wayland = \
:jdk_awt \
-com/apple/eawt \
-com/apple/laf \
-sun/awt \
-java/awt/a11y \
-java/awt/applet \
-java/awt/BasicStroke/DashOffset.java \
-java/awt/BasicStroke/DashScaleMinWidth.java \
-java/awt/BasicStroke/DashZeroWidth.java \
-java/awt/BorderLayout \
-java/awt/Button \
-java/awt/Checkbox \
-java/awt/Choice \
-java/awt/Clipboard \
-java/awt/ColorClass/AlphaColorTest.java \
-java/awt/Component/7097771 \
-java/awt/Component/CompEventOnHiddenComponent \
-java/awt/Component/ComponentRedrawnTest.java \
-java/awt/Component/CreateImage \
-java/awt/Component/DimensionEncapsulation \
-java/awt/Component/F10TopToplevel \
-java/awt/Component/GetListenersTest.java \
-java/awt/Component/GetScreenLocTest \
-java/awt/Component/InsetsEncapsulation \
-java/awt/Component/isLightweightCrash \
-java/awt/Component/NativeInLightShow \
-java/awt/Component/NoUpdateUponShow \
-java/awt/Component/PaintAll \
-java/awt/Component/PrintAllXcheckJNI \
-java/awt/Component/RepaintTest.java \
-java/awt/Component/Revalidate \
-java/awt/Component/SetComponentsBounds \
-java/awt/Component/SetEnabledPerformance \
-java/awt/Component/TreeLockDeadlock \
-java/awt/Component/UpdatingBootTime \
-java/awt/Component/Validate \
-java/awt/ComponentOrientation \
-java/awt/Container \
-java/awt/Cursor \
-java/awt/datatransfer/Clipboard/GetContentsInterruptedTest.java \
-java/awt/datatransfer/ClipboardInterVMTest/ClipboardInterVMTest.java \
-java/awt/datatransfer/ConstructFlavoredObjectTest/ConstructFlavoredObjectTest.java \
-java/awt/datatransfer/CustomClassLoaderTransferTest/CustomClassLoaderTransferTest.java \
-java/awt/datatransfer/DataFlavor/DataFlavorRemoteTest.java \
-java/awt/datatransfer/DragImage/MultiResolutionDragImageTest.java \
-java/awt/datatransfer/HTMLDataFlavors/ManualHTMLDataFlavorTest.html \
-java/awt/datatransfer/ImageTransfer/ImageTransferTest.java \
-java/awt/datatransfer/Independence/IndependenceAWTTest.java \
-java/awt/datatransfer/Independence/IndependenceSwingTest.java \
-java/awt/datatransfer/SystemFlavorMap/AddFlavorTest.java \
-java/awt/datatransfer/SystemSelection/SystemSelectionAWTTest.java \
-java/awt/datatransfer/SystemSelection/SystemSelectionSwingTest.java \
-java/awt/datatransfer/UnicodeTransferTest/UnicodeTransferTest.java \
-java/awt/Debug \
-java/awt/Desktop \
-java/awt/Dialog \
-java/awt/dnd \
-java/awt/EmbeddedFrame \
-java/awt/event \
-java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java \
-java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java \
-java/awt/EventDispatchThread/PropertyPermissionOnEDT/PropertyPermissionOnEDT.java \
-java/awt/EventQueue/6980209/bug6980209.java \
-java/awt/FileDialog \
-java/awt/FlowLayout \
-java/awt/Focus/6378278 \
-java/awt/Focus/6382144 \
-java/awt/Focus/6401036 \
-java/awt/Focus/6981400 \
-java/awt/Focus/8000326 \
-java/awt/Focus/8013611 \
-java/awt/Focus/8073453 \
-java/awt/Focus/8282640 \
-java/awt/Focus/ActualFocusedWindowTest \
-java/awt/Focus/AppletInitialFocusTest \
-java/awt/Focus/AsyncUpFocusCycleTest.java \
-java/awt/Focus/AutoRequestFocusTest \
-java/awt/Focus/Cause \
-java/awt/Focus/ChildWindowFocusTest \
-java/awt/Focus/ChoiceFocus \
-java/awt/Focus/ClearGlobalFocusOwnerTest \
-java/awt/Focus/ClearLwQueueBreakTest \
-java/awt/Focus/ClearMostRecentFocusOwnerTest.java \
-java/awt/Focus/CloseDialogActivateOwnerTest \
-java/awt/Focus/ConsumedTabKeyTest.java \
-java/awt/Focus/ConsumeNextKeyTypedOnModalShowTest \
-java/awt/Focus/ContainerFocusAutoTransferTest \
-java/awt/Focus/DeiconifiedFrameLoosesFocus \
-java/awt/Focus/DisposedWindow \
-java/awt/Focus/EventRetargetTest.java \
-java/awt/Focus/ExtraPropChangeNotifVetoingTest.java \
-java/awt/Focus/FocusEmbeddedFrameTest \
-java/awt/Focus/FocusForRemovedComponentTest.java \
-java/awt/Focus/FocusOwnerFrameOnClick \
-java/awt/Focus/FocusSubRequestTest \
-java/awt/Focus/FocusTransitionTest \
-java/awt/Focus/FocusTraversalPolicy \
-java/awt/Focus/FocusTraversalPolicyIAE.java \
-java/awt/Focus/FrameJumpingToMouse \
-java/awt/Focus/FrameMinimizeTest \
-java/awt/Focus/IconifiedFrameFocusChangeTest \
-java/awt/Focus/InitialFocusTest.java \
-java/awt/Focus/InputVerifierTest3 \
-java/awt/Focus/KeyEventForBadFocusOwnerTest \
-java/awt/Focus/LabelScrollBarFocus.java \
-java/awt/Focus/ModalBlockedStealsFocusTest \
-java/awt/Focus/ModalDialogActivationTest \
-java/awt/Focus/ModalDialogInFocusEventTest.java \
-java/awt/Focus/ModalDialogInitialFocusTest \
-java/awt/Focus/ModalExcludedWindowClickTest \
-java/awt/Focus/MouseClickRequestFocusRaceTest \
-java/awt/Focus/NoAutotransferToDisabledCompTest \
-java/awt/Focus/NoFocusOwnerAWTTest.java \
-java/awt/Focus/NoFocusOwnerSwingTest.java \
-java/awt/Focus/NonFocusableBlockedOwnerTest \
-java/awt/Focus/NonFocusableResizableTooSmall \
-java/awt/Focus/NonFocusableWindowTest \
-java/awt/Focus/NullActiveWindowOnFocusLost \
-java/awt/Focus/OwnedWindowFocusIMECrashTest \
-java/awt/Focus/QuickTypeTest.java \
-java/awt/Focus/RemoveAfterRequest \
-java/awt/Focus/RequestFocusAndHideTest \
-java/awt/Focus/RequestFocusByCause \
-java/awt/Focus/RequestFocusToDisabledCompTest \
-java/awt/Focus/RequestOnCompWithNullParent \
-java/awt/Focus/ResetMostRecentFocusOwnerTest \
-java/awt/Focus/RestoreFocusInfiniteLoopTest.java \
-java/awt/Focus/RestoreFocusOnDisabledComponentTest \
-java/awt/Focus/RollbackFocusFromAnotherWindowTest \
-java/awt/Focus/RowToleranceTransitivityTest.java \
-java/awt/Focus/SequencedLightweightRequestsTest.java \
-java/awt/Focus/SetFocusableTest.java \
-java/awt/Focus/ShowFrameCheckForegroundTest \
-java/awt/Focus/SimpleWindowActivationTest \
-java/awt/Focus/SortingFPT \
-java/awt/Focus/TemporaryLostComponentDeadlock.java \
-java/awt/Focus/ToFrontFocusTest \
-java/awt/Focus/TranserFocusToWindow \
-java/awt/Focus/TraversalKeysPropertyNamesTest.java \
-java/awt/Focus/TypeAhead \
-java/awt/Focus/UnaccessibleChoice \
-java/awt/Focus/UpFocusCycleTest.java \
-java/awt/Focus/VetoableChangeListenerLoopTest.java \
-java/awt/Focus/WindowInitialFocusTest \
-java/awt/Focus/WindowIsFocusableAccessByThreadsTest \
-java/awt/Focus/WindowUpdateFocusabilityTest \
-java/awt/Focus/WrongKeyTypedConsumedTest \
-java/awt/font/TextLayout/MyanmarTextTest.java \
-java/awt/font/TextLayout/TestJustification.html \
-java/awt/font/TextLayout/TestOldHangul.java \
-java/awt/font/TextLayout/TestTibetan.java \
-java/awt/font/TextLayout/TestVS.java \
-java/awt/font/TextLayout/VariationSelectorTest.java \
-java/awt/FontClass/FontAccess.java \
-java/awt/Frame \
-java/awt/FullScreen/8013581 \
-java/awt/FullScreen/AllFramesMaximize \
-java/awt/FullScreen/AltTabCrashTest \
-java/awt/FullScreen/BufferStrategyExceptionTest \
-java/awt/FullScreen/FullScreenInsets \
-java/awt/FullScreen/FullscreenWindowProps \
-java/awt/FullScreen/TranslucentWindow \
-java/awt/grab \
-java/awt/Graphics/DrawOvalTest.java \
-java/awt/Graphics/LCDTextAndGraphicsState.java \
-java/awt/Graphics/TextAAHintsTest.java \
-java/awt/Graphics/XORPaint.java \
-java/awt/Graphics2D/CopyAreaOOB.java \
-java/awt/GraphicsDevice/DisplayModes/CompareToXrandrTest.java \
-java/awt/GraphicsDevice/DisplayModes/CycleDMImage.java \
-java/awt/GridBagLayout \
-java/awt/GridLayout \
-java/awt/Gtk \
-java/awt/hidpi \
-java/awt/Icon \
-java/awt/im \
-java/awt/image/BufferStrategy/ExceptionAfterComponentDispose.java \
-java/awt/image/MemoryLeakTest/MemoryLeakTest.java \
-java/awt/image/OpaquePNGToGIFTest.java \
-java/awt/image/VolatileImage/DrawBufImgOp.java \
-java/awt/image/VolatileImage/TransparentVImage.java \
-java/awt/image/mlib/MlibOpsTest.java \
-java/awt/image/multiresolution/MenuMultiresolutionIconTest.java \
-java/awt/image/multiresolution/MultiDisplayTest/MultiDisplayTest.java \
-java/awt/image/multiresolution/MultiResolutionJOptionPaneIconTest.java \
-java/awt/image/multiresolution/MultiresolutionIconTest.java \
-java/awt/Insets/CombinedTestApp1.java \
-java/awt/Insets/RemoveMenuBarTest.java \
-java/awt/InputMethods \
-java/awt/JAWT \
-java/awt/keyboard \
-java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest \
-java/awt/KeyboardFocusmanager/TypeAhead \
-java/awt/Label \
-java/awt/Layout \
-java/awt/LightweightComponent \
-java/awt/LightweightDispatcher \
-java/awt/List \
-java/awt/Menu \
-java/awt/MenuBar \
-java/awt/MenuItem \
-java/awt/Mixing \
-java/awt/Modal \
-java/awt/Mouse \
-java/awt/MouseAdapter \
-java/awt/MouseInfo \
-java/awt/MultipleGradientPaint \
-java/awt/Multiscreen/MouseEventTest/MouseEventTest.java \
-java/awt/Multiscreen/MultiScreenInsetsTest/MultiScreenInsetsTest.java \
-java/awt/Multiscreen/MultiScreenLocationTest/MultiScreenLocationTest.java \
-java/awt/Paint/bug8024864.java \
-java/awt/Paint/ButtonRepaint.java \
-java/awt/Paint/CheckboxRepaint.java \
-java/awt/Paint/ComponentIsNotDrawnAfterRemoveAddTest \
-java/awt/Paint/ExposeOnEDT.java \
-java/awt/Paint/LabelRepaint.java \
-java/awt/Paint/ListRepaint.java \
-java/awt/Paint/PaintNativeOnUpdate.java \
-java/awt/Panel \
-java/awt/PopupMenu \
-java/awt/print \
-java/awt/PrintJob \
-java/awt/Robot \
-java/awt/Scrollbar \
-java/awt/ScrollPane \
-java/awt/security \
-java/awt/SplashScreen \
-java/awt/TextArea \
-java/awt/TextComponent \
-java/awt/TextField \
-java/awt/Toolkit/BadDisplayTest/BadDisplayTest.java \
-java/awt/Toolkit/DesktopProperties/rfe4758438.java \
-java/awt/Toolkit/DynamicLayout/bug7172833.java \
-java/awt/Toolkit/Headless/GetPrintJob/GetPrintJob.java \
-java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh \
-java/awt/Toolkit/LockingKeyStateTest/LockingKeyStateTest.java \
-java/awt/Toolkit/RealSync/Test.java \
-java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest.java \
-java/awt/Toolkit/SecurityTest/SecurityTest2.java \
-java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Enable.java \
-java/awt/TrayIcon \
-java/awt/wakefield \
-java/awt/Window \
-java/awt/WMSpecificTests \
-java/awt/xembed

View File

@@ -182,6 +182,13 @@ public class FontExtensionsTest {
return !textDrawingEquals(BASE_FONT, fontWithFeatures(FontExtensions.FeatureTag.FRAC), FRACTION_STRING);
}
@JBRTest
private static Boolean testFeaturesZeroFrac() {
Font fontFZ = fontWithFeatures(FontExtensions.FeatureTag.FRAC, FontExtensions.FeatureTag.ZERO);
return !textDrawingEquals(fontFZ, fontWithFeatures(FontExtensions.FeatureTag.FRAC), ZERO_STRING + " " + FRACTION_STRING) &&
!textDrawingEquals(fontFZ, fontWithFeatures(FontExtensions.FeatureTag.ZERO), ZERO_STRING + " " + FRACTION_STRING);
}
@JBRTest
private static Boolean testFeaturesDerive1() {
Font fontFZ1 = fontWithFeatures(FontExtensions.FeatureTag.FRAC, FontExtensions.FeatureTag.ZERO).

View File

@@ -29,8 +29,6 @@
* @requires (jdk.version.major >= 8 & os.family == "mac")
*/
import sun.lwawt.macosx.LWCToolkit;
import static java.awt.event.KeyEvent.*;
public class KeyCodesTest implements Runnable {
@@ -142,10 +140,6 @@ public class KeyCodesTest implements Runnable {
}
private void verify(String typed, int vk, String layout, int key, int charKeyCode, int location, int modifiers) {
if (!LWCToolkit.isKeyboardLayoutInstalled(layout)) {
System.out.printf("WARNING: Skipping key code test, vk = %d, layout = %s: this layout is not installed", vk, layout);
return;
}
char ch = (typed.length() == 1) ? typed.charAt(0) : 0;
InputMethodTest.section("Key code test: " + vk + ", layout: " + layout + ", char: " + String.format("U+%04X", (int)ch));
InputMethodTest.layout(layout);

View File

@@ -1,26 +1,6 @@
java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java 8202931,JBR-5398 macosx-all,linux-all,windows-all
java/awt/FullScreen/CurrentDisplayModeTest/CurrentDisplayModeTest.java JBR-5059 linux-all
java/awt/FullScreen/MultimonFullscreenTest/MultimonDeadlockTest.java JBR-4379 windows-all
java/awt/GraphicsDevice/DisplayModes/CompareToXrandrTest.java JBR-5062 linux-all
java/awt/datatransfer/Clipboard/GetContentsInterruptedTest.java JBR-5086 linux-5.15.0-46-generic Ubuntu 20.04
java/awt/Frame/FramesGC/FramesGC.java JBR-6057 windows-all
java/awt/Frame/GetGraphicsStressTest/GetGraphicsStressTest.java JBR-5117 linux-all
java/awt/LightweightDispatcher/LWDispatcherMemoryLeakTest.java 8311535 windows-all
java/awt/Multiscreen/WindowGCChangeTest/WindowGCChangeTest.java JBR-5531 macosx-all
java/awt/Robot/MouseLocationOnScreen/MouseLocationOnScreen.java JBR-5390 macosx-all,linux-all
java/awt/Toolkit/AWTEventListenerProxyTest/AWTEventListenerProxyTest.java JBR-6065 windows-all
java/awt/im/memoryleak/InputContextMemoryLeakTest.java JBR-6065 windows-all
javax/swing/JInternalFrame/Test6325652.java JBR-6065 windows-all
javax/swing/JMenu/4692443/bug4692443.java JBR-6065 windows-all
javax/swing/JMenuBar/4750590/bug4750590.java JBR-6065 windows-all
javax/swing/JMenuItem/4171437/bug4171437.java JBR-6065 windows-all
javax/swing/JTextField/8036819/bug8036819.java JBR-6065 windows-all
javax/swing/JTree/4927934/bug4927934.java JBR-6065 windows-all

View File

@@ -343,7 +343,7 @@ java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.java 8017454 macosx-all
java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java JBR-5210 windows-all
java/awt/Frame/MiscUndecorated/ActiveSwingWindowTest.java JBR-5210 windows-all
java/awt/Frame/MiscUndecorated/FrameCloseTest.java JBR-5210 windows-all
java/awt/Frame/MiscUndecorated/RepaintTest.java 8266244,JBR-5786 macosx-aarch64,generic-all
java/awt/Frame/MiscUndecorated/RepaintTest.java 8266244,JBR-5786 macosx-aarch64,linux-all
java/awt/Robot/HiDPIMouseClick/HiDPIRobotMouseClick.java 8253184 windows-all
java/awt/Modal/FileDialog/FileDialogAppModal1Test.java 7186009,8253184,JBR-5827 macosx-all,windows-all,linux-all
java/awt/Modal/FileDialog/FileDialogAppModal2Test.java 7186009,8253184 macosx-all,windows-all
@@ -633,7 +633,6 @@ java/awt/Mouse/MouseWheelAbsXY/MouseWheelAbsXY.java 8253184 windows-all
java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Enable.java 6847163 linux-all
java/awt/xembed/server/RunTestXEmbed.java 7034201 linux-all
java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsDocModalTest.java 8164473 linux-all
java/awt/Frame/DecoratedFrameInsets/DecoratedFrameInsetsTest.java JBR-5205 linux-5.4.0-1103-aws
java/awt/Frame/DisposeParentGC/DisposeParentGC.java 8079786 macosx-all
java/awt/GraphicsDevice/CheckDisplayModes.java 8266242 macosx-aarch64
@@ -663,7 +662,6 @@ java/awt/GridLayout/ComponentPreferredSize/ComponentPreferredSize.java 8238720 w
java/awt/GridLayout/ChangeGridSize/ChangeGridSize.java 8238720 windows-all
java/awt/event/MouseEvent/FrameMouseEventAbsoluteCoordsTest/FrameMouseEventAbsoluteCoordsTest.java 8238720 windows-all
java/awt/wakefield/RobotKeyboard.java JBR-5653 linux-all
java/awt/wakefield/ScreenCapture.java JBR-5653 linux-all
# Several tests which fail sometimes on macos11
@@ -876,7 +874,6 @@ javax/imageio/plugins/external_plugin_tests/TestClassPathPlugin.sh JBR-5363 wind
javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation/JComboBoxPopupLocation.java 8194945 macosx-all
javax/swing/plaf/basic/BasicHTML/4251579/bug4251579.java 8253184,JBR-5510 windows-all,linux-5.18.2-arch1-1
javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java 8253184 windows-all
javax/swing/plaf/basic/BasicTableHeaderUI/6394566/bug6394566.java JBR-5846 windows-all
javax/swing/plaf/basic/BasicTextUI/8001470/bug8001470.java 8233177 linux-all,windows-all
javax/swing/plaf/basic/BasicTreeUI/8023474/bug8023474.java 8253184 linux-all,windows-all
javax/swing/plaf/nimbus/8041642/bug8041642.java 8253184,JBR-5510 windows-all,linux-5.18.2-arch1-1
@@ -897,14 +894,12 @@ javax/swing/JColorChooser/Test6524757.java JBR-5210 windows-all
javax/swing/JColorChooser/Test6827032.java JBR-5210 windows-all
javax/swing/JComboBox/6406264/bug6406264.java JBR-5210 windows-all
javax/swing/JComboBox/bug4890345.java JBR-5799 windows-all
javax/swing/JComboBox/bug4924758.java JBR-5846 windows-all
javax/swing/JComboBox/bug5029504.java JBR-5799 windows-all
javax/swing/JComponent/6683775/bug6683775.java 8172337 generic-all
javax/swing/JDialog/Transparency/TransparencyTest.java 8253184,JBR-5510 windows-all,linux-5.18.2-arch1-1
javax/swing/JLabel/4138746/JLabelMnemonicsTest.java JBR-4949 linux-all,windows-all
javax/swing/JLabel/6596966/bug6596966.java 8197552 windows-all
javax/swing/JLabel/7004134/bug7004134.java JBR-5437 linux-all
javax/swing/JMenu/4515762/bug4515762.java 8197552 windows-all
javax/swing/JMenu/6470128/bug6470128.java 8253184 windows-all
javax/swing/JMenu/6538132/bug6538132.java JBR-894 windows-all00
javax/swing/JMenuItem/4654927/bug4654927.java JBR-164 windows-all
@@ -949,7 +944,6 @@ javax/swing/JEditorPane/bug4714674.java JBR-5810 windows-all
javax/swing/JComboBox/DisabledComboBoxFontTestAuto.java 8310072 linux-all,windows-all
javax/swing/JEditorPane/JEditorPaneGCSwitchTest/JEditorPaneGCSwitchTest_i18n.java JBR-912 windows-all
javax/swing/JEditorPane/JEditorPaneGCSwitchTest/JEditorPaneGCSwitchTest.java JBR-912 windows-all
javax/swing/JFileChooser/4524490/bug4524490.java JBR-5846 windows-all
javax/swing/JFileChooser/8021253/bug8021253.java JBR-107 windows-all
javax/swing/JFileChooser/8041694/bug8041694.java JBR-5210 windows-all
javax/swing/JFileChooser/6396844/TwentyThousandTest.java 8198003 generic-all
@@ -970,11 +964,9 @@ javax/swing/JTabbedPane/4361477/bug4361477.java JBR-5932 linux-all
javax/swing/JTabbedPane/8007563/Test8007563.java 8051591 generic-all
javax/swing/JTabbedPane/4624207/bug4624207.java 8064922,8197552 macosx-all,windows-all 8064922:macosx-all, 8197552:windows-all
javax/swing/JTabbedPane/TestBackgroundScrollPolicy.java 8253184,windows-all
javax/swing/JToggleButton/TestSelectedKey.java JBR-5846 windows-all
javax/swing/JToolBar/4529206/bug4529206.java JBR-5387 linux-all
javax/swing/JToolTip/6219960/bug6219960.java 8253184 windows-all
javax/swing/SwingUtilities/TestBadBreak/TestBadBreak.java 8160720 generic-all
javax/swing/text/AbstractDocument/8190763/TestCCEOnEditEvent.java JBR-5799 windows-all
javax/swing/text/DefaultCaret/HidingSelection/HidingSelectionTest.java JBR-5510 linux-5.18.2-arch1-1
javax/swing/text/TableView/TableViewLayoutTest.java 8194936,JBR-4316,JBR-5510 linux-5.18.2-arch1-1,linux-all
javax/swing/JFileChooser/6798062/bug6798062.java 8146446 windows-all
@@ -1018,7 +1010,7 @@ javax/swing/text/StyledEditorKit/4506788/bug4506788.java JBR-180 windows-all
javax/swing/text/View/8014863/bug8014863.java JBR-5541 windows-all
javax/swing/text/View/8156217/FPMethodCalledTest.java JBR-5541 linux-all
javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java JBR-5952 windows-x64
javax/swing/UIDefaults/6795356/TableTest.java JBR-5767 windows-all
javax/swing/UIDefaults/6795356/TableTest.java.TableTest JBR-5767 windows-all
java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java 8253184 windows-all
java/awt/Robot/HiDPIScreenCapture/ScreenCaptureTest.java 8253184 windows-all
java/awt/Robot/CheckCommonColors/CheckCommonColors.java 8253184,JBR-5510 windows-all,linux-5.18.2-arch1-1
@@ -1032,7 +1024,6 @@ sanity/client/SwingSet/src/FrameDemoTest.java 8253184 windows-all
sanity/client/SwingSet/src/InternalFrameDemoTest.java 8253184 windows-all
sanity/client/SwingSet/src/GridBagLayoutDemoTest.java 8253184 windows-all
sanity/client/SwingSet/src/TextFieldDemoTest.java JBR-5061 linux-5.15.0-39-generic Ubuntu-22.04
sanity/client/SwingSet/src/ToolTipDemoTest.java 8293001 linux-all
sanity/client/SwingSet/src/SliderDemoTest.java 8253184 windows-all
sanity/client/SwingSet/src/SpinnerDemoTest.java 8253184 windows-all
sanity/client/SwingSet/src/SplitPaneDemoTest.java JBR-5817 linux-5.19.0-1025-aws
@@ -1267,7 +1258,6 @@ javax/swing/JSpinner/JSpinnerFocusTest.java JBR-5288 windows-all
javax/swing/JSpinner/SpinnerTest.java JBR-4880 windows-all
javax/swing/JSpinner/TestJSpinnerFocusLost.java JBR-5210 windows-all
javax/swing/JTable/7068740/bug7068740.java 8197552 windows-all
javax/swing/JTable/8236907/LastVisibleRow.java JBR-6066 macosx-aarch64
javax/swing/text/FlowView/LayoutTest.java JBR-4880 windows-all
javax/swing/text/html/7189299/bug7189299.java JBR-4880 windows-all
jb/java/jcef/HandleJSQueryTest3314.sh JBR-4866 linux-all
@@ -1354,7 +1344,6 @@ java/awt/image/VolatileImage/ReportRenderingError.java#windows JBR-5359 windows-
java/awt/Mixing/AWT_Mixing/JGlassPaneInternalFrameOverlapping.java JBR-5359,JBR-5510 windows-aarch64,linux-5.18.2-arch1-1
java/awt/Mixing/AWT_Mixing/JGlassPaneMoveOverlapping.java JBR-5359,JBR-5510 windows-aarch64,linux-5.18.2-arch1-1
java/awt/Mixing/AWT_Mixing/JInternalFrameOverlapping.java JBR-5359,JBR-5510 windows-aarch64,linux-5.18.2-arch1-1
java/awt/Mixing/LWPopupMenu.java JBR-824 generic-all
java/awt/Mixing/OpaqueTest.java JBR-5707 linux-all
java/awt/Mixing/OverlappingButtons.java JBR-5707 linux-all
java/awt/Window/BackgroundIsNotUpdated/BackgroundIsNotUpdated.java JBR-5359,JBR-5510 windows-aarch64,linux-5.18.2-arch1-1
@@ -1377,14 +1366,13 @@ jb/java/awt/CustomTitleBar/HitTestNonClientArea.java JBR-5465,JBR-5550 windows-a
jb/java/awt/CustomTitleBar/MaximizeWindowTest.java JBR-5465,JBR-5550 windows-all
jb/java/awt/CustomTitleBar/MaximizedWindowFocusTest.java JBR-5828 windows-all
jb/java/awt/CustomTitleBar/MinimizingWindowTest.java JBR-5359,JBR-5345 windows-aarch64,windows-x64
jb/java/awt/CustomTitleBar/MouseEventsOnClientArea.java JBR-5910 windows-x64
jb/java/awt/CustomTitleBar/NativeControlsVisibilityTest.java JBR-5359,JBR-5345 windows-aarch64,windows-x64
jb/java/awt/CustomTitleBar/WindowsControlWidthTest.java JBR-5359,JBR-5345 windows-aarch64,windows-x64
jb/java/awt/CustomTitleBar/WindowResizeTest.java JBR-5592 windows-all
sanity/client/SwingSet/src/EditorPaneDemoTest.java JBR-5359,JBR-5510 windows-aarch64,linux-5.18.2-arch1-1
sun/java2d/AcceleratedXORModeTest.java JBR-5359 windows-aarch64
sun/java2d/GdiRendering/ClipShapeRendering.java JBR-5359,JBR-5510 windows-aarch64,linux-5.18.2-arch1-1
sun/java2d/GdiRendering/InsetClipping.java 7124403,JBR-5359,JBR-5510 windows-x64,macosx-all,windows-aarch64,linux-5.18.2-arch1-1
sun/java2d/GdiRendering/InsetClipping.java JBR-5359,JBR-5510 windows-aarch64,linux-5.18.2-arch1-1
java/awt/Choice/PopdownGeneratesMouseEvents/PopdownGeneratesMouseEvents.java JBR-5510 linux-5.18.2-arch1-1
java/awt/Insets/DialogInsets.java JBR-5510 linux-5.18.2-arch1-1

View File

@@ -25,6 +25,8 @@ java/awt/Mouse/ExtraMouseClick/ExtraMouseClick.java JBR-4354 windows-all,linux-a
java/awt/Mouse/MouseComboBoxTest/MouseComboBoxTest.java nobug windows-all
java/awt/Paint/PaintNativeOnUpdate.java nobug windows-all
java/awt/Robot/CheckCommonColors/CheckCommonColors.java nobug windows-all
java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java nobug windows-all
java/awt/Robot/HiDPIScreenCapture/ScreenCaptureTest.java nobug windows-all
java/awt/TextArea/OverScrollTest/OverScrollTest.java nobug windows-all
java/awt/TextField/OverScrollTest/OverScrollTest.java nobug windows-all
java/awt/Window/8159168/SetShapeTest.java nobug windows-all

View File

@@ -30,13 +30,11 @@ import quality.util.RenderUtil;
import java.awt.*;
import java.awt.font.FontRenderContext;
import java.awt.font.GlyphVector;
import java.awt.font.TextAttribute;
import java.awt.font.TextLayout;
import java.awt.geom.AffineTransform;
import java.awt.geom.Path2D;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.util.Map;
public class TextMetricsTest {
@@ -44,6 +42,7 @@ public class TextMetricsTest {
public void testTextBounds() throws Exception {
final Font font = new Font("Menlo", Font.PLAIN, 22);
BufferedImage bi = RenderUtil.capture(120, 120,
g2 -> {
String s = "A";
@@ -93,49 +92,4 @@ public class TextMetricsTest {
Assert.assertTrue(bnd.getX() == 0.0 && bnd.getY() == 0.0 &&
bnd.getWidth() == 0.0 && bnd.getHeight() == 0.0);
}
private static void checkStringWidth(Font font, FontRenderContext frc, String str) {
float width = (float) font.getStringBounds(str.toCharArray(), 0, str.length(), frc).getWidth();
float standard = new TextLayout(str, font, frc).getAdvance();
Assert.assertTrue(Math.abs(width - standard) < 0.1f);
}
private static void checkCalculationStringWidth(Font font, String text) {
AffineTransform affineTransform = new AffineTransform();
Map<TextAttribute, Object> attributes = null;
FontRenderContext frc = new FontRenderContext(affineTransform, true, true);
FontRenderContext baseFrc = new FontRenderContext(new AffineTransform(), true, true);
checkStringWidth(font, frc, text);
checkStringWidth(font.deriveFont(affineTransform), frc, text);
affineTransform.translate(0.5f, 0.0f);
checkStringWidth(font, frc, text);
checkStringWidth(font.deriveFont(affineTransform), baseFrc, text);
attributes = Map.of(TextAttribute.TRACKING, 0.5);
checkStringWidth(font.deriveFont(attributes), baseFrc, text);
attributes = Map.of(TextAttribute.KERNING, TextAttribute.KERNING_ON);
checkStringWidth(font.deriveFont(attributes), baseFrc, text);
attributes = Map.of(TextAttribute.LIGATURES, TextAttribute.LIGATURES_ON);
checkStringWidth(font.deriveFont(attributes), baseFrc, text);
}
@Test
// checking equals of calculation of string's width with two different approach:
// fast implementation inside FontDesignMetrics and guaranteed correct implementation in TextLayout
public void checkCalculationStringWidth() {
final Font font = new Font("Arial", Font.PLAIN, 15);
checkCalculationStringWidth(font,
"AVAVAVAVAVAVAAAAVVAVVAVVVAVAVAVAVAVA !@#$%^&*12345678zc.vbnm.a..s.dfg,hjqwertgyh}{}{}///");
checkCalculationStringWidth(font,
"a");
checkCalculationStringWidth(font,
"世丕且且世两上与丑万丣丕且丗丕");
checkCalculationStringWidth(font,
"\uD83D\uDE06\uD83D\uDE06\uD83D\uDE06\uD83D\uDE06\uD83D\uDE06\uD83D\uDE06\uD83D\uDE06");
}
}