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 /vcl/workben/vcldemo.cxx | |
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 'vcl/workben/vcldemo.cxx')
-rw-r--r-- | vcl/workben/vcldemo.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 7cf941485973..c73991b57b92 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -1309,6 +1309,8 @@ public: int nSizeY = aSrc.GetSizePixel().Height(); for (int y = 0; y < nSizeY; y++) { + Scanline pScanlineMask = pMaskAcc->GetScanline( y ); + Scanline pScanlineRec = pRecAcc->GetScanline( y ); for (int x = 0; x < nSizeX; x++) { BitmapColor aColW = pAccW->GetPixel(y,x); @@ -1324,7 +1326,7 @@ public: nInverseAlpha = CLAMP(nInverseAlpha, 0, 255); long nAlpha = 255 - nInverseAlpha; - pMaskAcc->SetPixel(y,x,BitmapColor(static_cast<sal_Int8>(CLAMP(nInverseAlpha,0,255)))); + pMaskAcc->SetPixelOnData(pScanlineMask,x,BitmapColor(static_cast<sal_Int8>(CLAMP(nInverseAlpha,0,255)))); // now recover the pixels long nR = (aColW.GetRed() + aColB.GetRed() - nInverseAlpha) * 128; long nG = (aColW.GetGreen() + aColB.GetGreen() - nInverseAlpha) * 128; @@ -1337,7 +1339,7 @@ public: { nR /= nAlpha; nG /= nAlpha; nB /= nAlpha; } - pRecAcc->SetPixel(y,x,BitmapColor( + pRecAcc->SetPixelOnData(pScanlineRec,x,BitmapColor( static_cast<sal_uInt8>(CLAMP(nR,0,255)), static_cast<sal_uInt8>(CLAMP(nG,0,255)), static_cast<sal_uInt8>(CLAMP(nB,0,255)))); |