diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2016-04-29 12:30:16 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2016-05-06 10:11:03 +0000 |
commit | 657413b5deea11a850970f23cba2cf34a5bdf8ea (patch) | |
tree | 01d1daef3fe03fe7ad271e8efecaf189b94fe261 /include | |
parent | d324b4b3e1d32b25a6347f2f77ae921a584ee9b0 (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 'include')
-rw-r--r-- | include/basegfx/matrix/b3dhommatrix.hxx | 2 | ||||
-rw-r--r-- | include/basegfx/polygon/b3dpolygon.hxx | 2 | ||||
-rw-r--r-- | include/basegfx/polygon/b3dpolypolygon.hxx | 2 | ||||
-rw-r--r-- | include/drawinglayer/processor3d/zbufferprocessor3d.hxx | 18 |
4 files changed, 13 insertions, 11 deletions
diff --git a/include/basegfx/matrix/b3dhommatrix.hxx b/include/basegfx/matrix/b3dhommatrix.hxx index b8e1c5b26c9c..ec8ee34f51d5 100644 --- a/include/basegfx/matrix/b3dhommatrix.hxx +++ b/include/basegfx/matrix/b3dhommatrix.hxx @@ -34,7 +34,7 @@ namespace basegfx class BASEGFX_DLLPUBLIC B3DHomMatrix { public: - typedef o3tl::cow_wrapper< Impl3DHomMatrix > ImplType; + typedef o3tl::cow_wrapper< Impl3DHomMatrix, o3tl::ThreadSafeRefCountingPolicy > ImplType; private: ImplType mpImpl; diff --git a/include/basegfx/polygon/b3dpolygon.hxx b/include/basegfx/polygon/b3dpolygon.hxx index 6c9c9b9c0808..d32968b47ac0 100644 --- a/include/basegfx/polygon/b3dpolygon.hxx +++ b/include/basegfx/polygon/b3dpolygon.hxx @@ -42,7 +42,7 @@ namespace basegfx class BASEGFX_DLLPUBLIC B3DPolygon { public: - typedef o3tl::cow_wrapper< ImplB3DPolygon > ImplType; + typedef o3tl::cow_wrapper< ImplB3DPolygon, o3tl::ThreadSafeRefCountingPolicy > ImplType; private: // internal data. diff --git a/include/basegfx/polygon/b3dpolypolygon.hxx b/include/basegfx/polygon/b3dpolypolygon.hxx index ea47e332f63b..9e3472dbb74c 100644 --- a/include/basegfx/polygon/b3dpolypolygon.hxx +++ b/include/basegfx/polygon/b3dpolypolygon.hxx @@ -38,7 +38,7 @@ namespace basegfx class BASEGFX_DLLPUBLIC B3DPolyPolygon { public: - typedef o3tl::cow_wrapper< ImplB3DPolyPolygon > ImplType; + typedef o3tl::cow_wrapper< ImplB3DPolyPolygon, o3tl::ThreadSafeRefCountingPolicy > ImplType; private: ImplType mpPolyPolygon; diff --git a/include/drawinglayer/processor3d/zbufferprocessor3d.hxx b/include/drawinglayer/processor3d/zbufferprocessor3d.hxx index 8e3f6d4f3ac1..0f58a7f1f0ab 100644 --- a/include/drawinglayer/processor3d/zbufferprocessor3d.hxx +++ b/include/drawinglayer/processor3d/zbufferprocessor3d.hxx @@ -56,7 +56,7 @@ namespace drawinglayer { private: /// the raster target, a Z-Buffer - basegfx::BZPixelRaster* mpBZPixelRaster; + basegfx::BZPixelRaster& mrBZPixelRaster; /// inverse of EyeToView for rasterconversion with evtl. Phong shading basegfx::B3DHomMatrix maInvEyeToView; @@ -74,6 +74,9 @@ namespace drawinglayer */ std::vector< RasterPrimitive3D >* mpRasterPrimitive3Ds; + sal_uInt32 mnStartLine; + sal_uInt32 mnStopLine; + // rasterconversions for filled and non-filled polygons virtual void rasterconvertB3DPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolygon& rHairline) const override; @@ -82,19 +85,18 @@ namespace drawinglayer public: ZBufferProcessor3D( const geometry::ViewInformation3D& rViewInformation3D, - const geometry::ViewInformation2D& rViewInformation2D, const attribute::SdrSceneAttribute& rSdrSceneAttribute, const attribute::SdrLightingAttribute& rSdrLightingAttribute, - double fSizeX, - double fSizeY, const basegfx::B2DRange& rVisiblePart, - sal_uInt16 nAntiAlialize); + sal_uInt16 nAntiAlialize, + double fFullViewSizeX, + double fFullViewSizeY, + basegfx::BZPixelRaster& rBZPixelRaster, + sal_uInt32 nStartLine, + sal_uInt32 nStopLine); virtual ~ZBufferProcessor3D(); void finish(); - - /// get the result as bitmapEx - BitmapEx getBitmapEx() const; }; } } |