Added selective support for thread safe ref/unref such that the rendering

backend now doesn't use thread safe ref counting where multi-buffering exists.
This reduces the overhead of multi-threading.
This commit is contained in:
Robert Osfield
2006-05-02 15:52:46 +00:00
parent 67f56dfd77
commit a8c52a90f0
8 changed files with 29 additions and 11 deletions

View File

@@ -34,6 +34,7 @@ class OSGUTIL_EXPORT RenderLeaf : public osg::Referenced
inline RenderLeaf(osg::Drawable* drawable,osg::RefMatrix* projection,osg::RefMatrix* modelview, float depth=0.0f):
osg::Referenced(false),
_parent(0),
_drawable(drawable),
_projection(projection),
@@ -76,6 +77,7 @@ class OSGUTIL_EXPORT RenderLeaf : public osg::Referenced
/// disallow creation of blank RenderLeaf as this isn't useful.
RenderLeaf():
osg::Referenced(false),
_parent(0),
_drawable(0),
_projection(0),
@@ -83,7 +85,7 @@ class OSGUTIL_EXPORT RenderLeaf : public osg::Referenced
_depth(0.0f) {}
/// disallow copy construction.
RenderLeaf(const RenderLeaf&):osg::Referenced() {}
RenderLeaf(const RenderLeaf&):osg::Referenced(false) {}
/// disallow copy operator.
RenderLeaf& operator = (const RenderLeaf&) { return *this; }

View File

@@ -60,6 +60,7 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
StateGraph():
osg::Referenced(false),
_parent(NULL),
_stateset(NULL),
_depth(0),
@@ -70,6 +71,7 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
}
StateGraph(StateGraph* parent,const osg::StateSet* stateset):
osg::Referenced(false),
_parent(parent),
_stateset(stateset),
_depth(0),