Introducing new Method removeNativeContent.
authorMichael Schuldt <michael.schuldt@bmw-carit.de>
Mon, 5 Dec 2011 12:02:53 +0000 (13:02 +0100)
committerMichael Schuldt <michael.schuldt@bmw-carit.de>
Mon, 5 Dec 2011 12:07:52 +0000 (13:07 +0100)
Now it is possible to remove the native content of an existing
surface. This gurantee that the logical scene structure is the same
if an application is closed or killed.

LayerManagerService/include/Scene.h
LayerManagerService/include/Surface.h
LayerManagerService/src/Scene.cpp

index f70bdc1..5d138d2 100644 (file)
@@ -60,6 +60,7 @@ public:
 
     virtual void removeLayer(Layer* layer);
     virtual void removeSurface(Surface* surface);
+    virtual void removeSurfaceNativeContent(Surface* surface);
     virtual Layer* getLayer(const uint id) const;
     virtual Surface* getSurface(const uint id) const;
     virtual SurfaceGroup* getSurfaceGroup(const uint id) const;
index 030fddb..b2c635c 100644 (file)
@@ -56,6 +56,11 @@ public:
     {
         return m_hasNativeContent;
     }
+    
+    void removeNativeContent() 
+    {
+        m_hasNativeContent = false;
+    }
 
     void setNativeContent(long nativeHandle)
     {
index 25c6bfc..76dc0ba 100644 (file)
@@ -82,6 +82,7 @@ Surface* Scene::createSurface(const uint surfaceId)
         }
         else
         {
+            newSurface = m_surfaceMap.at(surfaceId); 
             LOG_DEBUG("Scene","Surface with id [ " << surfaceId << " ] " << " already exists " );
         }
     }
@@ -256,6 +257,14 @@ void Scene::removeSurface(Surface* surface)
         delete surface;
     }
 }
+/// \brief take removing applied native content
+void Scene::removeSurfaceNativeContent(Surface* surface)
+{
+    if (surface != NULL)
+    {
+        surface->removeNativeContent();
+    }
+}
 
 void Scene::removeLayerGroup(LayerGroup* layerGroup)
 {