Skip to content

Commit ceb6793

Browse files
committed
8298887: On the latest macOS+XCode the Robot API may report wrong colors
Reviewed-by: phh Backport-of: 50120396b6cca1219fb5dd42a11e4b29b79bd3bd
1 parent e537b9d commit ceb6793

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

src/java.desktop/macosx/native/libawt_lwawt/awt/CRobot.m

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@
4747

4848
#define k_JAVA_ROBOT_WHEEL_COUNT 1
4949

50-
#if !defined(kCGBitmapByteOrder32Host)
51-
#define kCGBitmapByteOrder32Host 0
52-
#endif
53-
5450
// In OS X, left and right mouse button share the same click count.
5551
// That is, if one starts clicking the left button rapidly and then
5652
// switches to the right button, then the click count will continue
@@ -350,7 +346,7 @@ static inline void autoDelay(BOOL isMove) {
350346
8, picWidth * sizeof(jint),
351347
picColorSpace,
352348
kCGBitmapByteOrder32Host |
353-
kCGImageAlphaPremultipliedFirst);
349+
kCGImageAlphaNoneSkipFirst);
354350

355351
CGColorSpaceRelease(picColorSpace);
356352

src/java.desktop/macosx/native/libawt_lwawt/awt/QuartzSurfaceData.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -29,14 +29,6 @@
2929
#import <Cocoa/Cocoa.h>
3030
#import "JNIUtilities.h"
3131

32-
// these flags are not defined on Tiger on PPC, so we need to make them a no-op
33-
#if !defined(kCGBitmapByteOrder32Host)
34-
#define kCGBitmapByteOrder32Host 0
35-
#endif
36-
#if !defined(kCGBitmapByteOrder16Host)
37-
#define kCGBitmapByteOrder16Host 0
38-
#endif
39-
4032
// NOTE : Modify the printSurfaceDataDiagnostics API if you change this enum
4133
enum SDRenderType
4234
{

test/jdk/java/awt/Robot/CheckCommonColors/CheckCommonColors.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
/**
4141
* @test
4242
* @key headful
43-
* @bug 8215105 8211999
43+
* @bug 8215105 8211999 8298887
4444
* @summary tests that Robot can capture the common colors without artifacts
4545
* @run main/othervm CheckCommonColors
4646
* @run main/othervm -Xcheck:jni CheckCommonColors

test/jdk/java/awt/font/GlyphVector/MultiSlotFontTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/**
2525
* @test
26-
* @bug 8240756
26+
* @bug 8240756 8298887
2727
* @summary Non-English characters are printed with wrong glyphs on MacOS
2828
* @modules java.desktop/sun.java2d java.desktop/sun.java2d.loops java.desktop/sun.font
2929
* @requires os.family == "mac"

0 commit comments

Comments
 (0)