-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
8275715: D3D pipeline processes multiple PaintEvent at initial drawing #6064
Conversation
👋 Welcome back myano! A progress list of the required criteria for merging this PR into |
Webrevs
|
|
||
public class MultiPaintEventTest extends Canvas { | ||
|
||
private int count = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some synchronization is needed, the field is updated on EDT and checked on the main thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed a test as it was pointed out to me.
if (test.getCount() > 1) { | ||
throw new RuntimeException("Processed unnecessary paint()."); | ||
} | ||
} catch (InterruptedException ex) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not ignore an exception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed a test as it was pointed out to me.
@@ -452,7 +452,7 @@ public void run() { | |||
} finally { | |||
rq.unlock(); | |||
} | |||
} else if (!validate(sd)) { | |||
} else if (!validate(sd, true)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment below says that "the surface will also trigger a repaint", will it be possible we will trigger it inside validate here and then later inside "replaceSurfaceDataLater"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this run() is called on "D3D Screen Updater" thread. It is reasonable that a new PaintEvent is posted when SurfaceData is replaced on this thread. I would limit posting new PaintEvent via createGraphics() only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably I should clarify my question, you added a parameter to the validate method and pass the "true" so the "validate" method will post a paint event, but just a few lines below there is a comment that the next code line "sd.getPeer().replaceSurfaceDataLater();" also will post an event. Is the comment outdated, or we will post two of them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neither. replaceSurfaceDataLater() is called when validate() fails to post a PaintEvent. So only one of them will be posted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrserb Could you please review and reply to the above comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrserb Could you please check this pull request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty important block of code and we are about to fork JDK 18 so it should be looked at after that fork.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrserb The fixes in JDK-8270874 have been integrated, so please review this PR again. |
@mrserb Could you please reply to the above comment? |
@mrserb Could you please check this pull request? |
1 similar comment
@mrserb Could you please check this pull request? |
@mrserb How long will it take to review this fix? |
@mrserb Could you please review this PR again? |
@mrserb Could you tell me the confirmation status of this PR? |
The problem I have with this is that this being in createGraphics() isn't obviously relevant to me. |
@prrace createGraphics() is called to create surface during "the first paint event" processing. And validate() posts new PaintEvent with repaintPeerTarget() when creates surface. Current stack trace is here: [1] java.awt.event.PaintEvent. (PaintEvent.java:106) Created surface is normally handled in this processing PaintEvent, so I think there is no need to call repaintPeerTarget(). Also ScreenUpdateManager class which is used for GDI rendering (and parent class of D3DScreenUpdateManager) does not post new PaintEvent at createGraphics(). This validate() is called from createGraphics(), so I hope to reduce to create another PaintEvent at this route only. |
Ok. Please confirm you have run all automated headful jtreg tests on a system with D3D enabled |
I tryed jtreg tests with |
@prrace Could you please check the above comments and reply? |
@prrace How long will it take for you to reply to the comment? |
@masyano 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:
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 1595 new commits pushed to the
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. ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit 415bf44.
Your commit was automatically rebased without conflicts. |
@masyano the new test has an invalid copyright notice: missing comma after 2021, which is causing a tier 1 build failure in our CI. |
@dholmes-ora Thank you for notice. Should I create a new pull request to correct the copyright? |
New bug filed: JDK-8282713 - which will need a new PR. Thanks. |
I opened new PR at #7716. |
FWIW this should not have been pushed without a 2nd reviewer (meaning two approvals). You pushed with only one approval. Bear that in mind ! |
Could you please review the 8275715 bug fixes?
I think D3DScreenUpdateManager posts unnecessary PaintEvent during processing PaintEvent. When the validate method is called from createGraphics, repaintPeerTarget should not be called.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6064/head:pull/6064
$ git checkout pull/6064
Update a local copy of the PR:
$ git checkout pull/6064
$ git pull https://git.openjdk.java.net/jdk pull/6064/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6064
View PR using the GUI difftool:
$ git pr show -t 6064
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6064.diff