summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Jaumann <meta_dev@yahoo.com>2015-03-09 11:13:45 +0000
committerMichael Jaumann <meta_dev@yahoo.com>2015-03-09 11:13:45 +0000
commit56e5ebf66ae2ec84824f1e2c62e5540e19420619 (patch)
tree4389bd2e278023fff13bfd8e761475548178bc83
parentadded updateSprites in shapemangerimpl (diff)
downloadcore-feature/slideshow_onlySprites.tar.gz
core-feature/slideshow_onlySprites.zip
Change-Id: I87209817af833dcb49efc9078b368447efb624a9
-rw-r--r--slideshow/source/engine/slide/shapemanagerimpl.cxx43
-rw-r--r--slideshow/source/engine/slide/shapemanagerimpl.hxx5
2 files changed, 5 insertions, 43 deletions
diff --git a/slideshow/source/engine/slide/shapemanagerimpl.cxx b/slideshow/source/engine/slide/shapemanagerimpl.cxx
index 0db4f80ee251..db962651c90a 100644
--- a/slideshow/source/engine/slide/shapemanagerimpl.cxx
+++ b/slideshow/source/engine/slide/shapemanagerimpl.cxx
@@ -56,24 +56,14 @@ ShapeManagerImpl::ShapeManagerImpl( const UnoViewContainer& rViews,
{
}
-template<typename LayerFunc,
- typename ShapeFunc> void ShapeManagerImpl::manageViews(
- LayerFunc layerFunc,
+template<typename ShapeFunc> void ShapeManagerImpl::manageViews(
ShapeFunc shapeFunc )
{
- LayerSharedPtr pCurrLayer;
ViewLayerSharedPtr pCurrViewLayer;
LayerShapeMap::const_iterator aIter( maAllShapes.begin() );
const LayerShapeMap::const_iterator aEnd ( maAllShapes.end() );
while( aIter != aEnd )
{
- LayerSharedPtr pLayer = aIter->second.lock();
- if( pLayer && pLayer != pCurrLayer )
- {
- pCurrLayer = pLayer;
- pCurrViewLayer = layerFunc(pCurrLayer);
- }
-
if( pCurrViewLayer )
shapeFunc(aIter->first,pCurrViewLayer);
@@ -283,12 +273,7 @@ void ShapeManagerImpl::viewAdded( const UnoViewSharedPtr& rView )
rView->clearAll();
// add View to all registered shapes
- manageViews(
- boost::bind(&Layer::addView,
- _1,
- boost::cref(rView)),
- // repaint on view add
- boost::bind(&Shape::addViewLayer,
+ manageViews(boost::bind(&Shape::addViewLayer,
_1,
_2,
true) );
@@ -302,11 +287,7 @@ void ShapeManagerImpl::viewRemoved( const UnoViewSharedPtr& rView )
rView) == mrViews.end() );
// remove View from all registered shapes
- manageViews(
- boost::bind(&Layer::removeView,
- _1,
- boost::cref(rView)),
- boost::bind(&Shape::removeViewLayer,
+ manageViews(boost::bind(&Shape::removeViewLayer,
_1,
_2) );
}
@@ -332,8 +313,6 @@ void ShapeManagerImpl::viewsChanged()
mrViews.end(),
::boost::mem_fn(&View::clearAll) );
- // TODO(F3): resize and repaint all layers
-
// render all shapes
std::for_each( maAllShapes.begin(),
maAllShapes.end(),
@@ -545,27 +524,11 @@ void ShapeManagerImpl::implRemoveShape( const ShapeSharedPtr& rShape )
if( aShapeEntry == maAllShapes.end() )
return;
-
- const bool bShapeUpdateNotified = maUpdateShapes.erase( rShape ) != 0;
-
// Enter shape area to the update area, but only if shape
// is visible and not in sprite mode (otherwise, updating
// the area doesn't do actual harm, but costs time)
// Actually, also add it if it was listed in
// maUpdateShapes (might have just gone invisible).
- if( bShapeUpdateNotified ||
- (rShape->isVisible() &&
- !rShape->isBackgroundDetached()) )
- {
- LayerSharedPtr pLayer = aShapeEntry->second.lock();
- if( pLayer )
- {
- // store area early, once the shape is removed from
- // the layers, it no longer has any view references
- pLayer->addUpdateRange( rShape->getUpdateArea() );
- }
- }
-
rShape->clearAllViewLayers();
maAllShapes.erase( aShapeEntry );
}
diff --git a/slideshow/source/engine/slide/shapemanagerimpl.hxx b/slideshow/source/engine/slide/shapemanagerimpl.hxx
index c1b99168b2a7..797bdc618220 100644
--- a/slideshow/source/engine/slide/shapemanagerimpl.hxx
+++ b/slideshow/source/engine/slide/shapemanagerimpl.hxx
@@ -145,9 +145,7 @@ private:
method. The only point of variation at those places
are removal vs. adding.
*/
- template<typename LayerFunc,
- typename ShapeFunc> void manageViews( LayerFunc layerFunc,
- ShapeFunc shapeFunc );
+ template<typename ShapeFunc> void manageViews(ShapeFunc shapeFunc );
// ShapeManager interface
@@ -200,6 +198,7 @@ private:
bool updateSprites();
+
/** Common stuff when adding a shape
*/
void implAddShape( const ShapeSharedPtr& rShape );