streamline DatabasePager::requiresUpdateSceneGraph()

would trigger unnecessary redraws when there were pending file requests or active database threads

tested ok with and without IncrementalCompileOperation
This commit is contained in:
Philippe Renon
2016-07-03 17:31:07 +02:00
parent 935a5c4e22
commit e23a30652d
3 changed files with 8 additions and 7 deletions

View File

@@ -1371,10 +1371,7 @@ bool DatabasePager::getRequestsInProgress() const
{
if (getFileRequestListSize()>0) return true;
if (getDataToCompileListSize()>0)
{
return true;
}
if (getDataToCompileListSize()>0) return true;
if (getDataToMergeListSize()>0) return true;
@@ -1595,7 +1592,11 @@ void DatabasePager::setDatabasePagerThreadPause(bool pause)
bool DatabasePager::requiresUpdateSceneGraph() const
{
return !(_dataToMergeList->empty());
if (getDataToCompileListSize()>0) return true;
if (getDataToMergeListSize()>0) return true;
return false;
}
void DatabasePager::updateSceneGraph(const osg::FrameStamp& frameStamp)

View File

@@ -116,7 +116,7 @@ void Scene::setImagePager(osgDB::ImagePager* ip)
bool Scene::requiresUpdateSceneGraph() const
{
// check if the database pager needs to update the scene
if (getDatabasePager()->requiresUpdateSceneGraph() || getDatabasePager()->getRequestsInProgress()) return true;
if (getDatabasePager()->requiresUpdateSceneGraph()) return true;
// check if the image pager needs to update the scene
if (getImagePager()->requiresUpdateSceneGraph()) return true;

View File

@@ -1135,7 +1135,7 @@ bool View::requiresUpdateSceneGraph() const
// check if there are camera update callbacks
if (_camera->getUpdateCallback()) return true;
// check if there scene requires an update traversal
// check if the scene requires an update traversal
if (_scene.valid() && _scene->requiresUpdateSceneGraph()) return true;
return false;