summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2017-12-13 22:08:20 +0900
committerTomaž Vajngerl <quikee@gmail.com>2017-12-18 12:38:04 +0100
commit55a7e836a2db662a53adc4f8b98d08b06790c758 (patch)
tree1453dceb8e253f700d895451d83b88b60948a1ff /svx
parente1697600253361a26d77a1ef61f8bde16af0ed2c (diff)
chart2: When creating objects prevent setting object rects dirty
3D objects using a E3dScene are traversing all object in the tree when setting rects dirty. When we are creating objects, setting properties and adding them to the tree we trigger setting rects dirty which slows down considerably - more are added objects, bigger the slowdown gets. So the solution here is to temporary disable setting object rects dirty during creation of objects. Change-Id: Id068cda9cb798d49b75bf4228cf6460f7e98c033 Reviewed-on: https://gerrit.libreoffice.org/46446 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/engine3d/scene3d.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index bec310a686a9..1da5c1411150 100644
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -174,7 +174,8 @@ E3dScene::E3dScene()
: E3dObject(),
aCamera(basegfx::B3DPoint(0.0, 0.0, 4.0), basegfx::B3DPoint()),
mp3DDepthRemapper(nullptr),
- bDrawOnlySelected(false)
+ bDrawOnlySelected(false),
+ mbSkipSettingDirty(false)
{
// Set defaults
SetDefaultAttributes();
@@ -345,7 +346,9 @@ void E3dScene::NewObjectInserted(const E3dObject* p3DObj)
void E3dScene::StructureChanged()
{
E3dObject::StructureChanged();
- SetRectsDirty();
+
+ if (!GetScene()->mbSkipSettingDirty)
+ SetRectsDirty();
ImpCleanup3DDepthMapper();
}
@@ -413,6 +416,16 @@ E3dScene* E3dScene::Clone() const
return CloneHelper< E3dScene >();
}
+void E3dScene::EnterObjectSetupMode()
+{
+ GetScene()->mbSkipSettingDirty = true;
+}
+
+void E3dScene::ExitObjectSetupMode()
+{
+ GetScene()->mbSkipSettingDirty = false;
+}
+
E3dScene& E3dScene::operator=(const E3dScene& rObj)
{
if( this == &rObj )