[Libreoffice-commits] core.git: chart2/source
Michael Meeks
michael.meeks at collabora.com
Wed May 28 10:54:19 PDT 2014
chart2/source/view/inc/GL3DRenderer.hxx | 1
chart2/source/view/main/3DChartObjects.cxx | 6 +++-
chart2/source/view/main/GL3DRenderer.cxx | 41 ++++++++++++++++++++++++-----
3 files changed, 40 insertions(+), 8 deletions(-)
New commits:
commit 2e2d7d8b6ff25524ce92430bfd7a5365569c853c
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Tue May 27 21:58:31 2014 +0100
Add a grey gradient background to the 3D chartm and tweak text color.
Conflicts:
chart2/source/view/main/GL3DRenderer.cxx
Change-Id: I8b74a1e7f32c30b6a908c0870bbeacc00cdea444
diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index 20fbca9..a0036ed 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -190,6 +190,7 @@ public:
private:
void MoveModelf(PosVecf3& trans,PosVecf3& angle,PosVecf3& scale);
+ void ClearBuffer();
void RenderPolygon3DObject();
void RenderLine3D(Polygon3DInfo &polygon);
void RenderPolygon3D(Polygon3DInfo &polygon);
diff --git a/chart2/source/view/main/3DChartObjects.cxx b/chart2/source/view/main/3DChartObjects.cxx
index 2573191..1cf0b49 100644
--- a/chart2/source/view/main/3DChartObjects.cxx
+++ b/chart2/source/view/main/3DChartObjects.cxx
@@ -77,7 +77,11 @@ const TextCacheItem& TextCache::getText(OUString const & rText)
VirtualDevice aDevice(*Application::GetDefaultDevice(), 0, 0);
Font aFont = aDevice.GetFont();
aFont.SetSize(Size(0, 96));
- aFont.SetColor(COL_BLACK);
+ static bool bOldRender = getenv("OLDRENDER");
+ if (bOldRender)
+ aFont.SetColor(COL_BLACK);
+ else
+ aFont.SetColor(COL_GREEN); // RGB_COLORDATA(0xf0, 0xf0, 0xf0));
aDevice.SetFont(aFont);
aDevice.Erase();
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index aded984..af5238b 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -253,10 +253,7 @@ void OpenGL3DRenderer::init()
glEnable(GL_MULTISAMPLE);
- glClearColor (1.0, 1.0, 1.0, 1.0);
- glClear(GL_COLOR_BUFFER_BIT);
- glClearDepth(1.0f);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ ClearBuffer();
glGenBuffers(1, &m_CubeVertexBuf);
glGenBuffers(1, &m_CubeNormalBuf);
@@ -1693,12 +1690,42 @@ void OpenGL3DRenderer::CreateSceneBoxView()
m_CameraInfo.cameraUp);
}
+void OpenGL3DRenderer::ClearBuffer()
+{
+ static bool bOldRender = getenv("OLDRENDER");
+ if (!bOldRender) // gradient background
+ {
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_LIGHTING);
+
+ glClearDepth(1.0f);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glBegin (GL_QUADS);
+ glColor3f(0.3,0.3,0.3);
+ glVertex3f (-1.0f, -1.0f, -1.0f);
+ glVertex3f (1.0f, -1.0f, -1.0f);
+
+ glColor3f(0.0,0.0,0.0);
+ glVertex3f (1.0f, 1.0f, -1.0f);
+ glVertex3f (-1.0f, 1.0f, -1.0f);
+ glEnd ();
+
+ glEnable(GL_LIGHTING);
+ glEnable(GL_DEPTH_TEST);
+ }
+ else
+ {
+ glClearDepth(1.0f);
+ glClearColor (1.0, 0.5, 0.5, 1.0);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ }
+}
+
void OpenGL3DRenderer::ProcessUnrenderedShape(bool bNewScene)
{
glViewport(0, 0, m_iWidth, m_iHeight);
- glClearDepth(1.0f);
- glClearColor(1.0, 1.0, 1.0, 1.0);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ ClearBuffer();
CreateSceneBoxView();
//Polygon
RenderPolygon3DObject();
More information about the Libreoffice-commits
mailing list