summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drawinglayer/inc/processor3d/zbufferprocessor3d.hxx2
-rw-r--r--drawinglayer/source/processor3d/zbufferprocessor3d.cxx26
2 files changed, 9 insertions, 19 deletions
diff --git a/drawinglayer/inc/processor3d/zbufferprocessor3d.hxx b/drawinglayer/inc/processor3d/zbufferprocessor3d.hxx
index 642781e58177..4207a6fcd474 100644
--- a/drawinglayer/inc/processor3d/zbufferprocessor3d.hxx
+++ b/drawinglayer/inc/processor3d/zbufferprocessor3d.hxx
@@ -61,7 +61,7 @@ namespace drawinglayer::processor3d
/* remembered RasterPrimitive3D's which need to be painted back to front
for transparent 3D parts
*/
- std::unique_ptr<std::vector< RasterPrimitive3D >> mpRasterPrimitive3Ds;
+ mutable std::vector< RasterPrimitive3D > maRasterPrimitive3Ds;
sal_uInt32 mnStartLine;
sal_uInt32 mnStopLine;
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