diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-30 10:17:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-30 20:18:52 +0200 |
commit | 039c7999d4b92122cb4a356a1e65f62026c04173 (patch) | |
tree | 72f644adb476fd458c5668feb59fd18cd6d3fb92 /drawinglayer/source | |
parent | 3a90121c460f3832966773c3341708f77e5e0474 (diff) |
no need to allocate this separately
Change-Id: I78260d3e6ad8ce96db4353fede18d5e3a6808402
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116400
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer/source')
-rw-r--r-- | drawinglayer/source/processor3d/zbufferprocessor3d.cxx | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx index 73587089b192..56cfc3c45c18 100644 --- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx +++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx @@ -422,12 +422,8 @@ namespace drawinglayer::processor3d { // transparent output; record for later sorting and painting from // back to front - if(!mpRasterPrimitive3Ds) - { - const_cast< ZBufferProcessor3D* >(this)->mpRasterPrimitive3Ds.reset( new std::vector< RasterPrimitive3D > ); - } - mpRasterPrimitive3Ds->push_back(RasterPrimitive3D( + maRasterPrimitive3Ds.push_back(RasterPrimitive3D( getGeoTexSvx(), getTransparenceGeoTexSvx(), rMaterial, @@ -486,12 +482,7 @@ namespace drawinglayer::processor3d { // transparent output; record for later sorting and painting from // back to front - if(!mpRasterPrimitive3Ds) - { - const_cast< ZBufferProcessor3D* >(this)->mpRasterPrimitive3Ds.reset( new std::vector< RasterPrimitive3D > ); - } - - mpRasterPrimitive3Ds->push_back(RasterPrimitive3D( + maRasterPrimitive3Ds.push_back(RasterPrimitive3D( getGeoTexSvx(), getTransparenceGeoTexSvx(), rMaterial, @@ -596,32 +587,31 @@ namespace drawinglayer::processor3d { mpZBufferRasterConverter3D.reset(); - if(mpRasterPrimitive3Ds) + if(!maRasterPrimitive3Ds.empty()) { OSL_FAIL("ZBufferProcessor3D: destructed, but there are unrendered transparent geometries. Use ZBufferProcessor3D::finish() to render these (!)"); } - mpRasterPrimitive3Ds.reset(); } void ZBufferProcessor3D::finish() { - if(!mpRasterPrimitive3Ds) + if(maRasterPrimitive3Ds.empty()) return; // there are transparent rasterprimitives - const sal_uInt32 nSize(mpRasterPrimitive3Ds->size()); + const sal_uInt32 nSize(maRasterPrimitive3Ds.size()); if(nSize > 1) { // sort them from back to front - std::sort(mpRasterPrimitive3Ds->begin(), mpRasterPrimitive3Ds->end()); + std::sort(maRasterPrimitive3Ds.begin(), maRasterPrimitive3Ds.end()); } for(sal_uInt32 a(0); a < nSize; a++) { // paint each one by setting the remembered data and calling // the render method - const RasterPrimitive3D& rCandidate = (*mpRasterPrimitive3Ds)[a]; + const RasterPrimitive3D& rCandidate = maRasterPrimitive3Ds[a]; mpGeoTexSvx = rCandidate.getGeoTexSvx(); mpTransparenceGeoTexSvx = rCandidate.getTransparenceGeoTexSvx(); @@ -645,7 +635,7 @@ namespace drawinglayer::processor3d // delete them to signal the destructor that all is done and // to allow asserting there - mpRasterPrimitive3Ds.reset(); + maRasterPrimitive3Ds.clear(); } } // end of namespace |