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.
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
AtlasEngine: Fix bugs introduced in 66f4f9d and d74b66a #13496
AtlasEngine: Fix bugs introduced in 66f4f9d and d74b66a #13496
Changes from all commits
0b7a027
565bef6
3e7bbec
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.
hahahaha, ok that makes me feel much better about this
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.
Sorry, I'm just really confused about this. Why are we iterating from the x-coord to the y-coord? The inner loop makes sense because we're looping over each y value. Shouldn't this be looping over the x values then?
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've added a brief comment explaining this peculiar code.
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.
These 3
Buffer
changes should've been here all along. The 3 corresponding STL functions already do exactly the optimal thing: nothing for trivial types (i.e. leave the memory uninitialized) and properly construct/destruct the types if they're proper classes. And in case ofstd::uninitialized_copy_n
in particular it already usesmemmove
for trivial types internally. Perfect!This change allows us to construct a
Buffer<iterator>
which is an array of non-trivial types.BTW/FYI: I didn't use
std::vector
and wroteBuffer
instead, because I want to convey that these things explicitly don't hold resizeable contents (in general). For instance I didn't want apush_back
method on my viewport arrays - that wouldn't make sense so that always felt a bit wrong to me. It also doesn't initialize contents to zero, allowing rapid creation/destruction and you can specify a custom alignment (improves rendering perf by about 20% overstd::vector
IIRC).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.
When you pull these classes out to their own files, explain that ^^ in a 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.
Why do we need clip? I mean, I see that we call
PushAxisAlignedClip()
down below, but it would be nice to add a comment here explaining the purpose of clip and what it fixes, exactly. More just so that anybody that comes along understands this code better.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.
Let me know if the comment I just added is sufficient. 🙂
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.
Love it. Thanks!
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 don't actually understand why we need this clip! We are only filling or stroking within
0,0 .. cellSizeDIP
already; were we measurably "accidentally" drawing into the neighboring tiles? When? How?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'm a bit concerned that D2D might draw lines/rectangles outside of the coordinates I specify, be it due to off-by-fractional-1 bugs or due to AA. I think using a clip rect is more robust and doesn't hurt performance since we only seldomly draw a cursor.