[Libreoffice-commits] core.git: Branch 'private/moggi/chart-opengl-work' - 2 commits - chart2/source
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Sun Jan 12 13:55:51 PST 2014
chart2/source/view/inc/AbstractShapeFactory.hxx | 2 ++
chart2/source/view/inc/DummyXShape.hxx | 4 +++-
chart2/source/view/inc/OpenglShapeFactory.hxx | 1 +
chart2/source/view/inc/ShapeFactory.hxx | 2 ++
chart2/source/view/main/ChartView.cxx | 1 +
chart2/source/view/main/DummyXShape.cxx | 8 ++++++++
chart2/source/view/main/OpenGLRender.cxx | 2 +-
chart2/source/view/main/OpenglShapeFactory.cxx | 7 +++++++
8 files changed, 25 insertions(+), 2 deletions(-)
New commits:
commit 0ef43bfca80697a19ba88926f9299ec7cbedacf0
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Jan 12 22:53:19 2014 +0100
fix missing clearing of rendering area
Now there are no artifacts left from earlier renderings.
Change-Id: I48e6585d838cdf9547c150e1484a967fc9b69329
diff --git a/chart2/source/view/inc/AbstractShapeFactory.hxx b/chart2/source/view/inc/AbstractShapeFactory.hxx
index 7efc30e..76d996f 100644
--- a/chart2/source/view/inc/AbstractShapeFactory.hxx
+++ b/chart2/source/view/inc/AbstractShapeFactory.hxx
@@ -241,6 +241,8 @@ public:
*/
virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xRootShape) = 0;
+ virtual void clearPage(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xRootShape) = 0;
+
static ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
getChartRootShape( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XDrawPage>& xPage );
diff --git a/chart2/source/view/inc/DummyXShape.hxx b/chart2/source/view/inc/DummyXShape.hxx
index 91ec6d4..42eec30 100644
--- a/chart2/source/view/inc/DummyXShape.hxx
+++ b/chart2/source/view/inc/DummyXShape.hxx
@@ -426,7 +426,7 @@ public:
// normal methods
virtual void render();
-private:
+protected:
std::vector<com::sun::star::uno::Reference< com::sun::star::drawing::XShape > > maUNOShapes;
std::vector<DummyXShape*> maShapes;
};
@@ -443,6 +443,8 @@ public:
virtual void render() SAL_OVERRIDE;
+ void clear();
+
private:
GLWindow GLWin; /// Holds the information of our new child window
diff --git a/chart2/source/view/inc/OpenglShapeFactory.hxx b/chart2/source/view/inc/OpenglShapeFactory.hxx
index c7eb7a4..bb52da4 100644
--- a/chart2/source/view/inc/OpenglShapeFactory.hxx
+++ b/chart2/source/view/inc/OpenglShapeFactory.hxx
@@ -185,6 +185,7 @@ public:
virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xRootShape) SAL_OVERRIDE;
+ virtual void clearPage(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xRootShape) SAL_OVERRIDE;
};
}
diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx
index 259e923..99d8837 100644
--- a/chart2/source/view/inc/ShapeFactory.hxx
+++ b/chart2/source/view/inc/ShapeFactory.hxx
@@ -200,6 +200,8 @@ public:
*/
virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > ) SAL_OVERRIDE {}
+ virtual void clearPage(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > ) SAL_OVERRIDE {}
+
private:
ShapeFactory();
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index b0d6768..556d1f0 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -2412,6 +2412,7 @@ void ChartView::createShapes()
OSL_FAIL("could not set page size correctly");
}
pShapeFactory->setPageSize(mxRootShape, aPageSize);
+ pShapeFactory->clearPage(mxRootShape);
{
SolarMutexGuard aSolarGuard;
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index daa468a..596c0c4 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -1226,6 +1226,12 @@ void DummyChart::render()
m_GLRender.renderToBitmap();
}
+void DummyChart::clear()
+{
+ maUNOShapes.clear();
+ maShapes.clear();
+}
+
}
}
diff --git a/chart2/source/view/main/OpenglShapeFactory.cxx b/chart2/source/view/main/OpenglShapeFactory.cxx
index 8bb327e..dce9695 100644
--- a/chart2/source/view/main/OpenglShapeFactory.cxx
+++ b/chart2/source/view/main/OpenglShapeFactory.cxx
@@ -433,6 +433,13 @@ void OpenglShapeFactory::render(uno::Reference< drawing::XShapes > xRootShape)
pChart->render();
}
+void OpenglShapeFactory::clearPage(uno::Reference< drawing::XShapes > xRootShape)
+{
+ dummy::DummyChart* pChart = dynamic_cast<dummy::DummyChart*>(xRootShape.get());
+ assert(pChart);
+ pChart->clear();
+}
+
} //namespace dummy
} //namespace chart
commit 3d712fef9d67a879b0ebcd03e65750e90e0ed351
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Jan 12 22:50:47 2014 +0100
fix rectangle rendering
I had to disable it at the same time as it renders a white space over
the whole chart right now. Before the fix it was just the top left
quadrant.
Change-Id: I499767bcc302e6d6c82437535b4ea10ba212b82d
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index b4baa57..daa468a 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -568,6 +568,7 @@ DummyRectangle::DummyRectangle(const awt::Size& rSize, const awt::Point& rPoint,
void DummyRectangle::render()
{
+ /*
SAL_WARN("chart2.opengl", "render DummyRectangle");
debugProperties(maProperties);
DummyChart* pChart = getRootShape();
@@ -592,6 +593,7 @@ void DummyRectangle::render()
}
pChart->m_GLRender.RectangleShapePoint(maPosition.X, maPosition.Y, maSize.Width, maSize.Height);
pChart->m_GLRender.RenderRectangleShape();
+ */
}
DummyText::DummyText(const OUString& rText, const tNameSequence& rNames,
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 053a8bc..068722b 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -1400,7 +1400,7 @@ int OpenGLRender::RenderRectangleShape()
RectanglePointList &pointList = m_RectangleShapePointList.front();
PosVecf3 trans = {pointList.x, pointList.y, pointList.z};
PosVecf3 angle = {0.0f, 0.0f, 0.0f};
- PosVecf3 scale = {pointList.xScale / 2, pointList.yScale / 2, 1.0f};
+ PosVecf3 scale = {pointList.xScale, pointList.yScale, 1.0f};
MoveModelf(trans, angle, scale);
m_MVP = m_Projection * m_View * m_Model;
More information about the Libreoffice-commits
mailing list