summaryrefslogtreecommitdiff
path: root/include/drawinglayer
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-11-09 09:47:59 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-11-09 08:54:01 +0000
commit3a545893029c524afc0d5d6b6b6ca486c5be991c (patch)
treef286991b7341ca02a50054e059b1a43534c4484b /include/drawinglayer
parent81e3f5f2fdc9c573c83a37009080e4bb974c7955 (diff)
convert Primitive2DContainer to std::deque
since we only care about appending to this container, and then traversing it (normally once). So reduce the re-allocations that std::vector requires Change-Id: I206a7b82d9eefc1fa3762c4a03e7b5e21136951f Reviewed-on: https://gerrit.libreoffice.org/30706 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/drawinglayer')
-rw-r--r--include/drawinglayer/primitive2d/baseprimitive2d.hxx17
-rw-r--r--include/drawinglayer/primitive3d/baseprimitive3d.hxx15
2 files changed, 17 insertions, 15 deletions
diff --git a/include/drawinglayer/primitive2d/baseprimitive2d.hxx b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
index fbfafae783ca..66250bb59511 100644
--- a/include/drawinglayer/primitive2d/baseprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
@@ -27,6 +27,7 @@
#include <com/sun/star/util/XAccounting.hpp>
#include <cppuhelper/basemutex.hxx>
#include <basegfx/range/b2drange.hxx>
+#include <deque>
/** defines for DeclPrimitive2DIDBlock and ImplPrimitive2DIDBlock
@@ -58,21 +59,21 @@ namespace drawinglayer { namespace primitive2d {
typedef css::uno::Sequence< Primitive2DReference > Primitive2DSequence;
- class SAL_WARN_UNUSED DRAWINGLAYER_DLLPUBLIC Primitive2DContainer : public std::vector< Primitive2DReference >
+ class SAL_WARN_UNUSED DRAWINGLAYER_DLLPUBLIC Primitive2DContainer : public std::deque< Primitive2DReference >
{
public:
explicit Primitive2DContainer() {}
- explicit Primitive2DContainer( size_type count ) : vector(count) {}
- Primitive2DContainer( const Primitive2DContainer& other ) : vector(other) {}
- Primitive2DContainer( const Primitive2DContainer&& other ) : vector(other) {}
- Primitive2DContainer( const vector< Primitive2DReference >& other ) : vector(other) {}
- Primitive2DContainer( std::initializer_list<Primitive2DReference> init ) : vector(init) {}
+ explicit Primitive2DContainer( size_type count ) : deque(count) {}
+ Primitive2DContainer( const Primitive2DContainer& other ) : deque(other) {}
+ Primitive2DContainer( const Primitive2DContainer&& other ) : deque(other) {}
+ Primitive2DContainer( const std::deque< Primitive2DReference >& other ) : deque(other) {}
+ Primitive2DContainer( std::initializer_list<Primitive2DReference> init ) : deque(init) {}
void append(const Primitive2DContainer& rSource);
void append(const Primitive2DSequence& rSource);
void append(Primitive2DContainer&& rSource);
- Primitive2DContainer& operator=(const Primitive2DContainer& r) { vector::operator=(r); return *this; }
- Primitive2DContainer& operator=(const Primitive2DContainer&& r) { vector::operator=(r); return *this; }
+ Primitive2DContainer& operator=(const Primitive2DContainer& r) { deque::operator=(r); return *this; }
+ Primitive2DContainer& operator=(const Primitive2DContainer&& r) { deque::operator=(r); return *this; }
bool operator==(const Primitive2DContainer& rB) const;
bool operator!=(const Primitive2DContainer& rB) const { return !operator==(rB); }
basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& aViewInformation) const;
diff --git a/include/drawinglayer/primitive3d/baseprimitive3d.hxx b/include/drawinglayer/primitive3d/baseprimitive3d.hxx
index ef75d4e808e1..61a563485e75 100644
--- a/include/drawinglayer/primitive3d/baseprimitive3d.hxx
+++ b/include/drawinglayer/primitive3d/baseprimitive3d.hxx
@@ -26,6 +26,7 @@
#include <cppuhelper/basemutex.hxx>
#include <com/sun/star/graphic/XPrimitive3D.hpp>
#include <basegfx/range/b3drange.hxx>
+#include <deque>
/** defines for DeclPrimitive3DIDBlock and ImplPrimitive3DIDBlock
@@ -53,18 +54,18 @@ namespace drawinglayer { namespace primitive3d {
typedef css::uno::Reference< css::graphic::XPrimitive3D > Primitive3DReference;
typedef css::uno::Sequence< Primitive3DReference > Primitive3DSequence;
- class SAL_WARN_UNUSED DRAWINGLAYER_DLLPUBLIC Primitive3DContainer : public std::vector< Primitive3DReference >
+ class SAL_WARN_UNUSED DRAWINGLAYER_DLLPUBLIC Primitive3DContainer : public std::deque< Primitive3DReference >
{
public:
explicit Primitive3DContainer() {}
- explicit Primitive3DContainer( size_type count ) : vector(count) {}
- Primitive3DContainer( const Primitive3DContainer& other ) : vector(other) {}
- Primitive3DContainer( const Primitive3DContainer&& other ) : vector(other) {}
- Primitive3DContainer( std::initializer_list<Primitive3DReference> init ) : vector(init) {}
+ explicit Primitive3DContainer( size_type count ) : deque(count) {}
+ Primitive3DContainer( const Primitive3DContainer& other ) : deque(other) {}
+ Primitive3DContainer( const Primitive3DContainer&& other ) : deque(other) {}
+ Primitive3DContainer( std::initializer_list<Primitive3DReference> init ) : deque(init) {}
void append(const Primitive3DContainer& rSource);
- Primitive3DContainer& operator=(const Primitive3DContainer& r) { vector::operator=(r); return *this; }
- Primitive3DContainer& operator=(const Primitive3DContainer&& r) { vector::operator=(r); return *this; }
+ Primitive3DContainer& operator=(const Primitive3DContainer& r) { deque::operator=(r); return *this; }
+ Primitive3DContainer& operator=(const Primitive3DContainer&& r) { deque::operator=(r); return *this; }
bool operator==(const Primitive3DContainer& rB) const;
bool operator!=(const Primitive3DContainer& rB) const { return !operator==(rB); }
basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& aViewInformation) const;