diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-07 09:49:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-07 10:08:30 +0100 |
commit | e5012e53b919ae4921d6d35660bde323a6f28417 (patch) | |
tree | d0ed24f56e29f5d027e21404696fca441cdd0fc5 /canvas/source | |
parent | c99527385acf367c748b3dcf3e6a3bb8103f5eee (diff) |
use scanline when reading pixel data
extracts code from the innermost part of fairly hot loops
And add a GetIndexFromData method to make the call sites a little easier
to read.
Change-Id: I4ce5c5a687ecdb6982562a0aafce8513d86f9107
Reviewed-on: https://gerrit.libreoffice.org/49337
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'canvas/source')
-rw-r--r-- | canvas/source/vcl/canvasbitmaphelper.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/canvas/source/vcl/canvasbitmaphelper.cxx b/canvas/source/vcl/canvasbitmaphelper.cxx index bdb4444016fd..869957546498 100644 --- a/canvas/source/vcl/canvasbitmaphelper.cxx +++ b/canvas/source/vcl/canvasbitmaphelper.cxx @@ -156,6 +156,7 @@ namespace vclcanvas y<aBmpSize.Height() && y<rect.Y2; ++y ) { + Scanline pScanlineReadAlpha = pAlphaReadAccess->GetScanline( y ); if( pAlphaReadAccess.get() != nullptr ) { for( long x=rect.X1; @@ -165,7 +166,7 @@ namespace vclcanvas pRes[ nCurrPos++ ] = pReadAccess->GetColor( y, x ).GetRed(); pRes[ nCurrPos++ ] = pReadAccess->GetColor( y, x ).GetGreen(); pRes[ nCurrPos++ ] = pReadAccess->GetColor( y, x ).GetBlue(); - pRes[ nCurrPos++ ] = pAlphaReadAccess->GetPixel( y, x ).GetIndex(); + pRes[ nCurrPos++ ] = pAlphaReadAccess->GetIndexFromData( pScanlineReadAlpha, x ); } } else |