-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Description
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
| public static int ToWin32(Color c) | |
| { | |
| return c.R << COLORREF_RedShift | c.G << COLORREF_GreenShift | c.B << COLORREF_BlueShift; | |
| } |
Need to grab the full ARGB value and work with it instead to limit to a single lookup.
PaulusParssinen
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