8266242: java/awt/GraphicsDevice/CheckDisplayModes.java failing on macOS 11 ARM

Reviewed-by: prr, azvegint, aivanov
This commit is contained in:
Alexander Zuev 2023-10-13 22:53:21 +00:00
parent e942f368c3
commit f7d6d7a04f
2 changed files with 13 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -35,6 +35,7 @@
#define DEFAULT_DEVICE_HEIGHT 768
#define DEFAULT_DEVICE_DPI 72
static NSInteger architecture = -1;
/*
* Convert the mode string to the more convenient bits per pixel value
*/
@ -58,7 +59,17 @@ static int getBPPFromModeString(CFStringRef mode)
return 0;
}
static BOOL isValidDisplayMode(CGDisplayModeRef mode){
static BOOL isValidDisplayMode(CGDisplayModeRef mode) {
// Workaround for apple bug FB13261205, since it only affects arm based macs
// and arm support started with macOS 11 ignore the workaround for previous versions
if (@available(macOS 11, *)) {
if (architecture == -1) {
architecture = [[NSRunningApplication currentApplication] executableArchitecture];
}
if (architecture == NSBundleExecutableArchitectureARM64) {
return (CGDisplayModeGetPixelWidth(mode) >= 800);
}
}
return (1 < CGDisplayModeGetWidth(mode) && 1 < CGDisplayModeGetHeight(mode));
}

View File

@ -462,7 +462,6 @@ java/awt/KeyboardFocusmanager/TypeAhead/MenuItemActivatedTest/MenuItemActivatedT
java/awt/Window/GetScreenLocation/GetScreenLocationTest.java 8225787 linux-x64
java/awt/Dialog/MakeWindowAlwaysOnTop/MakeWindowAlwaysOnTop.java 8266243 macosx-aarch64
java/awt/dnd/BadSerializationTest/BadSerializationTest.java 8277817 linux-x64,windows-x64
java/awt/GraphicsDevice/CheckDisplayModes.java 8266242 macosx-aarch64
java/awt/GraphicsDevice/DisplayModes/UnknownRefrshRateTest.java 8286436 macosx-aarch64
java/awt/image/multiresolution/MultiresolutionIconTest.java 8291979 linux-x64,windows-all
java/awt/event/SequencedEvent/MultipleContextsFunctionalTest.java 8305061 macosx-x64