diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-04-18 15:24:25 +0200 |
---|---|---|
committer | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-04-18 18:53:22 +0200 |
commit | 8afabd394214bb7c772c88b08ec3cadb56771cce (patch) | |
tree | 9b29eed5f78bec3986372040654bc66d04072f47 /chart2 | |
parent | 9cf12d7544d501e6794cfbb6eabf508603d59966 (diff) |
Extract code of BitmapEx -> RGBA buffer conversion to OpenGLHelper
Needed by gltf rendering.
Change-Id: I1aa974f3c515c5fb19a07b54ff655331138553cb
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/main/OpenGLRender.cxx | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx index 8ab05b7d136f..79e408cf26dc 100644 --- a/chart2/source/view/main/OpenGLRender.cxx +++ b/chart2/source/view/main/OpenGLRender.cxx @@ -900,26 +900,7 @@ int OpenGLRender::CreateTextTexture(const BitmapEx& rBitmapEx, const awt::Point& long bmpWidth = rBitmapEx.GetSizePixel().Width(); long bmpHeight = rBitmapEx.GetSizePixel().Height(); - - Bitmap aBitmap (rBitmapEx.GetBitmap()); - AlphaMask aAlpha (rBitmapEx.GetAlpha()); - boost::scoped_array<sal_uInt8> bitmapBuf(new sal_uInt8[4* bmpWidth * bmpHeight ]); - Bitmap::ScopedReadAccess pReadAccces( aBitmap ); - AlphaMask::ScopedReadAccess pAlphaReadAccess( aAlpha ); - - size_t i = 0; - for (long ny = 0; ny < bmpHeight; ny++) - { - Scanline pAScan = pAlphaReadAccess->GetScanline(ny); - for(long nx = 0; nx < bmpWidth; nx++) - { - BitmapColor aCol = pReadAccces->GetColor( ny, nx ); - bitmapBuf[i++] = aCol.GetRed(); - bitmapBuf[i++] = aCol.GetGreen(); - bitmapBuf[i++] = aCol.GetBlue(); - bitmapBuf[i++] = 255 - *pAScan++; - } - } + boost::scoped_array<sal_uInt8> bitmapBuf(OpenGLHelper::ConvertBitmapExToRGBABuffer(rBitmapEx)); TextInfo aTextInfo; aTextInfo.rotation = -(double)rotation / 360.0 * 2* GL_PI; |