Compare commits

..

2 Commits

Author SHA1 Message Date
Vitaly Provodin
c45e784795 updated JTreg exclude list 2019-06-28 21:07:59 +07:00
Vitaly Provodin
c319cbe28c updated JTreg exclude list 2019-06-27 10:57:12 +07:00
15 changed files with 155 additions and 451 deletions

View File

@@ -1,2 +0,0 @@
# Default ignored files
/workspace.xml

View File

@@ -1,124 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
</component>
</project>

View File

@@ -82,7 +82,6 @@ test {
// Enable Java2D logging (https://confluence.jetbrains.com/display/JRE/Java2D+Rendering+Logging)
// systemProperty "sun.java2d.trace", "log"
// systemProperty "sun.java2d.debugfonts", "warn"
// systemProperty "sun.java2d.trace", "log,pimpl"
outputs.upToDateWhen { false }

View File

@@ -82,11 +82,11 @@ public class AquaImageFactory {
}
static Image getGenericJavaIcon() {
return checkValidOrStub(java.security.AccessController.doPrivileged(new PrivilegedAction<Image>() {
return java.security.AccessController.doPrivileged(new PrivilegedAction<Image>() {
public Image run() {
return com.apple.eawt.Application.getApplication().getDockIconImage();
}
}));
});
}
static String getPathToThisApplication() {
@@ -496,23 +496,4 @@ public class AquaImageFactory {
public static Color getSelectionInactiveForegroundColorUIResource() {
return new SystemColorProxy(LWCToolkit.getAppleColor(LWCToolkit.INACTIVE_SELECTION_FOREGROUND_COLOR));
}
private static class EmptyImage {
static final BufferedImage INSTANCE;
static {
INSTANCE = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB);
Graphics g = INSTANCE.createGraphics();
g.setColor(new Color(0, 0, 0, 0));
g.fillRect(0, 0, 16, 16);
g.dispose();
}
}
// [tav] a workaround for JBR-1492
private static Image checkValidOrStub(Image image) {
if (image == null || image.getWidth(null) <= 0 || image.getHeight(null) <= 0) {
return EmptyImage.INSTANCE;
}
return image;
}
}

View File

@@ -53,7 +53,6 @@ public abstract class Font2D {
public static final int NATIVE_RANK = 5;
public static final int UNKNOWN_RANK = 6;
public static final int DEFAULT_RANK = 4;
public static final int IDEA_RANK = 7;
private static final String[] boldNames = {
"bold", "demibold", "demi-bold", "demi bold", "negreta", "demi", };

View File

@@ -219,7 +219,7 @@ public class FontFamily {
case Font.PLAIN:
case Font.ITALIC:
return (newWeight <= Font2D.FWEIGHT_NORMAL &&
newWeight >= currFont.getWeight());
newWeight > currFont.getWeight());
case Font.BOLD:
case Font.BOLD|Font.ITALIC:

View File

@@ -82,24 +82,6 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
}
}
private static class TTFilterIdea extends TTFilter {
final private boolean positive;
final private HashSet<String> ideaSet;
public TTFilterIdea(boolean positive, HashSet<String> ideaSet) {
this.positive = positive;
this.ideaSet = ideaSet;
}
@Override
public boolean accept(File dir, String name) {
if (super.accept(dir, name) && ideaSet.contains(name)) {
return positive;
}
return !positive;
}
}
private static class T1Filter implements FilenameFilter {
public boolean accept(File dir,String name) {
if (noType1Font) {
@@ -207,7 +189,6 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
boolean loadedAllFontFiles = false;
HashMap<String,String> jreFontMap;
HashSet<String> jreBundledFontFiles;
HashSet<String> ideaFontSet;
String[] jreOtherFontFiles;
boolean noOtherJREFontFiles = false; // initial assumption.
@@ -243,8 +224,6 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
private static final FilenameFilter ttFilter = new TTFilter();
private static final FilenameFilter t1Filter = new T1Filter();
private FilenameFilter ttFilterIdea;
private FilenameFilter ttFilterJre;
private Font[] allFonts;
private String[] allFamilies; // cache for default locale only
private Locale lastDefaultLocale;
@@ -339,23 +318,6 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
jreFontMap.put("Roboto light", "Roboto-Light.ttf");
jreFontMap.put("Roboto thin", "Roboto-Thin.ttf");
ideaFontSet = new HashSet<>();
ideaFontSet.add("FiraCode-Bold.ttf");
ideaFontSet.add("FiraCode-Light.ttf");
ideaFontSet.add("FiraCode-Medium.ttf");
ideaFontSet.add("FiraCode-Retina.ttf");
ideaFontSet.add("FiraCode-Regular.ttf");
ideaFontSet.add("SourceCodePro-BoldIt.ttf");
ideaFontSet.add("SourceCodePro-Regular.ttf");
ideaFontSet.add("SourceCodePro-Bold.ttf");
ideaFontSet.add("SourceCodePro-It.ttf");
ideaFontSet.add("Inconsolata.ttf");
ideaFontSet.add("Roboto-Light.ttf");
ideaFontSet.add("Roboto-Thin.ttf");
ttFilterIdea = new TTFilterIdea(true, ideaFontSet);
ttFilterJre = new TTFilterIdea(false, ideaFontSet);
for (String ffile : jreFontMap.values()) {
jreBundledFontFiles.add(ffile);
}
@@ -459,7 +421,8 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
/* Linux font configuration uses these fonts */
registerFontDir(jreFontDirName);
}
registerJREFonts();
registerFontsInDir(jreFontDirName, true, Font2D.JRE_RANK,
true, false);
/* Create the font configuration and get any font path
* that might be specified.
@@ -3339,7 +3302,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
/* Called to register fall back fonts */
public void registerFontsInDir(String dirName) {
registerJREFonts();
registerFontsInDir(dirName, true, Font2D.JRE_RANK, true, false);
}
// MACOSX begin -- need to access this in subclass
@@ -3360,18 +3323,6 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
defer, resolveSymLinks);
}
protected void registerJREFonts() {
File pathFile = new File(jreFontDirName);
addDirFonts(jreFontDirName, pathFile, ttFilterIdea,
FONTFORMAT_TRUETYPE, true,
Font2D.IDEA_RANK,
true, false);
addDirFonts(jreFontDirName, pathFile, ttFilterJre,
FONTFORMAT_TRUETYPE, true,
Font2D.JRE_RANK,
true, false);
}
protected void registerFontDir(String path) {
}

View File

@@ -61,9 +61,6 @@ applications/ctw/modules/jdk_jconsole.java 8189604 windows-all
compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java 8190680 generic-all
compiler/uncommontrap/DeoptReallocFailure.java nobug generic-all causes Out of memory: Java heap space affects run status
compiler/uncommontrap/TestDeoptOOM.java nobug generic-all causes Out of memory: Java heap space affects run status
#############################################################################
# :hotspot_gc

View File

@@ -179,7 +179,7 @@ java/awt/Focus/NoAutotransferToDisabledCompTest/NoAutotransferToDisabledCompTest
java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.html 7124275 macosx-all
java/awt/Focus/NonFocusableWindowTest/NoEventsTest.java 8000171 windows-all
java/awt/Focus/OwnedWindowFocusIMECrashTest/OwnedWindowFocusIMECrashTest.java 8169110 macosx-all,windows-all,linux-all
java/awt/Focus/RequestFocusByCause/RequestFocusByCauseTest.java JRE-898 macosx-all,linux-all
java/awt/Focus/RequestFocusByCause/RequestFocusByCauseTest.java JRE-898 macosx-all,linux-all,windows-all
java/awt/Focus/RequestFocusToDisabledCompTest/RequestFocusToDisabledCompTest.java JRE-898 macosx-all
java/awt/Focus/ResetMostRecentFocusOwnerTest/ResetMostRecentFocusOwnerTest.java 8168294 macosx-all,windows-all,linux-all
java/awt/Focus/RollbackFocusFromAnotherWindowTest/RollbackFocusFromAnotherWindowTest.java JRE-898 macosx-all,linux-all
@@ -535,7 +535,7 @@ java/awt/Mouse/EnterExitEvents/ResizingFrameTest.java
java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java 8051455 macosx-all
java/awt/Mouse/ExtraMouseClick/ExtraMouseClick.html 8169534 macosx-all,windows-all,linux-all
java/awt/Mouse/GetMousePositionTest/GetMousePositionWithOverlay.java 8168388 windows-all,macosx-all,linux-all
java/awt/Mouse/GetMousePositionTest/GetMousePositionWithPopup.java 8196017 windows-all,linux-all (linux: NPE commit testing)
java/awt/Mouse/GetMousePositionTest/GetMousePositionWithPopup.java 8196017 windows-all,macosx-all,linux-all (macosx,linux: NPE commit testing)
java/awt/Mouse/MouseComboBoxTest/MouseComboBoxTest.java 8052166 linux-all
java/awt/Mouse/MouseDragEvent/MouseDraggedTest.java 8080676,8129775 generic-all
java/awt/Mouse/MouseModifiersUnitTest/ExtraButtonDrag.java 8013428 generic-all
@@ -904,7 +904,7 @@ javax/sound/midi/Sequencer/Recording.java
# jdk_swing
com/sun/java/swing/plaf/windows/Test8173145.java 8198334 windows-all
javax/swing/AbstractButton/6711682/bug6711682.java 8060765 windows-all,macosx-all
javax/swing/AbstractButton/6711682/bug6711682.java 8060765 windows-all,macosx-all,linux-all
javax/swing/Action/8133039/bug8133039.java 8196089 windows-all,macosx-all
javax/swing/JButton/4368790/bug4368790.java 8065582 macosx-all
javax/swing/JButton/8151303/PressedIconTest.java 8198689 macosx-all,windows-all (windows: commit testing)
@@ -974,7 +974,7 @@ javax/swing/JMenuItem/4171437/bug4171437.java
javax/swing/JMenuItem/4654927/bug4654927.java 8172536 macosx-all,windows-all,linux-all
javax/swing/JMenuItem/6209975/bug6209975.java 8204062 macosx-all,windows-all
javax/swing/JMenuItem/6249972/bug6249972.java 8197552 macosx-all,windows-all,linux-all
javax/swing/JPopupMenu/4458079/bug4458079.java 8040917 macosx-all
javax/swing/JPopupMenu/4458079/bug4458079.java 8040917 macosx-all,windows-all
javax/swing/JPopupMenu/4769039/bug4769039.java 8194045 generic-all
javax/swing/JPopupMenu/4870644/bug4870644.java 8194130 macosx-all,linux-all
javax/swing/JPopupMenu/4966112/bug4966112.java 8064915,7151826 macosx-all,linux-all

View File

@@ -29,7 +29,6 @@ java/awt/Focus/NonFocusableResizableTooSmall/NonFocusableResizableTooSmall.java
java/awt/Focus/NonFocusableWindowTest/NonfocusableOwnerTest.java nobug macosx-all,windows-all,linux-all
java/awt/Focus/RemoveAfterRequest/RemoveAfterRequest.java nobug macosx-all
java/awt/Focus/RequestFocusAndHideTest/RequestFocusAndHideTest.java nobug macosx-all
java/awt/Focus/RequestFocusByCause/RequestFocusByCauseTest.java nobug linux-all,windows-all reproduced with Adopt, OpenJDK
java/awt/Focus/WindowIsFocusableAccessByThreadsTest/WindowIsFocusableAccessByThreadsTest.java nobug macosx-all,windows-all
java/awt/Frame/8158918/SetExtendedState.java nobug linux-all
java/awt/Frame/FrameLocation/FrameLocation.java nobug linux-all
@@ -58,8 +57,6 @@ java/awt/List/ItemEventTest/ItemEventTest.java
java/awt/List/NofocusListDblClickTest/NofocusListDblClickTest.java nobug macosx-all,windows-all
java/awt/List/ListGarbageCollectionTest/AwtListGarbageCollectionTest.java nobug linux-all
java/awt/Menu/NullMenuLabelTest/NullMenuLabelTest.java nobug linux-all
java/awt/Mixing/AWT_Mixing/OpaqueOverlapping.java nobug macosx-all,windows-all
java/awt/Mixing/AWT_Mixing/ViewportOverlapping.java nobug macosx-all,windows-all
java/awt/Mixing/HWDisappear.java nobug macosx-all,windows-all
java/awt/Mixing/JButtonInGlassPane.java nobug macosx-all,linux-all,windows-all
java/awt/Mixing/LWComboBox.java nobug macosx-all,linux-all,windows-all
@@ -70,6 +67,7 @@ java/awt/Mixing/Validating.java
java/awt/Modal/LWModalTest/LWModalTest.java nobug macosx-all,windows-all
java/awt/Modal/ModalDialogOrderingTest/ModalDialogOrderingTest.java nobug macosx-all,windows-all
java/awt/Modal/ToBack/ToBackModeless6Test.java nobug macosx-all,linux-all,windows-all
java/awt/Mouse/MaximizedFrameTest/MaximizedFrameTest.java nobug macosx-all,linux-all
java/awt/Mouse/MouseComboBoxTest/MouseComboBoxTest.java nobug macosx-all,windows-all,linux-all
java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Extra.java nobug macosx-all,linux-all,windows-all
java/awt/Mouse/MouseWheelAbsXY/MouseWheelAbsXY.java nobug macosx-all,windows-all
@@ -153,7 +151,8 @@ java/awt/keyboard/AltPlusNumberKeyCombinationsTest/AltPlusNumberKeyCombinationsT
java/awt/print/PaintSetEnabledDeadlock/PaintSetEnabledDeadlock.java nobug windows-all,linux-all
javax/swing/JComboBox/4199622/bug4199622.java nobug windows-all
javax/swing/JComboBox/4523758/bug4523758.java nobug macosx-all,windows-all
javax/swing/JComboBox/4523758/bug4523758.java nobug macosx-all,windows-all,linux-all
javax/swing/JComponent/6989617/bug6989617.java nobug macosx-all
javax/swing/JDialog/Transparency/TransparencyTest.java nobug linux-all,macosx-all,windows-all
javax/swing/JEditorPane/JEditorPaneGCSwitchTest/JEditorPaneGCSwitchTest.java nobug windows-all
javax/swing/JEditorPane/JEditorPaneGCSwitchTest/JEditorPaneGCSwitchTest_i18n.java nobug windows-all
@@ -175,7 +174,6 @@ javax/swing/JMenu/6538132/bug6538132.java
javax/swing/JMenuItem/8139169/ScreenMenuBarInputTwice.java nobug macosx-all
javax/swing/JMenuItem/8158566/CloseOnMouseClickPropertyTest.java nobug windows-all
javax/swing/JOptionPane/6428694/bug6428694.java nobug windows-all
javax/swing/JPopupMenu/4458079/bug4458079.java nobug windows-all
javax/swing/JPopupMenu/4634626/bug4634626.java nobug windows-all
javax/swing/JPopupMenu/6544309/bug6544309.java nobug linux-all,windows-all
javax/swing/JPopupMenu/6827786/bug6827786.java nobug windows-all
@@ -185,6 +183,7 @@ javax/swing/JScrollBar/7163696/Test7163696.java
javax/swing/JScrollBar/bug4202954/bug4202954.java nobug windows-all
javax/swing/JSlider/6401380/bug6401380.java nobug windows-all
javax/swing/JTabbedPane/7161568/bug7161568.java nobug windows-all
javax/swing/JTabbedPane/7170310/bug7170310.java nobug macosx-all,linux-all
javax/swing/JTextArea/8149849/DNDTextToScaledArea.java nobug windows-all
javax/swing/JToolTip/6219960/bug6219960.java nobug macosx-all,windows-all
javax/swing/JTree/4633594/JTreeFocusTest.java nobug macosx-all,windows-all

View File

@@ -24,26 +24,42 @@
package performance.rendering;
import org.junit.Test;
import util.Renderer;
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
import java.awt.geom.QuadCurve2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
public class RenderPerfTest {
private final static int N = 1000;
private final static float WIDTH = 800;
private final static float HEIGHT = 800;
private final static float R = 25;
private final static int BW = 50;
private final static int BH = 50;
private final static int COUNT = 300;
private final static int DELAY = 10;
private final static int RESOLUTION = 5;
private final static int COLOR_TOLERANCE = 10;
interface Renderable {
void render(Graphics2D g2d);
void update();
}
static class Particles {
private float[] bx;
private float[] by;
@@ -368,7 +384,113 @@ public class RenderPerfTest {
}
}
private static final Particles balls = new Particles(N, R, 0, 0, Renderer.WIDTH, Renderer.HEIGHT);
class PerfMeter {
private int frame = 0;
private JPanel panel;
private long time;
private double execTime = 0;
private Color expColor = Color.RED;
AtomicBoolean waiting = new AtomicBoolean(false);
double exec(final Renderable renderable) throws Exception {
final CountDownLatch latch = new CountDownLatch(COUNT);
final CountDownLatch latchFrame = new CountDownLatch(1);
final JFrame f = new JFrame();
f.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
latchFrame.countDown();
}
});
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
panel = new JPanel()
{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
time = System.nanoTime();
Graphics2D g2d = (Graphics2D) g;
renderable.render(g2d);
g2d.setColor(expColor);
g.fillRect(0, 0, BW, BH);
}
};
panel.setPreferredSize(new Dimension((int)(WIDTH + BW), (int)(HEIGHT + BH)));
panel.setBackground(Color.BLACK);
f.add(panel);
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
f.pack();
f.setVisible(true);
}
});
Robot robot = new Robot();
Timer timer = new Timer(DELAY, e -> {
if (waiting.compareAndSet(false, true)) {
Color c = robot.getPixelColor(
panel.getTopLevelAncestor().getX() + panel.getTopLevelAncestor().getInsets().left + BW / 2,
panel.getTopLevelAncestor().getY() + panel.getTopLevelAncestor().getInsets().top + BW / 2);
if (isAlmostEqual(c, Color.BLUE)) {
expColor = Color.RED;
} else {
expColor = Color.BLUE;
}
renderable.update();
panel.getParent().repaint();
} else {
while (!isAlmostEqual(
robot.getPixelColor(
panel.getTopLevelAncestor().getX() + panel.getTopLevelAncestor().getInsets().left + BW/2,
panel.getTopLevelAncestor().getY() + panel.getTopLevelAncestor().getInsets().top + BH/2),
expColor))
{
try {
Thread.sleep(RESOLUTION);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
}
time = System.nanoTime() - time;
execTime += time;
frame++;
waiting.set(false);
}
latch.countDown();
});
timer.start();
latch.await();
SwingUtilities.invokeAndWait(() -> {
timer.stop();
f.setVisible(false);
f.dispose();
});
latchFrame.await();
return 1e9/(execTime / frame);
}
private boolean isAlmostEqual(Color c1, Color c2) {
return Math.abs(c1.getRed() - c2.getRed()) < COLOR_TOLERANCE ||
Math.abs(c1.getGreen() - c2.getGreen()) < COLOR_TOLERANCE ||
Math.abs(c1.getBlue() - c2.getBlue()) < COLOR_TOLERANCE;
}
}
private static final Particles balls = new Particles(N, R, BW, BH, WIDTH, HEIGHT);
private static final ParticleRenderer flatRenderer = new FlatParticleRenderer(N, R);
private static final ParticleRenderer flatOvalRotRenderer = new FlatOvalRotParticleRenderer(N, R);
private static final ParticleRenderer flatBoxRenderer = new FlatBoxParticleRenderer(N, R);
@@ -398,7 +520,7 @@ public class RenderPerfTest {
@Test
public void testFlatBubbles() throws Exception {
double fps = (new util.Renderer(COUNT)).exec(new Renderer.Renderable() {
double fps = (new PerfMeter()).exec(new Renderable() {
@Override
public void render(Graphics2D g2d) {
balls.render(g2d, flatRenderer);
@@ -408,11 +530,6 @@ public class RenderPerfTest {
public void update() {
balls.update();
}
@Override
public void screenShot(BufferedImage result) {
System.err.println();
}
});
report("FlatOval", fps);
@@ -421,7 +538,7 @@ public class RenderPerfTest {
@Test
public void testFlatBoxBubbles() throws Exception {
double fps = (new util.Renderer(COUNT)).exec(new Renderer.DefaultRenderable() {
double fps = (new PerfMeter()).exec(new Renderable() {
@Override
public void render(Graphics2D g2d) {
balls.render(g2d, flatBoxRenderer);
@@ -439,7 +556,7 @@ public class RenderPerfTest {
@Test
public void testImgBubbles() throws Exception {
double fps = (new util.Renderer(COUNT)).exec(new Renderer.DefaultRenderable() {
double fps = (new PerfMeter()).exec(new Renderable() {
@Override
public void render(Graphics2D g2d) {
balls.render(g2d, imgRenderer);
@@ -457,7 +574,7 @@ public class RenderPerfTest {
@Test
public void testFlatBoxRotBubbles() throws Exception {
double fps = (new util.Renderer(COUNT)).exec(new Renderer.DefaultRenderable() {
double fps = (new PerfMeter()).exec(new Renderable() {
@Override
public void render(Graphics2D g2d) {
balls.render(g2d, flatBoxRotRenderer);
@@ -475,7 +592,7 @@ public class RenderPerfTest {
@Test
public void testFlatOvalRotBubbles() throws Exception {
double fps = (new util.Renderer(COUNT)).exec(new Renderer.DefaultRenderable() {
double fps = (new PerfMeter()).exec(new Renderable() {
@Override
public void render(Graphics2D g2d) {
balls.render(g2d, flatOvalRotRenderer);
@@ -493,7 +610,7 @@ public class RenderPerfTest {
@Test
public void testLinGradOvalRotBubbles() throws Exception {
double fps = (new util.Renderer(COUNT)).exec(new Renderer.DefaultRenderable() {
double fps = (new PerfMeter()).exec(new Renderable() {
@Override
public void render(Graphics2D g2d) {
balls.render(g2d, linGradOvalRotRenderer);
@@ -512,7 +629,7 @@ public class RenderPerfTest {
@Test
public void testWiredBubbles() throws Exception {
double fps = (new util.Renderer(COUNT)).exec(new Renderer.DefaultRenderable() {
double fps = (new PerfMeter()).exec(new Renderable() {
@Override
public void render(Graphics2D g2d) {
balls.render(g2d, wiredRenderer);
@@ -530,7 +647,7 @@ public class RenderPerfTest {
@Test
public void testWiredBoxBubbles() throws Exception {
double fps = (new util.Renderer(COUNT)).exec(new Renderer.DefaultRenderable() {
double fps = (new PerfMeter()).exec(new Renderable() {
@Override
public void render(Graphics2D g2d) {
balls.render(g2d, wiredBoxRenderer);
@@ -548,7 +665,7 @@ public class RenderPerfTest {
@Test
public void testLines() throws Exception {
double fps = (new util.Renderer(COUNT)).exec(new Renderer.DefaultRenderable() {
double fps = (new PerfMeter()).exec(new Renderable() {
@Override
public void render(Graphics2D g2d) {
balls.render(g2d, segRenderer);
@@ -566,7 +683,7 @@ public class RenderPerfTest {
@Test
public void testFlatQuad() throws Exception {
double fps = (new util.Renderer(COUNT)).exec(new Renderer.DefaultRenderable() {
double fps = (new PerfMeter()).exec(new Renderable() {
@Override
public void render(Graphics2D g2d) {
balls.render(g2d, flatQuadRenderer);
@@ -584,7 +701,7 @@ public class RenderPerfTest {
@Test
public void testWiredQuad() throws Exception {
double fps = (new util.Renderer(COUNT)).exec(new Renderer.DefaultRenderable() {
double fps = (new PerfMeter()).exec(new Renderable() {
@Override
public void render(Graphics2D g2d) {
balls.render(g2d, wiredQuadRenderer);
@@ -602,7 +719,7 @@ public class RenderPerfTest {
@Test
public void testTextBubblesNoAA() throws Exception {
double fps = (new util.Renderer(COUNT)).exec(new Renderer.DefaultRenderable() {
double fps = (new PerfMeter()).exec(new Renderable() {
@Override
public void render(Graphics2D g2d) {
balls.render(g2d, textRendererNoAA);
@@ -620,7 +737,7 @@ public class RenderPerfTest {
@Test
public void testTextBubblesLCD() throws Exception {
double fps = (new util.Renderer(COUNT)).exec(new Renderer.DefaultRenderable() {
double fps = (new PerfMeter()).exec(new Renderable() {
@Override
public void render(Graphics2D g2d) {
balls.render(g2d, textRendererLCD);
@@ -638,7 +755,7 @@ public class RenderPerfTest {
@Test
public void testTextBubblesGray() throws Exception {
double fps = (new util.Renderer(COUNT)).exec(new Renderer.DefaultRenderable() {
double fps = (new PerfMeter()).exec(new Renderable() {
@Override
public void render(Graphics2D g2d) {
balls.render(g2d, textRendererGray);
@@ -656,7 +773,7 @@ public class RenderPerfTest {
@Test
public void testWhiteTextBubblesNoAA() throws Exception {
double fps = (new util.Renderer(COUNT)).exec(new Renderer.DefaultRenderable() {
double fps = (new PerfMeter()).exec(new Renderable() {
@Override
public void render(Graphics2D g2d) {
balls.render(g2d, whiteTextRendererNoAA);
@@ -674,7 +791,7 @@ public class RenderPerfTest {
@Test
public void testWhiteTextBubblesLCD() throws Exception {
double fps = (new util.Renderer(COUNT)).exec(new Renderer.DefaultRenderable() {
double fps = (new PerfMeter()).exec(new Renderable() {
@Override
public void render(Graphics2D g2d) {
balls.render(g2d, whiteTextRendererLCD);
@@ -692,7 +809,7 @@ public class RenderPerfTest {
@Test
public void testWhiteTextBubblesGray() throws Exception {
double fps = (new Renderer(COUNT)).exec(new Renderer.DefaultRenderable() {
double fps = (new PerfMeter()).exec(new Renderable() {
@Override
public void render(Graphics2D g2d) {
balls.render(g2d, whiteTextRendererGray);

View File

@@ -1,37 +0,0 @@
package quality.text;
import org.junit.Assert;
import org.junit.Test;
import quality.util.RenderUtil;
import util.Renderer;
import java.awt.*;
import java.awt.image.BufferedImage;
public class FiraCodeScrTest {
@Test
public void testRenderText() throws Exception {
String [] testResult = new String[] {null};
(new util.Renderer(2, 300, 30, true)).exec(new Renderer.DefaultRenderable() {
@Override
public void render(Graphics2D g2d) {
g2d.setColor(Color.WHITE);
Font f = new Font("Fira Code", Font.PLAIN, 12);
g2d.setFont(f);
g2d.drawString("The quick brown fox jumps over the lazy dog", 0, 15);
}
@Override
public void screenShot(BufferedImage result) {
try {
RenderUtil.checkImage(result, "text", "firacode.png");
} catch (Exception e) {
testResult[0] = e.getMessage();
}
}
});
if (testResult[0] != null) Assert.fail(testResult[0]);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -1,170 +0,0 @@
package util;
import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;
public class Renderer {
public final static int WIDTH = 800;
public final static int HEIGHT = 800;
public final static int BW = 50;
public final static int BH = 50;
private final static int RESOLUTION = 5;
private final static int COLOR_TOLERANCE = 10;
private final static int DELAY = 10;
private int frame = 0;
private final int count;
private final int width;
private final int height;
private final boolean capture;
private JPanel panel;
private long time;
private double execTime = 0;
private Color expColor = Color.RED;
AtomicBoolean waiting = new AtomicBoolean(false);
public Renderer(int count) {
this(count, WIDTH, HEIGHT, false);
}
public Renderer(int count, int width, int height, boolean capture) {
this.count = count;
this.width = width;
this.height = height;
this.capture = capture;
}
public double exec(final Renderable renderable) throws Exception {
final CountDownLatch latch = new CountDownLatch(count);
final CountDownLatch latchFrame = new CountDownLatch(1);
final JFrame f = new JFrame();
f.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
latchFrame.countDown();
}
});
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
panel = new JPanel()
{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
time = System.nanoTime();
Graphics2D g2d = (Graphics2D) g;
g2d.translate(BW, BH);
renderable.render(g2d);
g2d.translate(-BW, -BH);
g2d.setColor(expColor);
g.fillRect(0, 0, BW, BH);
}
};
panel.setPreferredSize(new Dimension(width + BW, height + BH));
panel.setBackground(Color.BLACK);
f.add(panel);
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
f.pack();
f.setVisible(true);
}
});
Robot robot = new Robot();
Timer timer = new Timer(DELAY, e -> {
if (waiting.compareAndSet(false, true)) {
Color c = robot.getPixelColor(
panel.getTopLevelAncestor().getX() + panel.getTopLevelAncestor().getInsets().left + BW / 2,
panel.getTopLevelAncestor().getY() + panel.getTopLevelAncestor().getInsets().top + BH / 2);
if (isAlmostEqual(c, Color.BLUE)) {
expColor = Color.RED;
} else {
expColor = Color.BLUE;
}
if (capture) {
renderable.screenShot(robot.createScreenCapture(
new Rectangle(
panel.getTopLevelAncestor().getX() + panel.getTopLevelAncestor().getInsets().left + BW,
panel.getTopLevelAncestor().getY() + panel.getTopLevelAncestor().getInsets().top + BH,
width, height)));
}
renderable.update();
panel.getParent().repaint();
} else {
while (!isAlmostEqual(
robot.getPixelColor(
panel.getTopLevelAncestor().getX() + panel.getTopLevelAncestor().getInsets().left + BW/2,
panel.getTopLevelAncestor().getY() + panel.getTopLevelAncestor().getInsets().top + BH/2),
expColor))
{
try {
Thread.sleep(RESOLUTION);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
}
time = System.nanoTime() - time;
execTime += time;
frame++;
waiting.set(false);
}
latch.countDown();
});
timer.start();
latch.await();
SwingUtilities.invokeAndWait(() -> {
timer.stop();
f.setVisible(false);
f.dispose();
});
latchFrame.await();
return 1e9/(execTime / frame);
}
private boolean isAlmostEqual(Color c1, Color c2) {
return Math.abs(c1.getRed() - c2.getRed()) < COLOR_TOLERANCE ||
Math.abs(c1.getGreen() - c2.getGreen()) < COLOR_TOLERANCE ||
Math.abs(c1.getBlue() - c2.getBlue()) < COLOR_TOLERANCE;
}
public interface Renderable {
void render(Graphics2D g2d);
void update();
void screenShot(BufferedImage result);
}
public static class DefaultRenderable implements Renderable {
@Override
public void render(Graphics2D g2d) {
}
@Override
public void update() {
}
@Override
public void screenShot(BufferedImage result) {
}
}
}