Skip to content

Commit

Permalink
8298887: On the latest macOS+XCode the Robot API may report wrong colors
Browse files Browse the repository at this point in the history
Reviewed-by: azvegint
  • Loading branch information
mrserb committed Dec 22, 2022
1 parent 34cdda5 commit 5012039
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 17 deletions.
6 changes: 1 addition & 5 deletions src/java.desktop/macosx/native/libawt_lwawt/awt/CRobot.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@

#define k_JAVA_ROBOT_WHEEL_COUNT 1

#if !defined(kCGBitmapByteOrder32Host)
#define kCGBitmapByteOrder32Host 0
#endif

// In OS X, left and right mouse button share the same click count.
// That is, if one starts clicking the left button rapidly and then
// switches to the right button, then the click count will continue
Expand Down Expand Up @@ -355,7 +351,7 @@ static inline void autoDelay(BOOL isMove) {
8, picWidth * sizeof(jint),
picColorSpace,
kCGBitmapByteOrder32Host |
kCGImageAlphaPremultipliedFirst);
kCGImageAlphaNoneSkipFirst);

CGColorSpaceRelease(picColorSpace);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2022, 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
Expand Down Expand Up @@ -29,14 +29,6 @@
#import <Cocoa/Cocoa.h>
#import "JNIUtilities.h"

// these flags are not defined on Tiger on PPC, so we need to make them a no-op
#if !defined(kCGBitmapByteOrder32Host)
#define kCGBitmapByteOrder32Host 0
#endif
#if !defined(kCGBitmapByteOrder16Host)
#define kCGBitmapByteOrder16Host 0
#endif

// NOTE : Modify the printSurfaceDataDiagnostics API if you change this enum
enum SDRenderType
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* @test
* @key headful
* @bug 8266079
* @bug 8266079 8298887
* @summary [macosx] window rendering alpha composite test
* @author Alexey Ushakov
* @run main WindowAlphaCompositeTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
/**
* @test
* @key headful
* @bug 8215105 8211999
* @bug 8215105 8211999 8298887
* @summary tests that Robot can capture the common colors without artifacts
* @run main/othervm CheckCommonColors
* @run main/othervm -Xcheck:jni CheckCommonColors
Expand Down
2 changes: 1 addition & 1 deletion test/jdk/java/awt/font/GlyphVector/MultiSlotFontTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

/**
* @test
* @bug 8240756
* @bug 8240756 8298887
* @summary Non-English characters are printed with wrong glyphs on MacOS
* @modules java.desktop/sun.java2d java.desktop/sun.java2d.loops java.desktop/sun.font
* @requires os.family == "mac"
Expand Down

11 comments on commit 5012039

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrserb
Copy link
Member Author

@mrserb mrserb commented on 5012039 Apr 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk20u

@openjdk
Copy link

@openjdk openjdk bot commented on 5012039 Apr 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrserb the backport was successfully created on the branch mrserb-backport-50120396 in my personal fork of openjdk/jdk20u. To create a pull request with this backport targeting openjdk/jdk20u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 50120396 from the openjdk/jdk repository.

The commit being backported was authored by Sergey Bylokhov on 22 Dec 2022 and was reviewed by Alexander Zvegintsev.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk20u:

$ git fetch https://github.com/openjdk-bots/jdk20u.git mrserb-backport-50120396:mrserb-backport-50120396
$ git checkout mrserb-backport-50120396
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk20u.git mrserb-backport-50120396

@mrserb
Copy link
Member Author

@mrserb mrserb commented on 5012039 Apr 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 5012039 Apr 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrserb Could not automatically backport 50120396 to openjdk/jdk17u-dev due to conflicts in the following files:

  • test/jdk/java/awt/AlphaComposite/WindowAlphaCompositeTest.java

Please fetch the appropriate branch/commit and manually resolve these conflicts by using the following commands in your personal fork of openjdk/jdk17u-dev. Note: these commands are just some suggestions and you can use other equivalent commands you know.

# Fetch the up-to-date version of the target branch
$ git fetch --no-tags https://git.openjdk.org/jdk17u-dev.git master:master

# Check out the target branch and create your own branch to backport
$ git checkout master
$ git checkout -b mrserb-backport-50120396

# Fetch the commit you want to backport
$ git fetch --no-tags https://git.openjdk.org/jdk.git 50120396b6cca1219fb5dd42a11e4b29b79bd3bd

# Backport the commit
$ git cherry-pick --no-commit 50120396b6cca1219fb5dd42a11e4b29b79bd3bd
# Resolve conflicts now

# Commit the files you have modified
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport 50120396b6cca1219fb5dd42a11e4b29b79bd3bd'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk17u-dev with the title Backport 50120396b6cca1219fb5dd42a11e4b29b79bd3bd.

@mrserb
Copy link
Member Author

@mrserb mrserb commented on 5012039 Apr 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 5012039 Apr 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrserb Could not automatically backport 50120396 to openjdk/jdk11u-dev due to conflicts in the following files:

  • test/jdk/java/awt/AlphaComposite/WindowAlphaCompositeTest.java

Please fetch the appropriate branch/commit and manually resolve these conflicts by using the following commands in your personal fork of openjdk/jdk11u-dev. Note: these commands are just some suggestions and you can use other equivalent commands you know.

# Fetch the up-to-date version of the target branch
$ git fetch --no-tags https://git.openjdk.org/jdk11u-dev.git master:master

# Check out the target branch and create your own branch to backport
$ git checkout master
$ git checkout -b mrserb-backport-50120396

# Fetch the commit you want to backport
$ git fetch --no-tags https://git.openjdk.org/jdk.git 50120396b6cca1219fb5dd42a11e4b29b79bd3bd

# Backport the commit
$ git cherry-pick --no-commit 50120396b6cca1219fb5dd42a11e4b29b79bd3bd
# Resolve conflicts now

# Commit the files you have modified
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport 50120396b6cca1219fb5dd42a11e4b29b79bd3bd'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk11u-dev with the title Backport 50120396b6cca1219fb5dd42a11e4b29b79bd3bd.

@mrserb
Copy link
Member Author

@mrserb mrserb commented on 5012039 Apr 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk8u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 5012039 Apr 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrserb Could not automatically backport 50120396 to openjdk/jdk8u-dev due to conflicts in the following files:

  • src/java.desktop/macosx/native/libawt_lwawt/awt/CRobot.m
  • test/jdk/java/awt/AlphaComposite/WindowAlphaCompositeTest.java
  • test/jdk/java/awt/Robot/CheckCommonColors/CheckCommonColors.java
  • test/jdk/java/awt/font/GlyphVector/MultiSlotFontTest.java

Please fetch the appropriate branch/commit and manually resolve these conflicts by using the following commands in your personal fork of openjdk/jdk8u-dev. Note: these commands are just some suggestions and you can use other equivalent commands you know.

# Fetch the up-to-date version of the target branch
$ git fetch --no-tags https://git.openjdk.org/jdk8u-dev.git master:master

# Check out the target branch and create your own branch to backport
$ git checkout master
$ git checkout -b mrserb-backport-50120396

# Fetch the commit you want to backport
$ git fetch --no-tags https://git.openjdk.org/jdk.git 50120396b6cca1219fb5dd42a11e4b29b79bd3bd

# Backport the commit
$ git cherry-pick --no-commit 50120396b6cca1219fb5dd42a11e4b29b79bd3bd
# Resolve conflicts now

# Commit the files you have modified
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport 50120396b6cca1219fb5dd42a11e4b29b79bd3bd'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk8u-dev with the title Backport 50120396b6cca1219fb5dd42a11e4b29b79bd3bd.

@mrserb
Copy link
Member Author

@mrserb mrserb commented on 5012039 Apr 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk20u

@openjdk
Copy link

@openjdk openjdk bot commented on 5012039 Apr 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrserb the backport was successfully created on the branch mrserb-backport-50120396 in my personal fork of openjdk/jdk20u. To create a pull request with this backport targeting openjdk/jdk20u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 50120396 from the openjdk/jdk repository.

The commit being backported was authored by Sergey Bylokhov on 22 Dec 2022 and was reviewed by Alexander Zvegintsev.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk20u:

$ git fetch https://github.com/openjdk-bots/jdk20u.git mrserb-backport-50120396:mrserb-backport-50120396
$ git checkout mrserb-backport-50120396
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk20u.git mrserb-backport-50120396

Please sign in to comment.