summaryrefslogtreecommitdiff
path: root/drawinglayer/source/primitive3d
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2016-04-29 12:30:16 +0200
committerArmin Le Grand <Armin.Le.Grand@cib.de>2016-05-06 10:11:03 +0000
commit657413b5deea11a850970f23cba2cf34a5bdf8ea (patch)
tree01d1daef3fe03fe7ad271e8efecaf189b94fe261 /drawinglayer/source/primitive3d
parentd324b4b3e1d32b25a6347f2f77ae921a584ee9b0 (diff)
Refactor 3D renderer to use multithreading
This try uses full 3D renderers working on the same ZBuffer target, but are capable to render one stripe per thread. This is rougher in granularity and uses multiple cores better than the first try (see gerrit 24393) which was too fine-granular being based on scanline render parallelization. SecUred some more classes based on SdrPrimitive3D for multi- theaded usage (places where local buffered stuff is done) Change-Id: I4ddd5885ad41dd6432d0695e528818a86e427bfd Reviewed-on: https://gerrit.libreoffice.org/24538 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'drawinglayer/source/primitive3d')
-rw-r--r--drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx4
-rw-r--r--drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx4
2 files changed, 8 insertions, 0 deletions
diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
index a5fe0ddb0348..be15838fd8b7 100644
--- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
@@ -375,6 +375,8 @@ namespace drawinglayer
// again when no longer geometry is needed for non-visible 3D objects as it is now for chart
if(getPolyPolygon().count() && !maSlices.size())
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
const_cast< SdrExtrudePrimitive3D& >(*this).impCreateSlices();
}
@@ -488,6 +490,8 @@ namespace drawinglayer
(!getBuffered3DDecomposition().empty()
&& *mpLastRLGViewInformation != rViewInformation))
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
// conditions of last local decomposition with reduced lines have changed. Remember
// new one and clear current decompositiopn
SdrExtrudePrimitive3D* pThat = const_cast< SdrExtrudePrimitive3D* >(this);
diff --git a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
index be66c16d7a8b..f831aba427bd 100644
--- a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
@@ -231,6 +231,8 @@ namespace drawinglayer
// again when no longer geometry is needed for non-visible 3D objects as it is now for chart
if(getPolyPolygon().count() && !maSlices.size())
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
const_cast< SdrLathePrimitive3D& >(*this).impCreateSlices();
}
@@ -350,6 +352,8 @@ namespace drawinglayer
(!getBuffered3DDecomposition().empty()
&& *mpLastRLGViewInformation != rViewInformation))
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
// conditions of last local decomposition with reduced lines have changed. Remember
// new one and clear current decompositiopn
SdrLathePrimitive3D* pThat = const_cast< SdrLathePrimitive3D* >(this);