diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-01-13 22:47:23 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-01-29 08:09:52 +0100 |
commit | f04ad9460d5aee148371e1290df39d911812351c (patch) | |
tree | ce93878d4dcb34bfbfdc9528c9093ff8c35569a6 /chart2/source | |
parent | 7bff5d998ba8905b1f5bc64d230df5af3401eca6 (diff) |
no need for the bitmap header, we ignore it anyway in the next stage
Change-Id: I007434264bd5649c55d195d30c5447704f930fe0
Diffstat (limited to 'chart2/source')
-rwxr-xr-x | chart2/source/view/main/OpenGLRender.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx index 41728713b0b8..0fef5c5909a1 100755 --- a/chart2/source/view/main/OpenGLRender.cxx +++ b/chart2/source/view/main/OpenGLRender.cxx @@ -1474,9 +1474,7 @@ int OpenGLRender::CreateTextTexture(::rtl::OUString textValue, sal_uInt32 color, BitmapEx aBitmapEx(aDevice.GetBitmap(aRect.TopLeft(), Size(bmpWidth, bmpHeight))); Bitmap aBitmap( aBitmapEx.GetBitmap()); int bitmapsize = aBitmap.GetSizeBytes(); - boost::scoped_array<sal_uInt8> bitmapBuf(new sal_uInt8[bitmapsize * 4 / 3 + BMP_HEADER_LEN]); - //TODO:moggi: why do we need the BMP header? - CreateBMPHeaderRGBA(bitmapBuf.get(), bmpWidth, bmpHeight); + boost::scoped_array<sal_uInt8> bitmapBuf(new sal_uInt8[bitmapsize * 4 / 3 ]); BitmapReadAccess* pRAcc = aBitmap.AcquireReadAccess(); sal_uInt8 red = (color & 0x00FF0000) >> 16; sal_uInt8 g = (color & 0x0000FF00) >> 8; @@ -1488,7 +1486,7 @@ int OpenGLRender::CreateTextTexture(::rtl::OUString textValue, sal_uInt32 color, for(long nx = 0; nx < bmpWidth; nx++) { sal_uInt8 *pm = pRAcc->GetScanline(ny) + nx * 3; - sal_uInt8 *mk = bitmapBuf.get() + BMP_HEADER_LEN + ny * bmpWidth * 4 + nx * 4; + sal_uInt8 *mk = bitmapBuf.get() + ny * bmpWidth * 4 + nx * 4; if ((*pm == 0xFF) && (*(pm + 1) == 0xFF) && (*(pm + 2) == 0xFF)) { *mk = *pm; @@ -1553,7 +1551,7 @@ int OpenGLRender::CreateTextTexture(::rtl::OUString textValue, sal_uInt32 color, CHECK_GL_ERROR(); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); CHECK_GL_ERROR(); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bmpWidth, bmpHeight, 0, GL_BGRA, GL_UNSIGNED_BYTE, bitmapBuf.get() + BMP_HEADER_LEN); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bmpWidth, bmpHeight, 0, GL_BGRA, GL_UNSIGNED_BYTE, bitmapBuf.get()); CHECK_GL_ERROR(); glBindTexture(GL_TEXTURE_2D, 0); CHECK_GL_ERROR(); |