[dali_1.4.26] Merge branch 'devel/master' 94/208794/1
authorgreynaga <g.reynaga@samsung.com>
Fri, 28 Jun 2019 10:43:13 +0000 (11:43 +0100)
committergreynaga <g.reynaga@samsung.com>
Fri, 28 Jun 2019 10:43:13 +0000 (11:43 +0100)
Change-Id: I2d35bb957985ca22dd74dd3c45dee2164543bece

26 files changed:
automated-tests/src/dali/utc-Dali-Actor.cpp
automated-tests/src/dali/utc-Dali-Scene.cpp
dali/integration-api/core.h
dali/integration-api/gesture-manager.h [deleted file]
dali/integration-api/render-surface.h
dali/integration-api/scene.cpp
dali/integration-api/scene.h
dali/internal/common/core-impl.cpp
dali/internal/common/core-impl.h
dali/internal/event/common/scene-impl.cpp
dali/internal/event/common/scene-impl.h
dali/internal/event/events/gesture-event-processor.h
dali/internal/event/events/pan-gesture-processor.h
dali/internal/event/events/pinch-gesture-processor.h
dali/internal/event/events/tap-gesture-processor.h
dali/internal/event/rendering/frame-buffer-impl.cpp
dali/internal/event/rendering/frame-buffer-impl.h
dali/internal/render/common/render-manager.cpp
dali/internal/render/renderers/render-surface-frame-buffer.cpp
dali/internal/render/renderers/render-surface-frame-buffer.h
dali/internal/update/manager/update-manager.cpp
dali/public-api/dali-core-version.cpp
dali/public-api/object/property-array.h
dali/public-api/object/property-map.h
dali/public-api/object/property-value.h
packaging/dali.spec

index fad466a..d578048 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -7172,3 +7172,57 @@ int utcDaliActorCulled(void)
 
   END_TEST;
 }
+
+int utcDaliEnsureRenderWhenRemovingLastRenderableActor(void)
+{
+  TestApplication application;
+  auto stage = Stage::GetCurrent();
+
+  tet_infoline( "Ensure we clear the screen when the last actor is removed" );
+
+  Actor actor = CreateRenderableActor();
+  actor.SetSize( 100.0f, 100.0f );
+  stage.Add( actor );
+
+  application.SendNotification();
+  application.Render();
+
+  auto& glAbstraction = application.GetGlAbstraction();
+  const auto clearCountBefore = glAbstraction.GetClearCountCalled();
+
+  actor.Unparent();
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 1, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int utcDaliEnsureRenderWhenMakingLastActorInvisible(void)
+{
+  TestApplication application;
+  auto stage = Stage::GetCurrent();
+
+  tet_infoline( "Ensure we clear the screen when the last actor is removed" );
+
+  Actor actor = CreateRenderableActor();
+  actor.SetSize( 100.0f, 100.0f );
+  stage.Add( actor );
+
+  application.SendNotification();
+  application.Render();
+
+  auto& glAbstraction = application.GetGlAbstraction();
+  const auto clearCountBefore = glAbstraction.GetClearCountCalled();
+
+  actor.SetVisible( false );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 1, TEST_LOCATION );
+
+  END_TEST;
+}
index 21076e2..2b78fea 100644 (file)
@@ -91,12 +91,16 @@ struct KeyEventReceivedFunctor
 struct TouchedSignalData
 {
   TouchedSignalData()
-  : functorCalled(false)
+  : functorCalled(false),
+    createNewScene(false),
+    newSceneCreated(false)
   {}
 
   void Reset()
   {
     functorCalled = false;
+    createNewScene = false;
+    newSceneCreated = false;
 
     receivedTouchEvent.points.clear();
     receivedTouchEvent.time = 0;
@@ -105,6 +109,8 @@ struct TouchedSignalData
   }
 
   bool functorCalled;
+  bool createNewScene;
+  bool newSceneCreated;
   TouchEvent receivedTouchEvent;
   TouchData receivedTouchData;
 };
@@ -132,6 +138,14 @@ struct TouchFunctor
   {
     signalData.functorCalled = true;
     signalData.receivedTouchData = touch;
+
+    if ( signalData.createNewScene )
+    {
+      Dali::Integration::Scene scene = Dali::Integration::Scene::New( Vector2( 480.0f, 800.0f ) );
+      DALI_TEST_CHECK( scene );
+
+      signalData.newSceneCreated = true;
+    }
   }
 
   void operator()()
@@ -387,6 +401,31 @@ int UtcDaliSceneDiscard(void)
   END_TEST;
 }
 
+int UtcDaliSceneCreateNewSceneDuringCoreEventProcessing(void)
+{
+  TestApplication application;
+
+  Dali::Integration::Scene scene = application.GetScene();
+
+  TouchedSignalData data;
+  data.createNewScene = true;
+  TouchFunctor functor( data );
+  scene.TouchSignal().Connect( &application, functor );
+
+  // Render and notify.
+  application.SendNotification();
+  application.Render();
+
+  GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) );
+
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, data.createNewScene, TEST_LOCATION );
+  DALI_TEST_EQUALS( true, data.newSceneCreated, TEST_LOCATION );
+  data.Reset();
+
+  END_TEST;
+}
+
 int UtcDaliSceneEventProcessingFinishedP(void)
 {
   TestApplication application;
index df3bec0..f11c187 100644 (file)
@@ -41,7 +41,6 @@ class Core;
 namespace Integration
 {
 class Core;
-class GestureManager;
 class GlAbstraction;
 class GlSyncAbstraction;
 class PlatformAbstraction;
@@ -199,8 +198,6 @@ private:
  *
  * 6) Provide an implementation of the GlAbstraction interface, used to access OpenGL services.
  *
- * 7) Provide an implementation of the GestureManager interface, used to register gestures provided by the platform.
- *
  * Multi-threading notes:
  *
  * The Dali API methods are not reentrant.  If you access the API from multiple threads simultaneously, then the results
@@ -227,7 +224,6 @@ public:
    * @param[in] platformAbstraction The interface providing platform specific services.
    * @param[in] glAbstraction The interface providing OpenGL services.
    * @param[in] glSyncAbstraction The interface providing OpenGL sync objects.
-   * @param[in] gestureManager The interface providing gesture manager services.
    * @param[in] policy The data retention policy. This depends on application setting
    * and platform support. Dali should honour this policy when deciding to discard
    * intermediate resource data.
diff --git a/dali/integration-api/gesture-manager.h b/dali/integration-api/gesture-manager.h
deleted file mode 100644 (file)
index 8b261e1..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#ifndef DALI_INTEGRATION_GESTURE_MANAGER_H
-#define DALI_INTEGRATION_GESTURE_MANAGER_H
-
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/public-api/events/gesture.h>
-#include <dali/integration-api/events/gesture-requests.h>
-
-namespace Dali
-{
-
-namespace Integration
-{
-
-/**
- * GestureManager is an abstract interface, used by Dali to register and unregister gestures provided
- * by the adaptor. A concrete implementation must be created for each adaptor, and provided when creating
- * the Dali::Integration::Core object.
- */
-class DALI_CORE_API GestureManager
-{
-public:
-
-  /**
-   * Called by Dali to enable the adaptor to start detecting the required gesture type.
-   * @param[in]  request  The required gesture and details.
-   */
-  virtual void Register(const GestureRequest& request) = 0;
-
-  /**
-   * Called by Dali to inform the adaptor that it no longer requires a GestureEvent when the state
-   * gesture type is detected.
-   * @param[in]  request  The gesture that is no longer required.
-   */
-  virtual void Unregister(const GestureRequest& request) = 0;
-
-  /**
-   * Called by Dali to inform the adaptor that the detection parameters of a previously requested
-   * gesture have now changed.
-   * @param[in]  request  The gesture and updated details.
-   */
-  virtual void Update(const GestureRequest& request) = 0;
-
-protected:
-
-  /**
-   * Virtual destructor, no deletion through this interface
-   */
-  virtual ~GestureManager() {}
-
-}; // class GestureManager
-
-} // namespace Integration
-
-} // namespace Dali
-
-#endif // DALI_INTEGRATION_GESTURE_MANAGER_H
index 17f22e9..2270fc2 100644 (file)
@@ -183,18 +183,6 @@ public:
    */
   virtual Integration::StencilBufferAvailable GetStencilBufferRequired() = 0;
 
-  /**
-   * @brief Sets the background color of the surface.
-   * @param[in] color The new background color
-   */
-  virtual void SetBackgroundColor(Vector4 color) = 0;
-
-  /**
-   * @brief Gets the background color of the surface.
-   * @return The background color
-   */
-  virtual Vector4 GetBackgroundColor() = 0;
-
 private:
 
   /**
index e5c7f2f..b2a4922 100644 (file)
@@ -89,6 +89,16 @@ Vector2 Scene::GetDpi() const
   return GetImplementation(*this).GetDpi();
 }
 
+void Scene::SetBackgroundColor( const Vector4& color )
+{
+  GetImplementation(*this).SetBackgroundColor( color );
+}
+
+Vector4 Scene::GetBackgroundColor() const
+{
+  return GetImplementation(*this).GetBackgroundColor();
+}
+
 RenderTaskList Scene::GetRenderTaskList() const
 {
   return RenderTaskList( &GetImplementation(*this).GetRenderTaskList() );
index 0e4dbbd..2128b47 100755 (executable)
@@ -21,6 +21,7 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/object/handle.h>
 #include <dali/public-api/math/vector2.h>
+#include <dali/public-api/math/vector4.h>
 
 namespace Dali
 {
@@ -149,6 +150,20 @@ public:
   Vector2 GetDpi() const;
 
   /**
+   * @brief Sets the background color.
+   *
+   * @param[in] color The new background color
+   */
+  void SetBackgroundColor( const Vector4& color );
+
+  /**
+   * @brief Gets the background color of the render surface.
+   *
+   * @return The background color
+   */
+  Vector4 GetBackgroundColor() const;
+
+  /**
    * @brief Retrieves the list of render-tasks.
    *
    * @return A valid handle to a RenderTaskList
index 1a09947..8841da4 100644 (file)
@@ -197,7 +197,7 @@ void Core::SurfaceResized( Integration::RenderSurface* surface )
   {
     if( (*iter)->GetSurface() == surface )
     {
-      (*iter)->SetSurface( *surface );
+      (*iter)->SurfaceResized();
     }
   }
 }
@@ -268,18 +268,22 @@ void Core::ProcessEvents()
   // Signal that any messages received will be flushed soon
   mUpdateManager->EventProcessingStarted();
 
+  // Scene could be added or removed while processing the events
+  // Copy the Scene container locally to avoid possibly invalid iterator
+  SceneContainer scenes = mScenes;
+
   // process events in all scenes
-  for( auto iter = mScenes.begin(); iter != mScenes.end(); ++iter )
+  for( auto scene : scenes )
   {
-    (*iter)->ProcessEvents();
+    scene->ProcessEvents();
   }
 
   mNotificationManager->ProcessMessages();
 
   // Emit signal here to inform listeners that event processing has finished.
-  for( auto iter = mScenes.begin(); iter != mScenes.end(); ++iter )
+  for( auto scene : scenes )
   {
-    (*iter)->EmitEventProcessingFinishedSignal();
+    scene->EmitEventProcessingFinishedSignal();
   }
 
   // Run any registered processors
@@ -289,9 +293,9 @@ void Core::ProcessEvents()
   mRelayoutController->Relayout();
 
   // Rebuild depth tree after event processing has finished
-  for( auto iter = mScenes.begin(); iter != mScenes.end(); ++iter )
+  for( auto scene : scenes )
   {
-    (*iter)->RebuildDepthTree();
+    scene->RebuildDepthTree();
   }
 
   // Flush any queued messages for the update-thread
index 9105f7a..f596ae9 100644 (file)
@@ -326,7 +326,8 @@ private:
   OwnerPointer<GestureEventProcessor>           mGestureEventProcessor;       ///< The gesture event processor
   Dali::Vector<Integration::Processor*>         mProcessors;                  ///< Registered processors (not owned)
 
-  std::vector<ScenePtr>                         mScenes;                      ///< A container of scenes that bound to a surface for rendering, owned by Core
+  using SceneContainer = std::vector<ScenePtr>;
+  SceneContainer                                mScenes;                      ///< A container of scenes that bound to a surface for rendering, owned by Core
 
   // The object registry
   ObjectRegistryPtr                             mObjectRegistry;
index 4d00fd0..a944d35 100644 (file)
@@ -63,6 +63,7 @@ Scene::Scene( const Size& size )
   mSize( size ),
   mSurfaceSize( Vector2::ZERO ),
   mDpi( Vector2::ZERO ),
+  mBackgroundColor( DEFAULT_BACKGROUND_COLOR ),
   mDepthTreeDirty( false ),
   mEventProcessor( *this, ThreadLocalStorage::GetInternal()->GetGestureEventProcessor() )
 {
@@ -195,34 +196,54 @@ void Scene::SetSurface( Integration::RenderSurface& surface )
   mSurface = &surface;
   if ( mSurface )
   {
-    mSurfaceSize.width = static_cast<float>( mSurface->GetPositionSize().width );
-    mSurfaceSize.height = static_cast<float>( mSurface->GetPositionSize().height );
+    RenderTaskPtr defaultRenderTask = mRenderTaskList->GetTask( 0u );
 
-    mSize.width = mSurfaceSize.width;
-    mSize.height = mSurfaceSize.height;
+    mFrameBuffer = Dali::Internal::FrameBuffer::New( surface, Dali::FrameBuffer::Attachment::NONE );
+    defaultRenderTask->SetFrameBuffer( mFrameBuffer );
 
-    // Calculates the aspect ratio, near and far clipping planes, field of view and camera Z position.
-    mDefaultCamera->SetPerspectiveProjection( mSurfaceSize );
+    SurfaceResized();
+  }
+}
 
-    mRootLayer->SetSize( mSize.width, mSize.height );
+void Scene::SurfaceResized()
+{
+  if( mSurface )
+  {
+    const float fWidth = static_cast<float>( mSurface->GetPositionSize().width );
+    const float fHeight = static_cast<float>( mSurface->GetPositionSize().height );
 
-    ThreadLocalStorage* tls = ThreadLocalStorage::GetInternal();
-    SceneGraph::UpdateManager& updateManager = tls->GetUpdateManager();
-    SetDefaultSurfaceRectMessage( updateManager, Rect<int32_t>( 0, 0, static_cast<int32_t>( mSurfaceSize.width ), static_cast<int32_t>( mSurfaceSize.height ) ) ); // truncated
+    if( ( fabsf( mSurfaceSize.width - fWidth ) > Math::MACHINE_EPSILON_1 ) || ( fabsf( mSurfaceSize.height - fHeight ) > Math::MACHINE_EPSILON_1 ) )
+    {
+      Rect<int32_t> newSize( 0, 0, static_cast<int32_t>( mSurface->GetPositionSize().width ), static_cast<int32_t>( mSurface->GetPositionSize().height ) );
 
-    RenderTaskPtr defaultRenderTask = mRenderTaskList->GetTask( 0u );
+      mSurfaceSize.width = fWidth;
+      mSurfaceSize.height = fHeight;
 
-    // if single render task to screen then set its viewport parameters
-    if( 1 == mRenderTaskList->GetTaskCount() )
-    {
-      if( !defaultRenderTask->GetTargetFrameBuffer() )
+      mSize.width = mSurfaceSize.width;
+      mSize.height = mSurfaceSize.height;
+
+      // Calculates the aspect ratio, near and far clipping planes, field of view and camera Z position.
+      mDefaultCamera->SetPerspectiveProjection( mSurfaceSize );
+
+      mRootLayer->SetSize( mSize.width, mSize.height );
+
+      ThreadLocalStorage* tls = ThreadLocalStorage::GetInternal();
+      SceneGraph::UpdateManager& updateManager = tls->GetUpdateManager();
+      SetDefaultSurfaceRectMessage( updateManager, newSize ); // truncated
+
+      RenderTaskPtr defaultRenderTask = mRenderTaskList->GetTask( 0u );
+
+      // if single render task to screen then set its viewport parameters
+      if( 1 == mRenderTaskList->GetTaskCount() )
       {
-        defaultRenderTask->SetViewport( Viewport( 0, 0, static_cast<int32_t>( mSurfaceSize.width ), static_cast<int32_t>( mSurfaceSize.height ) ) ); // truncated
+        if( !defaultRenderTask->GetTargetFrameBuffer() )
+        {
+          defaultRenderTask->SetViewport( newSize ); // truncated
+        }
       }
-    }
 
-    mFrameBuffer = Dali::Internal::FrameBuffer::New( surface, Dali::FrameBuffer::Attachment::NONE );
-    defaultRenderTask->SetFrameBuffer( mFrameBuffer );
+      defaultRenderTask->GetFrameBuffer()->SetSize( static_cast<uint32_t>( newSize.width ), static_cast<uint32_t>( newSize.height ) );
+    }
   }
 }
 
@@ -266,17 +287,19 @@ void Scene::RebuildDepthTree()
   }
 }
 
-void Scene::SetBackgroundColor(Vector4 color)
+void Scene::SetBackgroundColor( const Vector4& color )
 {
+  mBackgroundColor = color;
+
   if( mSurface )
   {
-    mSurface->SetBackgroundColor( color );
+    mRenderTaskList->GetTask( 0u )->GetFrameBuffer()->SetBackgroundColor( color );
   }
 }
 
 Vector4 Scene::GetBackgroundColor() const
 {
-  return mSurface ? mSurface->GetBackgroundColor() : DEFAULT_BACKGROUND_COLOR;
+  return mBackgroundColor;
 }
 
 void Scene::EmitKeyEventSignal(const KeyEvent& event)
index b94175a..fb09efd 100644 (file)
@@ -120,6 +120,11 @@ public:
   void SetSurface( Integration::RenderSurface& surface );
 
   /**
+   * Notify the surface has been resized.
+   */
+  void SurfaceResized();
+
+  /**
    * @copydoc Dali::Integration::Scene::Discard
    */
   void Discard();
@@ -159,10 +164,10 @@ public:
   void RebuildDepthTree();
 
   /**
-   * @brief Sets the background color of the render surface.
+   * @brief Sets the background color of the render surface.
    * @param[in] color The new background color
    */
-  void SetBackgroundColor(Vector4 color);
+  void SetBackgroundColor( const Vector4& color );
 
   /**
    * @brief Gets the background color of the render surface.
@@ -263,6 +268,8 @@ private:
 
   Vector2 mDpi;
 
+  Vector4 mBackgroundColor;
+
   LayerPtr mRootLayer;
 
   // Ordered list of currently on-stage layers
index c79bd28..7a81295 100644 (file)
@@ -61,7 +61,6 @@ public:
   /**
    * Create a gesture event processor.
    * @param[in] updateManager The update manager
-   * @param[in] gestureManager The gesture manager
    * @param[in] renderController The render controller
    */
   GestureEventProcessor( SceneGraph::UpdateManager& updateManager, Integration::RenderController& renderController );
index dcc813c..efa443d 100644 (file)
@@ -56,7 +56,6 @@ public:
 
   /**
    * Create a pan gesture processor.
-   * @param[in] gestureManager The gesture manager
    * @param[in] updateManager The Update Manager
    */
   PanGestureProcessor( SceneGraph::UpdateManager& updateManager );
index 3bbd75d..dc99a7a 100644 (file)
@@ -50,7 +50,6 @@ public:
 
   /**
    * Create a pinch gesture processor.
-   * @param[in] gestureManager The gesture manager
    */
   PinchGestureProcessor();
 
index df64cb7..f31d045 100644 (file)
@@ -49,7 +49,6 @@ public:
 
   /**
    * Create a tap gesture processor.
-   * @param[in] gestureManager The gesture manager.
    */
   TapGestureProcessor();
 
index 2b42e41..9c8345d 100644 (file)
@@ -106,6 +106,25 @@ Texture* FrameBuffer::GetColorTexture()
   return mIsSurfaceBacked ? nullptr : mColor.Get();
 }
 
+void FrameBuffer::SetSize( uint32_t width, uint32_t height )
+{
+  mWidth = width;
+  mHeight = height;
+
+  if( mRenderObject->IsSurfaceBacked() )
+  {
+    SetFrameBufferSizeMessage( mEventThreadServices.GetUpdateManager(), static_cast<Render::SurfaceFrameBuffer*>( mRenderObject ), width, height );
+  }
+}
+
+void FrameBuffer::SetBackgroundColor( const Vector4& color )
+{
+  if( mRenderObject->IsSurfaceBacked() )
+  {
+    SetFrameBufferBackgroundColorMessage( mEventThreadServices.GetUpdateManager(), static_cast<Render::SurfaceFrameBuffer*>( mRenderObject ), color );
+  }
+}
+
 FrameBuffer::~FrameBuffer()
 {
   if( EventThreadServices::IsCoreRunning() && mRenderObject )
index 3531c0f..341b284 100644 (file)
@@ -63,8 +63,8 @@ public:
   /**
    * @brief Create a new FrameBuffer
    *
-   * @param[in] renderSurface  The render surface
-   * @param[in] attachments    The attachments comprising the format of the FrameBuffer (bit-mask)
+   * @param[in] renderSurface   The render surface
+   * @param[in] attachments     The attachments comprising the format of the FrameBuffer (bit-mask)
    * @return A smart-pointer to the newly allocated Texture.
    */
   static FrameBufferPtr New( Dali::Integration::RenderSurface& renderSurface, Mask attachments );
@@ -91,6 +91,19 @@ public:
    */
   Texture* GetColorTexture();
 
+  /**
+   * @brief Sets the frame buffer size.
+   * @param[in] width The width size
+   * @param[in] height The height size
+   */
+  void SetSize( uint32_t width, uint32_t height );
+
+  /**
+   * @brief Sets the background color
+   * @param[in] color The new background color
+   */
+  void SetBackgroundColor( const Vector4& color );
+
 private: // implementation
 
   /**
index ee70d89..2d550b5 100644 (file)
@@ -50,6 +50,13 @@ namespace Internal
 namespace SceneGraph
 {
 
+#if defined(DEBUG_ENABLED)
+namespace
+{
+Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_RENDER_MANAGER" );
+} // unnamed namespace
+#endif
+
 /**
  * Structure to contain internal data
  */
@@ -451,9 +458,17 @@ void RenderManager::Render( Integration::RenderStatus& status, bool forceClear )
   const uint32_t count = mImpl->instructions.Count( mImpl->renderBufferIndex );
   const bool haveInstructions = count > 0u;
 
+  DALI_LOG_INFO( gLogFilter, Debug::General,
+                 "Render: haveInstructions(%s) || mImpl->lastFrameWasRendered(%s) || forceClear(%s)\n",
+                 haveInstructions ? "true" : "false",
+                 mImpl->lastFrameWasRendered ? "true" : "false",
+                 forceClear ? "true" : "false" );
+
   // Only render if we have instructions to render, or the last frame was rendered (and therefore a clear is required).
   if( haveInstructions || mImpl->lastFrameWasRendered || forceClear )
   {
+    DALI_LOG_INFO( gLogFilter, Debug::General, "Render: Processing\n" );
+
     // Mark that we will require a post-render step to be performed (includes swap-buffers).
     status.SetNeedsPostRender( true );
 
index 7cc38bb..4b63c33 100644 (file)
@@ -30,7 +30,11 @@ namespace Render
 SurfaceFrameBuffer::SurfaceFrameBuffer( Integration::RenderSurface* surface )
 : FrameBuffer(),
   mSurface( surface ),
-  mContext( nullptr )
+  mContext( nullptr ),
+  mWidth( mSurface->GetPositionSize().width ),
+  mHeight( mSurface->GetPositionSize().height ),
+  mBackgroundColor( 0.f, 0.f, 0.f, 1.f ),
+  mSizeChanged( false )
 {
 }
 
@@ -58,23 +62,26 @@ void SurfaceFrameBuffer::Initialize(Context& context)
 
 void SurfaceFrameBuffer::Bind( Context& context )
 {
-  mSurface->PreRender( false );
+  mSurface->PreRender( mSizeChanged );
+
   context.BindFramebuffer( GL_FRAMEBUFFER, 0u );
 }
 
 uint32_t SurfaceFrameBuffer::GetWidth() const
 {
-  return mSurface->GetPositionSize().width;
+  return mWidth;
 }
 
 uint32_t SurfaceFrameBuffer::GetHeight() const
 {
-  return mSurface->GetPositionSize().height;
+  return mHeight;
 }
 
 void SurfaceFrameBuffer::PostRender()
 {
-  mSurface->PostRender( false, false, false );
+  mSurface->PostRender( false, false, mSizeChanged );
+
+  mSizeChanged = false;
 }
 
 Context* SurfaceFrameBuffer::GetContext()
@@ -94,7 +101,19 @@ Integration::StencilBufferAvailable SurfaceFrameBuffer::GetStencilBufferRequired
 
 Vector4 SurfaceFrameBuffer::GetBackgroundColor()
 {
-  return mSurface->GetBackgroundColor();
+  return mBackgroundColor;
+}
+
+void SurfaceFrameBuffer::SetSize( uint32_t width, uint32_t height )
+{
+  mWidth = width;
+  mHeight = height;
+  mSizeChanged = true;
+}
+
+void SurfaceFrameBuffer::SetBackgroundColor( const Vector4& color )
+{
+  mBackgroundColor = color;
 }
 
 } //Render
index 576ea65..ebe7eb5 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 // INTERNAL INCLUDES
+#include <dali/internal/update/manager/update-manager.h>
 #include <dali/internal/render/renderers/render-frame-buffer.h>
 #include <dali/integration-api/render-surface.h>
 
@@ -82,6 +83,19 @@ public:
    */
   bool IsSurfaceBacked() override { return true; };
 
+  /**
+   * @brief Sets the frame buffer size.
+   * @param[in] width The width size
+   * @param[in] height The height size
+   */
+  void SetSize( uint32_t width, uint32_t height );
+
+  /**
+   * @brief Sets the background color.
+   * @param[in] color The new background color
+   */
+  void SetBackgroundColor( const Vector4& color );
+
 public:
 
   /**
@@ -117,8 +131,35 @@ private:
 
   Integration::RenderSurface* mSurface;   ///< The render surface
   Context*                    mContext;   ///< The context holding the GL state of rendering for the surface backed frame buffer
+
+  uint32_t                    mWidth;
+  uint32_t                    mHeight;
+  Vector4                     mBackgroundColor;
+  bool                        mSizeChanged;
 };
 
+// Messages for FrameBuffer
+inline void SetFrameBufferSizeMessage( SceneGraph::UpdateManager& updateManager, SurfaceFrameBuffer* surfaceFrameBuffer, uint32_t width, uint32_t height )
+{
+  typedef MessageValue2< SurfaceFrameBuffer, uint32_t, uint32_t  > LocalType;
+
+  // Reserve some memory inside the message queue
+  uint32_t* slot = updateManager.ReserveMessageSlot( sizeof( LocalType ) );
+
+  // Construct message in the message queue memory; note that delete should not be called on the return value
+  new (slot) LocalType( surfaceFrameBuffer, &SurfaceFrameBuffer::SetSize, width, height );
+}
+
+inline void SetFrameBufferBackgroundColorMessage( SceneGraph::UpdateManager& updateManager, SurfaceFrameBuffer* surfaceFrameBuffer, const Vector4& color )
+{
+  typedef MessageValue1< SurfaceFrameBuffer, Vector4 > LocalType;
+
+  // Reserve some memory inside the message queue
+  uint32_t* slot = updateManager.ReserveMessageSlot( sizeof( LocalType ) );
+
+  // Construct message in the message queue memory; note that delete should not be called on the return value
+  new (slot) LocalType( surfaceFrameBuffer, &SurfaceFrameBuffer::SetBackgroundColor, color );
+}
 
 } // namespace Render
 
index 9fd71a1..d2311f9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -87,6 +87,10 @@ mImpl->frameCounter++;
 
 #if defined(DEBUG_ENABLED)
 extern Debug::Filter* gRenderTaskLogFilter;
+namespace
+{
+Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_UPDATE_MANAGER" );
+} // unnamed namespace
 #endif
 
 
@@ -369,6 +373,8 @@ void UpdateManager::AddNode( OwnerPointer<Node>& node )
 
   // Nodes must be sorted by pointer
   Node* rawNode = node.Release();
+  DALI_LOG_INFO( gLogFilter, Debug::General, "[%x] AddNode\n", rawNode );
+
   Vector<Node*>::Iterator begin = mImpl->nodes.Begin();
   for( Vector<Node*>::Iterator iter = mImpl->nodes.End()-1; iter >= begin; --iter )
   {
@@ -387,6 +393,8 @@ void UpdateManager::ConnectNode( Node* parent, Node* node )
   DALI_ASSERT_ALWAYS( NULL != node );
   DALI_ASSERT_ALWAYS( NULL == node->GetParent() ); // Should not have a parent yet
 
+  DALI_LOG_INFO( gLogFilter, Debug::General, "[%x] ConnectNode\n", node );
+
   parent->ConnectChild( node );
 
   // Inform the frame-callback-processor, if set, about the node-hierarchy changing
@@ -398,6 +406,8 @@ void UpdateManager::ConnectNode( Node* parent, Node* node )
 
 void UpdateManager::DisconnectNode( Node* node )
 {
+  DALI_LOG_INFO( gLogFilter, Debug::General, "[%x] DisconnectNode\n", node );
+
   Node* parent = node->GetParent();
   DALI_ASSERT_ALWAYS( NULL != parent );
   parent->SetDirtyFlag( NodePropertyFlags::CHILD_DELETED ); // make parent dirty so that render items dont get reused
@@ -416,6 +426,8 @@ void UpdateManager::DestroyNode( Node* node )
   DALI_ASSERT_ALWAYS( NULL != node );
   DALI_ASSERT_ALWAYS( NULL == node->GetParent() ); // Should have been disconnected
 
+  DALI_LOG_INFO( gLogFilter, Debug::General, "[%x] DestroyNode\n", node );
+
   Vector<Node*>::Iterator iter = mImpl->nodes.Begin()+1;
   Vector<Node*>::Iterator endIter = mImpl->nodes.End();
   for(;iter!=endIter;++iter)
@@ -573,6 +585,8 @@ void UpdateManager::SetShaderSaver( ShaderSaver& upstream )
 
 void UpdateManager::AddRenderer( OwnerPointer< Renderer >& renderer )
 {
+  DALI_LOG_INFO( gLogFilter, Debug::General, "[%x] AddRenderer\n", renderer.Get() );
+
   renderer->ConnectToSceneGraph( *mImpl->sceneController, mSceneGraphBuffers.GetUpdateBufferIndex() );
   mImpl->renderers.PushBack( renderer.Release() );
   mImpl->renderersAdded = true;
@@ -580,6 +594,8 @@ void UpdateManager::AddRenderer( OwnerPointer< Renderer >& renderer )
 
 void UpdateManager::RemoveRenderer( Renderer* renderer )
 {
+  DALI_LOG_INFO( gLogFilter, Debug::General, "[%x] RemoveRenderer\n", renderer );
+
   // Find the renderer and destroy it
   EraseUsingDiscardQueue( mImpl->renderers, renderer, mImpl->discardQueue, mSceneGraphBuffers.GetUpdateBufferIndex() );
   // Need to remove the render object as well
@@ -913,6 +929,19 @@ uint32_t UpdateManager::Update( float elapsedSeconds,
                                               isRenderingToFbo );
         }
       }
+
+      DALI_LOG_INFO( gLogFilter, Debug::General,
+                     "Update: numberOfRenderTasks(%d), taskListCount(%d), Render Instructions(%d)\n",
+                     numberOfRenderTasks, taskListCount, mImpl->renderInstructions.Count( bufferIndex ) );
+
+
+
+      // If any node is dirty, i.e. a property has changed or a child has been deleted, and we do not have any instructions to send, then generate a dummy instruction to force another render
+      if( ( mImpl->nodeDirtyFlags != NodePropertyFlags::NOTHING ) && ( mImpl->renderInstructions.Count( bufferIndex ) == 0 ) )
+      {
+        DALI_LOG_INFO( gLogFilter, Debug::General, "Node flags dirty, creating dummy instruction\n" );
+        mImpl->renderInstructions.GetNextInstruction( bufferIndex ); // This creates and adds an empty instruction. We do not need to modify it.
+      }
     }
   }
 
index 5b218a1..2ff48a3 100644 (file)
@@ -28,7 +28,7 @@ namespace Dali
 
 const uint32_t CORE_MAJOR_VERSION = 1;
 const uint32_t CORE_MINOR_VERSION = 4;
-const uint32_t CORE_MICRO_VERSION = 25;
+const uint32_t CORE_MICRO_VERSION = 26;
 const char * const CORE_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 2b77f69..a862704 100755 (executable)
@@ -59,7 +59,7 @@ public:
   Array( const std::initializer_list< Value >& values );
 
   /**
-   * @brief Copy Constructor.
+   * @brief Copy constructor.
    *
    * @SINCE_1_0.0
    * @param[in] other The Array to copy from
@@ -67,11 +67,12 @@ public:
   Array( const Array& other );
 
   /**
-   * @brief Move Constructor.
+   * @brief Move constructor.
    *
+   * A move constructor enables the resources owned by an r-value object to be moved into an l-value without copying.
    * @SINCE_1_4.17
    * @param[in] other The Array to move from
-   * @note The other array is an r-value so becomes invalid and is no longer usable.
+   * @note After the @a other array is used, it becomes invalid and is no longer usable.
    */
   Array( Array&& other );
 
@@ -205,7 +206,7 @@ public:
   Value& operator[]( SizeType index );
 
   /**
-   * @brief Assignment Operator.
+   * @brief Assignment operator.
    *
    * @SINCE_1_0.0
    * @param[in] other The array to copy from
@@ -215,14 +216,14 @@ public:
   Array& operator=( const Array& other );
 
   /**
-   * @brief Move Assignment Operator.
+   * @brief Move assignment operator.
    *
    * @SINCE_1_4.17
    * @param[in] other The array to copy from
    *
    * @return The moved array.
    *
-   * @note The other array is an r-value so becomes invalid and is no longer usable.
+   * @note After the @a other array is used, it becomes invalid and is no longer usable.
    */
   Array& operator=( Array&& other );
 
index f1d7e5c..b35a5ad 100755 (executable)
@@ -64,7 +64,7 @@ public:
   Map( const std::initializer_list< KeyValuePair >& values );
 
   /**
-   * @brief Copy Constructor.
+   * @brief Copy constructor.
    *
    * @SINCE_1_0.0
    * @param[in] other The Map to copy from
@@ -72,11 +72,11 @@ public:
   Map( const Map& other );
 
   /**
-   * @brief Move Constructor.
+   * @brief Move constructor.
    *
    * @SINCE_1_4.17
    * @param[in] other The Map to move from
-   * @note The other array is an r-value so becomes invalid and is no longer usable.
+   * @note After the @a other array is used, it becomes invalid and is no longer usable.
    */
   Map( Map&& other );
 
@@ -368,7 +368,7 @@ public:
   Value& operator[]( Property::Index key );
 
   /**
-   * @brief Assignment Operator.
+   * @brief Assignment operator.
    *
    * @SINCE_1_0.0
    * @param[in] other The map to copy from
@@ -378,7 +378,7 @@ public:
   Map& operator=( const Map& other );
 
   /**
-   * @brief Move Assignment Operator.
+   * @brief Move assignment operator.
    *
    * @SINCE_1_4.17
    * @param[in] other The map to move from
index 933eb8d..9b0f203 100755 (executable)
@@ -232,6 +232,7 @@ public:
   /**
    * @brief Move constructor.
    *
+   * A move constructor enables the resources owned by an rvalue object to be moved into an lvalue without copying.
    * @SINCE_1_4.16
    * @param[in] value The property value to move from
    */
index 622707a..95b55ae 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali
 Summary:    DALi 3D Engine
-Version:    1.4.25
+Version:    1.4.26
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT