Skip to content

Commit e32d62e

Browse files
committed
8298887: On the latest macOS+XCode the Robot API may report wrong colors
Reviewed-by: phh, andrew Backport-of: ceb6793
1 parent 8b0fedc commit e32d62e

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

jdk/src/macosx/native/sun/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
@@ -324,7 +320,7 @@ static void PostMouseEvent(const CGPoint point, CGMouseButton button,
324320
8, picWidth * sizeof(jint),
325321
picColorSpace,
326322
kCGBitmapByteOrder32Host |
327-
kCGImageAlphaPremultipliedFirst);
323+
kCGImageAlphaNoneSkipFirst);
328324

329325
CGColorSpaceRelease(picColorSpace);
330326

jdk/src/macosx/native/sun/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
@@ -28,14 +28,6 @@
2828
#import "AWTFont.h"
2929
#import <Cocoa/Cocoa.h>
3030

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
/**
3939
* @test
4040
* @key headful
41-
* @bug 8215105
41+
* @bug 8215105 8298887
4242
* @summary tests that Robot can capture the common colors without artifacts
4343
*/
4444
public final class CheckCommonColors {

jdk/test/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)