-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Simplify CriticalCopyPixels in BitmapSource by removing duplicate type checks #9395
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
Simplify CriticalCopyPixels in BitmapSource by removing duplicate type checks #9395
Conversation
01ead7b
to
ff111c1
Compare
Resolved merge conflicts 06 |
@h3xds1nz this PR is good to be merged. Can you please resolve the merge conflicts? |
ff111c1
to
adf31ec
Compare
@siagupta0202 Done, sorry for the delay. |
@h3xds1nz: Just a ping to let you know that the test failures in this PR were fixed in main, pulling main should fix the failures. |
adf31ec
to
2bd0281
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9395 +/- ##
===================================================
- Coverage 10.99508% 10.95136% -0.04373%
===================================================
Files 3215 3215
Lines 648472 648440 -32
Branches 71534 71528 -6
===================================================
- Hits 71300 71013 -287
- Misses 576170 576436 +266
+ Partials 1002 991 -11
Flags with carried forward coverage won't be shown. Click here to find out more. |
No problem, and thank you so much for your contributions! |
@siagupta0202 Thank you, happy to contribute :) |
Description
Removes redundant type checks second-time around when copying pixels in
CriticalCopyPixels
. There's a small performance improvement, however, the main goal here is decreasing code size, and also code simplification that has been made possible with the introduction ofGetArrayDataReference
few releases ago.Since
Unsafe.AddByteOffset
won't do an index-out-of-bounds check for us, we do it ourselves to keep the same behaviour as previously, throwingIndexOutOfRangeException
on whenoffset
exceeds the array length.Customer Impact
Smaller code-size of PresentationCore.
Regression
No.
Testing
Local build.
Risk
Low.
Microsoft Reviewers: Open in CodeFlow