Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8310847: [Mac] Silence OpenGL deprecation warnings #1161

Closed
wants to merge 2 commits into from

Conversation

beldenfox
Copy link
Contributor

@beldenfox beldenfox commented Jun 24, 2023

The Mac build issues a lot of warnings including several related to the deprecation of OpenGL in macOS 10.14. Now that the deployment target for JavaFX is 11.0 across the board these warnings are showing up on both M1 and Intel builds. Luckily Apple provides a simply way to silence these warnings by setting a single C preprocessor define.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8310847: [Mac] Silence OpenGL deprecation warnings (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1161/head:pull/1161
$ git checkout pull/1161

Update a local copy of the PR:
$ git checkout pull/1161
$ git pull https://git.openjdk.org/jfx.git pull/1161/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1161

View PR using the GUI difftool:
$ git pr show -t 1161

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1161.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 24, 2023

👋 Welcome back beldenfox! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Ready for review label Jun 24, 2023
@mlbridge
Copy link

mlbridge bot commented Jun 24, 2023

Webrevs

@arapte
Copy link
Member

arapte commented Jun 28, 2023

All the OpenGL warnings get silenced except following two:

  1. modules/javafx.graphics/src/main/native-prism-es2/macosx/MacOSXWindowSystemInterface.m:120:24: warning: 'setView:' is deprecated: first deprecated in macOS 10.14 - Use NSOpenGLView to provide OpenGL content in a Cocoa app. [-Wdeprecated-declarations]

  2. modules/javafx.graphics/src/main/native-prism-es2/macosx/MacOSXWindowSystemInterface.m:181:57: warning: 'NSOpenGLCPSwapInterval' is deprecated: first deprecated in macOS 10.14 [-Wdeprecated-declarations]

Could you please take a look why are these not silenced. The other warnings from same file are silenced but not these.
The first warning does not seem like specific to deprecation of OpenGL. But the second one does.
Please take a quick look if can be solved, otherwise looks good.

I shall approve the PR as-is. and shall re-aproove if any changes.

@openjdk
Copy link

openjdk bot commented Jun 28, 2023

@beldenfox This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8310847: [Mac] Silence OpenGL deprecation warnings

Reviewed-by: arapte

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 10 new commits pushed to the master branch:

  • 7e54b63: 8311844: Change JavaFX release version to 22
  • 6961016: 8304439: Subscription based listeners
  • 411c1b1: 8310582: Update copyright header for files modified in 2023
  • a91b34d: 8309935: Mac - SystemMenuBar, IndexOutOfBoundsException on change
  • 8fef6a3: 8231865: JFXPanel sends resize event with size 0x0 on HiDPI devices
  • 8635f81: 8242419: JFXPanel: MouseEvent always reports that Primary button changed state if held
  • 5aad040: 8311127: Regression: The fix for TableView and TreeTableView menu button affects all table column headers
  • 8fd2943: 8283551: ControlAcceleratorSupport menu items listener causes memory leak
  • 8b1a446: 8310638: Filtering a TableView with a large number of items freezes the UI
  • d010d41: 8310846: Skip failing test InitialWindowSizeTest on Linux

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@arapte) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Ready to be integrated label Jun 28, 2023
@openjdk openjdk bot removed the ready Ready to be integrated label Jun 28, 2023
@beldenfox
Copy link
Contributor Author

@arapte NSOpenGLCPSwapInterval is deprecated in favor of NSOpenGLContextParameterSwapInterval. I've updated the PR. Apparently Apple deprecated OpenGL and cleaned up the API all at the same time.

Prism creates an NSOpenGLContext and then attaches it to the NSView using setView:. This approach is deprecated, the recommended way is to create an NSOpenGLView or CAOpenGLLayer and use the associated context. I don't understand Prism at all so can't really address this. (In fact I'm confused. In Glass the 3D view is an NSOpenGLView and also creates a CAOpenGLLayer which seems redundant. Then there's this Prism code that is creating an NSOpenGLContext and attaching it to the NSView? I'm sure it all makes sense but it would nice to see some documentation on how this all hangs together.)

Copy link
Member

@arapte arapte left a comment

Choose a reason for hiding this comment

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

Change looks good.

@openjdk openjdk bot added the ready Ready to be integrated label Jul 14, 2023
@beldenfox
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Ready to sponsor label Jul 14, 2023
@openjdk
Copy link

openjdk bot commented Jul 14, 2023

@beldenfox
Your change (at version f3f8fdd) is now ready to be sponsored by a Committer.

@kevinrushforth
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Jul 14, 2023

Going to push as commit 440ce43.
Since your change was applied there have been 10 commits pushed to the master branch:

  • 7e54b63: 8311844: Change JavaFX release version to 22
  • 6961016: 8304439: Subscription based listeners
  • 411c1b1: 8310582: Update copyright header for files modified in 2023
  • a91b34d: 8309935: Mac - SystemMenuBar, IndexOutOfBoundsException on change
  • 8fef6a3: 8231865: JFXPanel sends resize event with size 0x0 on HiDPI devices
  • 8635f81: 8242419: JFXPanel: MouseEvent always reports that Primary button changed state if held
  • 5aad040: 8311127: Regression: The fix for TableView and TreeTableView menu button affects all table column headers
  • 8fd2943: 8283551: ControlAcceleratorSupport menu items listener causes memory leak
  • 8b1a446: 8310638: Filtering a TableView with a large number of items freezes the UI
  • d010d41: 8310846: Skip failing test InitialWindowSizeTest on Linux

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jul 14, 2023
@openjdk openjdk bot closed this Jul 14, 2023
@openjdk openjdk bot removed ready Ready to be integrated rfr Ready for review sponsor Ready to sponsor labels Jul 14, 2023
@openjdk
Copy link

openjdk bot commented Jul 14, 2023

@kevinrushforth @beldenfox Pushed as commit 440ce43.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@beldenfox beldenfox deleted the macglwarnings branch July 14, 2023 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
3 participants