Performance fixes.

This commit is contained in:
Jeff Young 2021-08-31 21:19:54 +01:00
parent a5e11111a4
commit 098fdf2981
1 changed files with 12 additions and 2 deletions

View File

@ -253,10 +253,15 @@ void DIALOG_COLOR_PICKER::createRGBBitmap()
// clear background (set the window bg color)
wxColor bg = GetBackgroundColour();
// Don't do standard-color lookups on OSX each time through the loop
wxColourBase::ChannelType bgR = bg.Red();
wxColourBase::ChannelType bgG = bg.Green();
wxColourBase::ChannelType bgB = bg.Blue();
for( int xx = 0; xx < bmsize.x; xx++ ) // blue axis
{
for( int yy = 0; yy < bmsize.y; yy++ ) // Red axis
img.SetRGB( xx, yy, bg.Red(), bg.Green(), bg.Blue() );
img.SetRGB( xx, yy, bgR, bgG, bgB );
}
// Build the palette
@ -328,10 +333,15 @@ void DIALOG_COLOR_PICKER::createHSVBitmap()
// clear background (set the window bg color)
wxColor bg = GetBackgroundColour();
// Don't do standard-color lookups on OSX each time through the loop
wxColourBase::ChannelType bgR = bg.Red();
wxColourBase::ChannelType bgG = bg.Green();
wxColourBase::ChannelType bgB = bg.Blue();
for( int xx = 0; xx < bmsize.x; xx++ ) // blue axis
{
for( int yy = 0; yy < bmsize.y; yy++ ) // Red axis
img.SetRGB( xx, yy, bg.Red(), bg.Green(), bg.Blue() );
img.SetRGB( xx, yy, bgR, bgG, bgB );
}
// Reserve room to draw cursors inside the bitmap