-
Notifications
You must be signed in to change notification settings - Fork 5.5k
ColorTranslator.ToWin32 is inefficient #105992
Copy link
Copy link
Closed
Labels
area-System.DrawingenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is mergedtenet-performancePerformance related issuePerformance related issue
Milestone
Metadata
Metadata
Assignees
Labels
area-System.DrawingenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is mergedtenet-performancePerformance related issuePerformance related issue
Type
Fields
Give feedbackNo fields configured for issues without a type.
Known colors are looked up with every property access. With system colors on windows this will cause 3 PInvokes.
runtime/src/libraries/System.Drawing.Primitives/src/System/Drawing/ColorTranslator.cs
Lines 33 to 36 in 77fb038
Need to grab the full ARGB value and work with it instead to limit to a single lookup.