Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@knopp
Copy link
Member

@knopp knopp commented Mar 1, 2021

flutter/flutter#76789

Supersedes #24629

This PR will use direct composition when available. Tested on Windows 7.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.
  • The reviewer has submitted any presubmit flakes in this PR using the engine presubmit flakes form before re-triggering the failure.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@google-cla google-cla bot added the cla: yes label Mar 1, 2021
@knopp knopp changed the title WIP: Windows: Use direct composition if available Windows: Use direct composition if available Mar 1, 2021
@knopp knopp requested review from cbracken and clarkezone March 1, 2021 12:28
Copy link

@clarkezone clarkezone left a comment

Choose a reason for hiding this comment

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

Would be good to confirm this doesn't break UWP target

@chinmaygarde
Copy link
Member

@knopp Gentle ping about @clarkezone s pending comments.

@knopp
Copy link
Member Author

knopp commented Mar 11, 2021

Sorry, been busy on the MacOS side of things, this slipped my mind. This only needs some minor tweaks, I'll update it soon.

@chinmaygarde
Copy link
Member

@clarkezone Can you re-review this please? @knopp The test failures are due to a commit that has been reverted on ToT. Can you rebase this commit please?

@knopp knopp force-pushed the win_direct_composition branch from 0704fa6 to 9461004 Compare March 19, 2021 17:08
@knopp
Copy link
Member Author

knopp commented Mar 19, 2021

Rebased.

@clarkezone
Copy link

I will take a look this weekend, likely tomorrow (Sunday).


if (!CompositionSupported()) {
// eglPostSubBufferNV during resizing causes significant artifacts on
// Windows 7, so use fixed size surface instead

Choose a reason for hiding this comment

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

Since this code is touching the resize logic, I wonder if we should also revert eglPostSubBufferNV in the non-UWP composition case as well pending flutter/flutter#76465 being addressed. There are reports of the visual artifacts in cases where WM_NCCALCSIZE is not in use (see the thread in the bug) which means the mainstream case can be subject to the artifacts. If you don't want to address in this PR I will do in a follow-on PR. If the new DComp path in some way depends on eglPostSubBufferNV then we may have to hold off on landing this PR until the above big is correctly fixed. That is currently backed up behind the UWP work.

Copy link
Member Author

Choose a reason for hiding this comment

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

The problem with composition enabled (both direct composition and uwp I believe) and recreating surface during resizing is that every now and then you get brief transparent flashes (even with ClearContext in place). I wasn't able to find any workaround for this. So if you decide to revert eglPostSubBufferNV then it would be better to NOT apply this PR until there's proper solution for manual surface resizing.

Choose a reason for hiding this comment

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

I have a possible fix for the resize present issue which I pinged you about.

@clarkezone
Copy link

I have one concern about resize logic expressed in a comment.

@cbracken
Copy link
Member

For triage folks: In #25319, @clarkezone is landing a temporary workaround to the resize issue he alluded to above. That will temporarily put this patch on hold until an upstream ANGLE change and roll can be made.

@knopp knopp changed the title Windows: Use direct composition if available WIP: Windows: Use direct composition if available Mar 31, 2021
@knopp
Copy link
Member Author

knopp commented Mar 31, 2021

I added WIP to this PR, just in case. I'll keep it updated once the Angle part is resolved.

@clarkezone
Copy link

The issue tracking Angle support is here: flutter/flutter#79427

@chinmaygarde chinmaygarde added the Work in progress (WIP) Not ready (yet) for review! label Apr 8, 2021
@gspencergoog
Copy link
Contributor

@knopp any updates on this PR? Are you still planning to land this? (Desktop Triage)

@knopp
Copy link
Member Author

knopp commented Apr 15, 2021

@gspencergoog, not until flutter/flutter#79427 gets resolved. It's probably better to close this for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants