This repository has been archived by the owner on Feb 25, 2025. It is now read-only.
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.
Composite multiple layers in Windows software rendering #51759
Composite multiple layers in Windows software rendering #51759
Changes from 12 commits
8672c29
c50fde4
06b27c8
ce31f49
4836c57
09a7265
0c3640f
f35f8dd
b7d0d19
0237513
9385e81
bfb94f0
e012e1e
1d11b21
4361321
b0835af
0dba35b
b64637d
27d3405
e2d7bbb
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Could we split this up and have a helper for the compositing step?
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.
For someone not familiar with the bitmap allocation, this
4
might look like a magic value. Could we add a constant for the 4 with a quick comment for clarity?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.
Instead of an instance method that's declared in the header, should we make this be a top-level function in an anonymous namespace in this file?
In my mind the header file is best for public APIs or methods that need to interact with instance fields. However, this helper is self-contained logic that doesn't require any instance members.
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.
Will take a closer look, but first thoughts:
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 suppose the obvious way to parallelize this would be to use the GPU, but this is the software compositor, so that seems self defeating.
Also, I will test adjusting the loop statements once it rebuilds.
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.
Feel free to check now.
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 suspect the right way to parallelize would be to vectorize this code if possible... I wonder if Windows has any helpers that can do efficient bitmap blending? If not, that seems like too much work for an MVP.
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 only ones I'm familiar with work with HDCs instead of pixel data in memory, and so we would need to create those new DCs per layer to apply them as far as I understand
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.
Could we also have a test for layers that don't overlap fully?