diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2018-01-30 20:40:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-06 07:39:11 +0100 |
commit | 3e0efdb50cd9bcf1749993607330ea1567eb33a2 (patch) | |
tree | c740dfc9b598480d5168282154045bbc938f6862 /cui | |
parent | f38e35338e3010f137d7b35fa3150792fabfa825 (diff) |
convert SetPixel->SetPixelOnData
by extracting out the Y scanline computation from the innermost
loop.
Inspired by commit 078d01c1b6cb9bbd80aeadc49a71cc817413164c.
Change-Id: Ic3c1827c01ed3aec629975749a551c7a68ae4a5e
Reviewed-on: https://gerrit.libreoffice.org/48926
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/colorpicker.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx index 6492ad558a3e..d6e0269b39b4 100644 --- a/cui/source/dialogs/colorpicker.cxx +++ b/cui/source/dialogs/colorpicker.cxx @@ -334,72 +334,78 @@ void ColorFieldControl::UpdateBitmap() case HUE: while (y--) { + Scanline pScanline = pWriteAccess->GetScanline( y ); nBri = pPercent_Vert[y]; x = nWidth; while (x--) { nSat = pPercent_Horiz[x]; - pWriteAccess->SetPixel(y, x, BitmapColor(Color(Color::HSBtoRGB(nHue, nSat, nBri)))); + pWriteAccess->SetPixelOnData(pScanline, x, BitmapColor(Color(Color::HSBtoRGB(nHue, nSat, nBri)))); } } break; case SATURATION: while (y--) { + Scanline pScanline = pWriteAccess->GetScanline( y ); nBri = pPercent_Vert[y]; x = nWidth; while (x--) { nHue = pGrad_Horiz[x]; - pWriteAccess->SetPixel(y, x, BitmapColor(Color(Color::HSBtoRGB(nHue, nSat, nBri)))); + pWriteAccess->SetPixelOnData(pScanline, x, BitmapColor(Color(Color::HSBtoRGB(nHue, nSat, nBri)))); } } break; case BRIGHTNESS: while (y--) { + Scanline pScanline = pWriteAccess->GetScanline( y ); nSat = pPercent_Vert[y]; x = nWidth; while (x--) { nHue = pGrad_Horiz[x]; - pWriteAccess->SetPixel(y, x, BitmapColor(Color(Color::HSBtoRGB(nHue, nSat, nBri)))); + pWriteAccess->SetPixelOnData(pScanline, x, BitmapColor(Color(Color::HSBtoRGB(nHue, nSat, nBri)))); } } break; case RED: while (y--) { + Scanline pScanline = pWriteAccess->GetScanline( y ); aBitmapColor.SetGreen(pRGB_Vert[y]); x = nWidth; while (x--) { aBitmapColor.SetBlue(pRGB_Horiz[x]); - pWriteAccess->SetPixel(y, x, aBitmapColor); + pWriteAccess->SetPixelOnData(pScanline, x, aBitmapColor); } } break; case GREEN: while (y--) { + Scanline pScanline = pWriteAccess->GetScanline( y ); aBitmapColor.SetRed(pRGB_Vert[y]); x = nWidth; while (x--) { aBitmapColor.SetBlue(pRGB_Horiz[x]); - pWriteAccess->SetPixel(y, x, aBitmapColor); + pWriteAccess->SetPixelOnData(pScanline, x, aBitmapColor); } } break; case BLUE: while (y--) { + Scanline pScanline = pWriteAccess->GetScanline( y ); aBitmapColor.SetGreen(pRGB_Vert[y]); x = nWidth; while (x--) { aBitmapColor.SetRed(pRGB_Horiz[x]); - pWriteAccess->SetPixel(y, x, aBitmapColor); + pWriteAccess->SetPixelOnData(pScanline, x, aBitmapColor); } } break; |