[Libreoffice-commits] core.git: Branch 'feature/chart-opengl2' - 4 commits - chart2/source
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Fri Jan 10 03:16:34 PST 2014
chart2/source/view/main/DummyXShape.cxx | 2
chart2/source/view/main/OpenGLRender.cxx | 103 +++++++++++++++----------------
chart2/source/view/main/OpenGLRender.hxx | 17 ++---
3 files changed, 60 insertions(+), 62 deletions(-)
New commits:
commit 82a4bf0dd099dab8c93ac3d531bf6354e04237d6
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Fri Jan 10 11:47:45 2014 +0100
first round int to bool
Change-Id: I01126ea293c6880bbf53cbc912d54fe8a9842e31
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index cc1df8d..da55485 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -906,6 +906,7 @@ OpenGLRender::OpenGLRender(uno::Reference< drawing::XShape > xTarget):
m_iFboIdx(0),
m_fLineAlpha(1.0),
mxRenderTarget(xTarget),
+ m_iArbMultisampleSupported(false),
m_TextVertexID(0),
m_TextTexCoordID(1),
m_ClearColor(glm::vec4(1.0f, 1.0f, 1.0f, 1.0f))
@@ -925,7 +926,6 @@ OpenGLRender::OpenGLRender(uno::Reference< drawing::XShape > xTarget):
m_TextureObj[1] = 0;
m_RboID[0] = 0;
m_RboID[1] = 0;
- m_iArbMultisampleSupported = 0;
m_iArbMultisampleFormat = 0;
//TODO: moggi: use STL
@@ -1031,7 +1031,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
}
}
-int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd)
+bool OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd)
{
HWND hWnd = NULL;
//create a temp windwo to check whether support multi-sample, if support, get the format
@@ -1044,7 +1044,7 @@ int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd)
// See If The String Exists In WGL!
if (!WGLisExtensionSupported("WGL_ARB_multisample"))
{
- m_iArbMultisampleSupported = 0;
+ m_iArbMultisampleSupported = false;
SAL_WARN("chart2.opengl", "Device doesn't support multi sample\n");
return false;
}
@@ -1052,7 +1052,7 @@ int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd)
PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)wglGetProcAddress("wglChoosePixelFormatARB");
if (!wglChoosePixelFormatARB)
{
- m_iArbMultisampleSupported = 0;
+ m_iArbMultisampleSupported = false;
return false;
}
// Get Our Current Device Context
@@ -1086,7 +1086,7 @@ int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd)
// If We Returned True, And Our Format Count Is Greater Than 1
if (valid && numFormats >= 1)
{
- m_iArbMultisampleSupported = 1;
+ m_iArbMultisampleSupported = true;
m_iArbMultisampleFormat = pixelFormat;
wglMakeCurrent(NULL, NULL);
wglDeleteContext(glWin.hRC);
@@ -1099,7 +1099,7 @@ int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd)
valid = wglChoosePixelFormatARB(hDC,iAttributes,fAttributes,1,&pixelFormat,&numFormats);
if (valid && numFormats >= 1)
{
- m_iArbMultisampleSupported = 1;
+ m_iArbMultisampleSupported = true;
m_iArbMultisampleFormat = pixelFormat;
wglMakeCurrent(NULL, NULL);
wglDeleteContext(glWin.hRC);
@@ -1116,7 +1116,7 @@ int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd)
}
#endif
-int OpenGLRender::GetMSAASupport()
+bool OpenGLRender::GetMSAASupport()
{
return m_iArbMultisampleSupported;
}
@@ -1169,7 +1169,7 @@ int OpenGLRender::InitTempWindow(HWND *hwnd, int width, int height, PIXELFORMATD
return 0;
}
-int OpenGLRender::WGLisExtensionSupported(const char *extension)
+bool OpenGLRender::WGLisExtensionSupported(const char *extension)
{
const size_t extlen = strlen(extension);
const char *supported = NULL;
diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx
index c3ec8ac..72c29a4 100644
--- a/chart2/source/view/main/OpenGLRender.hxx
+++ b/chart2/source/view/main/OpenGLRender.hxx
@@ -159,9 +159,9 @@ public:
void SetLine2DWidth(int width);
BitmapEx GetAsBitmap();
#if defined( _WIN32 )
- int InitMultisample(PIXELFORMATDESCRIPTOR pfd);
+ bool InitMultisample(PIXELFORMATDESCRIPTOR pfd);
#endif
- int GetMSAASupport();
+ bool GetMSAASupport();
int GetMSAAFormat();
void SetColor(sal_uInt32 color);
int Bubble2DShapePoint(float x, float y, float directionX, float directionY);
@@ -192,8 +192,8 @@ private:
int RenderTexture2FBO(GLuint TexID);
#if defined( _WIN32 )
int InitTempWindow(HWND *hwnd, int width, int height, PIXELFORMATDESCRIPTOR inPfd);
+ bool WGLisExtensionSupported(const char *extension);
#endif
- int WGLisExtensionSupported(const char *extension);
int CreateMultiSampleFrameBufObj();
int Create2DCircle(int detail);
void SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2);
@@ -277,10 +277,10 @@ private:
std::list <Line2DPointList> m_Line2DShapePointList;
com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxRenderTarget;
- int m_iArbMultisampleSupported;
- int m_iArbMultisampleFormat;
- GLint m_iSampleBufs;
- GLint m_iSamples;
+ bool m_iArbMultisampleSupported;
+ int m_iArbMultisampleFormat;
+ GLint m_iSampleBufs;
+ GLint m_iSamples;
glm::vec4 m_2DColor;
GLuint m_frameBufferMS;
commit 18205fc7c405af112a5941ba9b7b73c4a207f00f
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Fri Jan 10 11:42:58 2014 +0100
use size_t for STL index
Change-Id: Id0582d5c6745a44f1a5142458654f7acb9fabe8d
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 1e91b4e..cc1df8d 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -270,7 +270,7 @@ static const GLfloat g_color_buffer_data[] = {
int static checkGLError(const char *file, int line)
{
GLenum glErr;
- int retCode = 0;
+ int retCode = 0;
glErr = glGetError();
while (glErr != GL_NO_ERROR)
{
@@ -564,8 +564,8 @@ int OpenGLRender::SetLine2DShapePoint(float x, float y, int listLength)
int OpenGLRender::RenderLine2FBO(int)
{
glLineWidth(m_fLineWidth);
- int listNum = m_Line2DShapePointList.size();
- for (int i = 0; i < listNum; i++)
+ size_t listNum = m_Line2DShapePointList.size();
+ for (size_t i = 0; i < listNum; i++)
{
Line2DPointList &pointList = m_Line2DShapePointList.front();
//fill vertex buffer
@@ -1285,8 +1285,8 @@ int OpenGLRender::Bubble2DShapePoint(float x, float y, float directionX, float d
int OpenGLRender::RenderBubble2FBO(int)
{
- int listNum = m_Bubble2DShapePointList.size();
- for (int i = 0; i < listNum; i++)
+ size_t listNum = m_Bubble2DShapePointList.size();
+ for (size_t i = 0; i < listNum; i++)
{
//move the circle to the pos, and scale using the xScale and Y scale
Bubble2DPointList &pointList = m_Bubble2DShapePointList.front();
@@ -1366,8 +1366,8 @@ int OpenGLRender::RectangleShapePoint(float x, float y, float directionX, float
int OpenGLRender::RenderRectangleShape()
{
- int listNum = m_RectangleShapePointList.size();
- for (int i = 0; i < listNum; i++)
+ size_t listNum = m_RectangleShapePointList.size();
+ for (size_t i = 0; i < listNum; i++)
{
//move the circle to the pos, and scale using the xScale and Y scale
RectanglePointList &pointList = m_RectangleShapePointList.front();
@@ -1525,8 +1525,8 @@ int OpenGLRender::CreateTextTexture(::rtl::OUString textValue, sal_uInt32 color,
int OpenGLRender::RenderTextShape()
{
m_fZStep += 0.01f;
- int listNum = m_TextInfoList.size();
- for (int i = 0; i < listNum; i++)
+ size_t listNum = m_TextInfoList.size();
+ for (size_t i = 0; i < listNum; i++)
{
TextInfo &textInfo = m_TextInfoList.front();
PosVecf3 trans = {textInfo.x, textInfo.y, textInfo.z};
@@ -1639,13 +1639,13 @@ int OpenGLRender::SetArea2DShapePoint(float x, float y, int listLength)
int OpenGLRender::RenderArea2DShape()
{
glDisable(GL_MULTISAMPLE);
- int listNum = m_Area2DShapePointList.size();
+ size_t listNum = m_Area2DShapePointList.size();
PosVecf3 trans = {0.0f, 0.0f, 0.0f};
PosVecf3 angle = {0.0f, 0.0f, 0.0f};
PosVecf3 scale = {1.0f, 1.0f, 1.0f};
MoveModelf(trans, angle, scale);
m_MVP = m_Projection * m_View * m_Model;
- for (int i = 0; i < listNum; i++)
+ for (size_t i = 0; i < listNum; i++)
{
Area2DPointList &pointList = m_Area2DShapePointList.front();
//fill vertex buffer
commit 88374698aa43e729d88c8eb3b7acc4a32b3e6bee
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Fri Jan 10 11:38:49 2014 +0100
remove unused function
Change-Id: I1f06e47d2dd56a9c9a23716cf91abd3d00167492
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 35de87b..1e91b4e 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -814,17 +814,6 @@ int OpenGLRender::CreateRenderObj(int width, int height)
return 0;
}
-int OpenGLRender::SetViewPoint(PosVeci3 camPos, PosVeci3 orgPos, int headUpFlag)
-{
- m_View = glm::lookAt(glm::vec3(camPos.x, camPos.y, camPos.z), // Camera is at (4,3,-3), in World Space
- glm::vec3(orgPos.x, orgPos.y ,orgPos.z), // and looks at the origin
- glm::vec3(0, (headUpFlag >= 0 ? 1 : -1) , 0) // Head is up (set to 0,-1,0 to look upside-down)
- );
- //m_Projection = glm::perspective(45.0f, (float)m_iWidth / (float)m_iHeight, 0.1f, 100.0f);
- m_Projection = glm::ortho((-(float)m_iWidth) / 2, ((float)m_iWidth) / 2, -((float)m_iHeight) / 2, ((float)m_iHeight) / 2, -2.0f, 100.0f); // In world coordinates
- return 0;
-}
-
int OpenGLRender::MoveModelf(PosVecf3 trans, PosVecf3 angle, PosVecf3 scale)
{
m_TranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z));
@@ -834,7 +823,6 @@ int OpenGLRender::MoveModelf(PosVecf3 trans, PosVecf3 angle, PosVecf3 scale)
return 0;
}
-
int OpenGLRender::CreateFrameBufferObj()
{
GLenum status;
diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx
index 0b79d99..c3ec8ac 100644
--- a/chart2/source/view/main/OpenGLRender.hxx
+++ b/chart2/source/view/main/OpenGLRender.hxx
@@ -145,7 +145,6 @@ public:
com::sun::star::drawing::XShape > xTarget );
~OpenGLRender();
int InitOpenGL(GLWindow);
- int SetViewPoint(PosVeci3 camPos, PosVeci3 orgPos, int headUpFlag);
int MoveModelf(PosVecf3 trans, PosVecf3 angle, PosVecf3 scale);
void SetWidth(int width);
void SetHeight(int height);
@@ -195,7 +194,7 @@ private:
int InitTempWindow(HWND *hwnd, int width, int height, PIXELFORMATDESCRIPTOR inPfd);
#endif
int WGLisExtensionSupported(const char *extension);
- int CreateMultiSampleFrameBufObj();
+ int CreateMultiSampleFrameBufObj();
int Create2DCircle(int detail);
void SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2);
commit b7fd357960d6f166010092880ba799859956f0f5
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Fri Jan 10 11:34:52 2014 +0100
next round of review + a number of TODO comments
Change-Id: I5639a8896156b369c9e82759f29d8eaaf474bb46
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 8d5910f..396cc7d 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -1006,7 +1006,6 @@ int oglErrorHandler( unx::Display* /*dpy*/, unx::XErrorEvent* /*evnt*/ )
#endif
-
bool DummyChart::initOpengl()
{
SAL_WARN("chart2.opengl", "DummyChart::initOpengl----start");
@@ -1169,7 +1168,6 @@ void DummyChart::setPosition( const awt::Point& aPosition )
DummyChart::~DummyChart()
{
- m_GLRender.Release();
}
void DummyChart::setSize( const awt::Size& aSize )
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index a097aec..35de87b 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -45,6 +45,7 @@ using namespace com::sun::star;
using namespace std;
#define RENDER_TO_FILE 0
+#define DEBUG_PNG 0
#define BMP_HEADER_LEN 54
#define OPENGL_SHADER( ... )# __VA_ARGS__
@@ -305,8 +306,6 @@ GLint OpenGLRender::LoadShaders(const char *vertexShader,const char *fragmentSha
GLint Result = GL_FALSE;
int InfoLogLength;
-
-
// Compile Vertex Shader
char const * VertexSourcePointer = vertexShader;
glShaderSource(VertexShaderID, 1, &VertexSourcePointer , NULL);
@@ -322,13 +321,13 @@ GLint OpenGLRender::LoadShaders(const char *vertexShader,const char *fragmentSha
std::vector<char> VertexShaderErrorMessage(InfoLogLength+1);
glGetShaderInfoLog(VertexShaderID, InfoLogLength, NULL, &VertexShaderErrorMessage[0]);
VertexShaderErrorMessage.push_back('\0');
- SAL_INFO("chart2.opengl", "vertex shader compile fail : " << &VertexShaderErrorMessage[0]);
+ SAL_WARN("chart2.opengl", "vertex shader compile failed : " << &VertexShaderErrorMessage[0]);
}
else
- SAL_INFO("chart2.opengl", "vertex shader compile failed without error log");
- }
-
+ SAL_WARN("chart2.opengl", "vertex shader compile failed without error log");
+ return 0;
+ }
// Compile Fragment Shader
char const * FragmentSourcePointer = fragmentShader;
@@ -345,10 +344,13 @@ GLint OpenGLRender::LoadShaders(const char *vertexShader,const char *fragmentSha
std::vector<char> FragmentShaderErrorMessage(InfoLogLength+1);
glGetShaderInfoLog(FragmentShaderID, InfoLogLength, NULL, &FragmentShaderErrorMessage[0]);
FragmentShaderErrorMessage.push_back('\0');
- SAL_INFO("chart2.opengl", "fragment shader compile fail : " << &FragmentShaderErrorMessage[0]);
+ SAL_WARN("chart2.opengl", "fragment shader compile failed : " << &FragmentShaderErrorMessage[0]);
}
else
- SAL_INFO("chart2.opengl", "fragment shader compile failed without error log");
+ SAL_WARN("chart2.opengl", "fragment shader compile failed without error log");
+
+
+ return 0;
}
// Link the program
@@ -367,10 +369,12 @@ GLint OpenGLRender::LoadShaders(const char *vertexShader,const char *fragmentSha
std::vector<char> ProgramErrorMessage(InfoLogLength+1);
glGetProgramInfoLog(ProgramID, InfoLogLength, NULL, &ProgramErrorMessage[0]);
ProgramErrorMessage.push_back('\0');
- SAL_INFO("chart2.opengl", "Shader Program fail : " << &ProgramErrorMessage[0]);
+ SAL_WARN("chart2.opengl", "Shader Program failed : " << &ProgramErrorMessage[0]);
}
else
- SAL_INFO("chart2.opengl", "shader program link failed without error log");
+ SAL_WARN("chart2.opengl", "shader program link failed without error log");
+
+ return 0;
}
glDeleteShader(VertexShaderID);
@@ -403,7 +407,6 @@ int OpenGLRender::InitOpenGL(GLWindow aWindow)
glEnable(GL_DEPTH_TEST);
// Accept fragment if it closer to the camera than the former one
glDepthFunc(GL_LESS);
- //[mod] by gaowei
glEnable(GL_POINT_SMOOTH);
glEnable(GL_LINE_SMOOTH);
glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
@@ -466,10 +469,10 @@ int OpenGLRender::InitOpenGL(GLWindow aWindow)
#if defined( WNT )
SwapBuffers(glWin.hDC);
- glFlush();
#elif defined( UNX )
unx::glXSwapBuffers(glWin.dpy, glWin.win);
#endif
+ glFlush();
glEnable(GL_LIGHTING);
GLfloat light_direction[] = { 0.0 , 0.0 , 1.0 };
GLfloat materialDiffuse[] = { 1.0 , 1.0 , 1.0 , 1.0};
@@ -511,7 +514,7 @@ BitmapEx OpenGLRender::GetAsBitmap()
BitmapEx aBmp(aBitmap, aAlpha);
-#if 0 // debug PNG writing
+#if DEBUG_PNG // debug PNG writing
static int nIdx = 0;
OUString aName = OUString( "file://c/temp/image" ) + OUString::number( nIdx++ ) + ".png";
try {
@@ -520,7 +523,7 @@ BitmapEx OpenGLRender::GetAsBitmap()
aWriter.Write( sOutput );
sOutput.Close();
} catch (...) {
- SAL_INFO("slideshow.opengl", "Error writing png to " << aName);
+ SAL_WARN("slideshow.opengl", "Error writing png to " << aName);
}
#endif
@@ -676,10 +679,10 @@ void OpenGLRender::renderToBitmap()
glBindFramebuffer(GL_FRAMEBUFFER, 0);
#if defined( WNT )
SwapBuffers(glWin.hDC);
- glFlush();
#elif defined( UNX )
unx::glXSwapBuffers(glWin.dpy, glWin.win);
#endif
+ glFlush();
RenderTexture(m_TextureObj[m_iFboIdx % 2]);
m_iFboIdx++;
@@ -757,10 +760,10 @@ int OpenGLRender::RenderTexture(GLuint TexID)
glUseProgram(0);
#if defined( WNT )
SwapBuffers(glWin.hDC);
- glFlush();
#elif defined( UNX )
unx::glXSwapBuffers(glWin.dpy, glWin.win);
#endif
+ glFlush();
return 0;
}
@@ -902,12 +905,12 @@ void OpenGLRender::Release()
#endif
}
-
OpenGLRender::OpenGLRender(uno::Reference< drawing::XShape > xTarget):
m_Model(glm::mat4(1.0f)),
m_TranslationMatrix(glm::translate(m_Model, glm::vec3(0.0f, 0.0f, 0.0f))),
m_RotationMatrix(glm::eulerAngleYXZ(0.0f, 0.0f, 0.0f)),
m_ScaleMatrix(glm::scale(m_Model, glm::vec3(1.0f, 1.0f, 1.0f))),
+ m_Line2DProID(0), // TODO: moggi: why is it unused?
m_Line2DColor(glm::vec4(1.0, 0.0, 0.0, 1.0)),
m_iWidth(0),
m_iHeight(0),
@@ -916,8 +919,10 @@ OpenGLRender::OpenGLRender(uno::Reference< drawing::XShape > xTarget):
m_fLineAlpha(1.0),
mxRenderTarget(xTarget),
m_TextVertexID(0),
- m_TextTexCoordID(1)
+ m_TextTexCoordID(1),
+ m_ClearColor(glm::vec4(1.0f, 1.0f, 1.0f, 1.0f))
{
+ //TODO: moggi: use STL
memset(&m_Line2DPointList, 0, sizeof(Line2DPointList));
memset(&m_Bubble2DPointList, 0, sizeof(m_Bubble2DPointList));
memset(&m_Bubble2DCircle, 0, sizeof(m_Bubble2DCircle));
@@ -934,8 +939,8 @@ OpenGLRender::OpenGLRender(uno::Reference< drawing::XShape > xTarget):
m_RboID[1] = 0;
m_iArbMultisampleSupported = 0;
m_iArbMultisampleFormat = 0;
- m_ClearColor = glm::vec4(1.0f, 1.0f, 1.0f, 1.0f);
+ //TODO: moggi: use STL
for (size_t i = 0; i < sizeof(m_BackgroundColor) / sizeof(float); i++)
{
m_BackgroundColor[i] = 1.0;
@@ -943,14 +948,17 @@ OpenGLRender::OpenGLRender(uno::Reference< drawing::XShape > xTarget):
mxRenderTarget->setPosition(awt::Point(0,0));
}
+
OpenGLRender::~OpenGLRender()
{
+ Release();
}
void OpenGLRender::SetWidth(int width)
{
m_iWidth = width;
}
+
void OpenGLRender::SetHeight(int height)
{
m_iHeight = height;
@@ -960,10 +968,12 @@ int OpenGLRender::GetWidth()
{
return m_iWidth;
}
+
int OpenGLRender::GetHeight()
{
return m_iHeight;
}
+
int OpenGLRender::CreateBMPHeader(sal_uInt8 *bmpHeader, int xsize, int ysize)
{
unsigned char header[BMP_HEADER_LEN] = {
@@ -1033,7 +1043,6 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
}
}
-
int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd)
{
HWND hWnd = NULL;
@@ -1130,6 +1139,7 @@ int OpenGLRender::GetMSAAFormat()
}
#if defined( _WIN32 )
+//TODO: moggi: why the hell do we need another implementation here?
int OpenGLRender::InitTempWindow(HWND *hwnd, int width, int height, PIXELFORMATDESCRIPTOR inPfd)
{
PIXELFORMATDESCRIPTOR pfd = inPfd;
@@ -1187,6 +1197,7 @@ int OpenGLRender::WGLisExtensionSupported(const char *extension)
// If That Failed Too, Must Be No Extensions Supported
if (supported == NULL)
return 0;
+
// Begin Examination At Start Of String, Increment By 1 On False Match
for (const char* p = supported; ; p++)
{
@@ -1437,6 +1448,7 @@ int OpenGLRender::CreateTextTexture(::rtl::OUString textValue, sal_uInt32 color,
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);
BitmapReadAccess* pRAcc = aBitmap.AcquireReadAccess();
sal_uInt8 red = (color & 0x00FF0000) >> 16;
@@ -1712,6 +1724,7 @@ void OpenGLRender::SetBackGroundColor(sal_uInt32 color1, sal_uInt32 color2)
SAL_INFO("chart2.opengl", "color1 = " << color1 << ", color2 = " << color2);
}
+
void OpenGLRender::SetChartTransparencyGradient(long transparencyGradient)
{
if (transparencyGradient == 1)
More information about the Libreoffice-commits
mailing list