-
-
Notifications
You must be signed in to change notification settings - Fork 892
Modernize and optimize pixel format operations across platforms. #2645
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
Changes from 9 commits
3969525
4931372
b250ac3
4c47a78
d9126ea
5cf8f60
c9b4edd
acaebd9
dfd983f
8af75fe
2de4f2c
cee00af
7b93ee7
3a3ff89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <RuleSet Name="ImageSharp" ToolsVersion="17.0"> | ||
| <Include Path="..\shared-infrastructure\sixlabors.ruleset" Action="Default" /> | ||
| <Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers"> | ||
| <Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp.Features" RuleNamespace="Microsoft.CodeAnalysis.CSharp.Features"> | ||
| <Rule Id="IDE0290" Action="None" /> | ||
| </Rules> | ||
| </RuleSet> | ||
| </RuleSet> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,6 @@ | |
| using System.Runtime.CompilerServices; | ||
| using System.Runtime.InteropServices; | ||
| using System.Runtime.Intrinsics; | ||
| using System.Runtime.Intrinsics.Arm; | ||
| using System.Runtime.Intrinsics.X86; | ||
|
|
||
| namespace SixLabors.ImageSharp; | ||
|
|
@@ -61,6 +60,12 @@ public static int LeastCommonMultiple(int a, int b) | |
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public static nint Modulo4(nint x) => x & 3; | ||
|
|
||
| /// <summary> | ||
| /// Calculates <paramref name="x"/> % 4 | ||
| /// </summary> | ||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public static nuint Modulo4(nuint x) => x & 3; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just noting that
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks yeah, I just kept it the same for consistency. |
||
|
|
||
| /// <summary> | ||
| /// Calculates <paramref name="x"/> % 8 | ||
| /// </summary> | ||
|
|
||
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.
This should also be suppressible via
.editorconfigusingcsharp_style_prefer_primary_constructors = false:none(or a different severity level if you want to block use of primary constructors altogether, such assilent,suggestion,warning, orerror)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.
Thanks. Yeah, I’ll do that upstream. Not sold on primary constructors. The syntax doesn’t sit right with me.