[Libreoffice-commits] core.git: Branch 'private/moggi/chart-opengl-window-version2' - 2 commits - chart2/source
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Wed May 7 06:52:06 PDT 2014
chart2/source/view/charttypes/GL3DBarChart.cxx | 11 +++++++----
chart2/source/view/inc/GL3DBarChart.hxx | 6 +++---
chart2/source/view/inc/GL3DRenderer.hxx | 4 ++--
chart2/source/view/main/ChartView.cxx | 2 +-
4 files changed, 13 insertions(+), 10 deletions(-)
New commits:
commit 0aa8bccb46a082754d26178d8c2613940194702b
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed May 7 15:47:17 2014 +0200
set the size to context and renderer before rendering
Change-Id: I2945a7b8647d0a40270b1e65cde2a0eb936ab1d1
diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 9c4264d..e21a34b 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -67,6 +67,9 @@ void GL3DBarChart::create3DShapes()
void GL3DBarChart::render()
{
mrWindow.getContext()->makeCurrent();
+ Size aSize = mrWindow.GetSizePixel();
+ mpRenderer->SetSize(aSize);
+ mrWindow.getContext()->setWinSize(aSize);
for(boost::ptr_vector<opengl3D::Renderable3DObject>::iterator itr = maShapes.begin(),
itrEnd = maShapes.end(); itr != itrEnd; ++itr)
{
diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index 0c5c078..0a9d674 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -249,9 +249,9 @@ private:
double m_dFreq;
#endif
- int m_iWidth;
+ sal_Int32 m_iWidth;
- int m_iHeight;
+ sal_Int32 m_iHeight;
float m_fZmax;
commit c0255a6e4d5c2aead2988a5c01e4cbb78c42fdbc
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed May 7 15:34:51 2014 +0200
let us pass the window to get the size correct
Change-Id: I8bd8a319e67cdcf7266d3c8f86d1bf132163d665
diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index f19ab64..9c4264d 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -20,10 +20,10 @@
namespace chart {
GL3DBarChart::GL3DBarChart(const std::vector<VDataSeries*>& rDataSeries,
- OpenGLContext& rContext):
+ OpenGLWindow& rWindow):
maDataSeries(rDataSeries),
mpRenderer(new opengl3D::OpenGL3DRenderer()),
- mrContext(rContext)
+ mrWindow(rWindow)
{
}
@@ -66,13 +66,13 @@ void GL3DBarChart::create3DShapes()
void GL3DBarChart::render()
{
- mrContext.makeCurrent();
+ mrWindow.getContext()->makeCurrent();
for(boost::ptr_vector<opengl3D::Renderable3DObject>::iterator itr = maShapes.begin(),
itrEnd = maShapes.end(); itr != itrEnd; ++itr)
{
itr->render();
}
- mrContext.swapBuffers();
+ mrWindow.getContext()->swapBuffers();
}
}
diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx
index 6efc86c..06b1be5 100644
--- a/chart2/source/view/inc/GL3DBarChart.hxx
+++ b/chart2/source/view/inc/GL3DBarChart.hxx
@@ -14,7 +14,7 @@
#include <boost/ptr_container/ptr_vector.hpp>
#include "VDataSeries.hxx"
-#include <vcl/opengl/OpenGLContext.hxx>
+#include <vcl/openglwin.hxx>
namespace chart {
@@ -32,7 +32,7 @@ class TemporaryContext;
class GL3DBarChart
{
public:
- GL3DBarChart(const std::vector<VDataSeries*>& rDataSeries, OpenGLContext& rContext);
+ GL3DBarChart(const std::vector<VDataSeries*>& rDataSeries, OpenGLWindow& rContext);
~GL3DBarChart();
void create3DShapes();
@@ -45,7 +45,7 @@ private:
boost::ptr_vector<opengl3D::Renderable3DObject> maShapes;
boost::scoped_ptr<opengl3D::OpenGL3DRenderer> mpRenderer;
- OpenGLContext& mrContext;
+ OpenGLWindow& mrWindow;
};
}
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 98c9b91..79eec7b 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -3149,7 +3149,7 @@ void ChartView::createShapes3D()
if(!pWindow)
return;
- GL3DBarChart aBarChart(aDataSeries, *pWindow->getContext());
+ GL3DBarChart aBarChart(aDataSeries, *pWindow);
aBarChart.create3DShapes();
aBarChart.render();
}
More information about the Libreoffice-commits
mailing list