Switch from GetDIBits to CreateDIBSection for screen capture on Windows #464
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed in this PR
Switch from
GetDIBitstoCreateDIBSectionfor screen capture on Windows. This is more friendly in terms of how we utilize memory but did not yield performance improvements.This PR includes a new benchmark,
src/tests/bench_grab_windows.py, that was used to measure the performance before and after the changes on two different Windows machines.My measurements shows similar performance when comparing these two approaches.
Test results on a Qualcomm arm64 + Qualcomm Adreno X1-85 GPU:
Test results on a Intel x86_64 + NVIDIA A2000 GPU:
That being said, this new approach involves less memory churn and after testing these changes against issue #268, I was unable to reproduce the issue reported there. Of course, the final verdict will be in the hands of the user who reported the original issue - but closing the issue here as fixed is the right action, so that users will be encouraged to test this on their machines.
Fixes #449, fixes #268
./check.shpassed