Merge "Replace DALI_COMPILE_TIME_ASSERT with C++11 static_assert" into devel/master
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Mon, 3 Jul 2017 13:56:52 +0000 (13:56 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Mon, 3 Jul 2017 13:56:52 +0000 (13:56 +0000)
dali/integration-api/core.h
dali/internal/render/common/render-manager.cpp
dali/internal/update/manager/transform-manager.cpp
dali/public-api/actors/layer.h
dali/public-api/dali-core-version.cpp
packaging/dali.spec

index ba492a1..fed5246 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTEGRATION_CORE_H__
-#define __DALI_INTEGRATION_CORE_H__
+#ifndef DALI_INTEGRATION_CORE_H
+#define DALI_INTEGRATION_CORE_H
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -118,26 +118,52 @@ public:
    * Constructor
    */
   RenderStatus()
-  : needsUpdate(false)
+  : needsUpdate( false ),
+    needsPostRender( false )
   {
   }
 
   /**
    * Set whether update needs to run following a render.
-   * This might be because render has sent messages to update, or it has
-   * some textures to upload over several frames.
+   * @param[in] updateRequired Set to true if an update is required to be run
    */
-  void SetNeedsUpdate(bool updateRequired) { needsUpdate = updateRequired; }
+  void SetNeedsUpdate( bool updateRequired )
+  {
+    needsUpdate = updateRequired;
+  }
 
   /**
    * Query the update status following rendering of a frame.
-   * @return true if update should run.
+   * @return True if update is required to be run
+   */
+  bool NeedsUpdate() const
+  {
+    return needsUpdate;
+  }
+
+  /**
+   * Sets if a post-render should be run.
+   * If nothing is rendered this frame, we can skip post-render.
+   * @param[in] postRenderRequired Set to True if post-render is required to be run
    */
-  bool NeedsUpdate() { return needsUpdate; }
+  void SetNeedsPostRender( bool postRenderRequired )
+  {
+    needsPostRender = postRenderRequired;
+  }
+
+  /**
+   * Queries if a post-render should be run.
+   * @return True if post-render is required to be run
+   */
+  bool NeedsPostRender() const
+  {
+    return needsPostRender;
+  }
 
 private:
 
-  bool needsUpdate;
+  bool needsUpdate      :1;  ///< True if update is required to be run
+  bool needsPostRender  :1;  ///< True if post-render is required to be run.
 };
 
 /**
@@ -413,4 +439,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_INTEGRATION_CORE_H__
+#endif // DALI_INTEGRATION_CORE_H
index bc511af..c980d74 100644 (file)
@@ -436,6 +436,9 @@ void RenderManager::Render( Integration::RenderStatus& status )
   // Only render if we have instructions to render, or the last frame was rendered (and therefore a clear is required).
   if( haveInstructions || mImpl->lastFrameWasRendered )
   {
+    // Mark that we will require a post-render step to be performed (includes swap-buffers).
+    status.SetNeedsPostRender( true );
+
     // switch rendering to adaptor provided (default) buffer
     mImpl->context.BindFramebuffer( GL_FRAMEBUFFER, 0 );
 
index e72ea69..b8626c7 100644 (file)
@@ -289,9 +289,10 @@ void TransformManager::Update()
         if( (mInheritanceMode[i] & INHERIT_POSITION) == 0 )
         {
           //Don't inherit position
+          CalculateCenterPosition( centerPosition, mTxComponentStatic[ i ], mTxComponentAnimatable[ i ], mSize[ i ], half, topLeft );
           mLocal[i].SetTransformComponents( localScale, localOrientation, Vector3::ZERO );
           Matrix::Multiply( mWorld[i], mLocal[i], parentMatrix );
-          mWorld[i].SetTranslation( mTxComponentAnimatable[i].mPosition);
+          mWorld[i].SetTranslation( mTxComponentAnimatable[i].mPosition + centerPosition );
         }
         else
         {
index a41febd..3d1e002 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_LAYER_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -48,25 +48,28 @@ typedef Rect<int> ClippingBox;
 /**
  * @brief Layers provide a mechanism for overlaying groups of actors on top of each other.
  *
- * When added to the stage, a layer can be ordered relative to other layers. The bottom
- * layer is at depth zero. The stage provides a default layer for it's children (see Stage::GetRootLayer()).
+ * When added to the stage, a layer can be ordered relative to other
+ * layers. The bottom layer is at depth zero. The stage provides a default
+ * layer for it's children (see Stage::GetRootLayer()).
  *
- * Layered actors inherit position etc. as normal, but are drawn in an order determined
- * by the layers. In case of LAYER_3D, the depth buffer is cleared before each layer is rendered unless depth
- * test is disabled or there's no need for it based on the layers contents;
- * actors in lower layers cannot obscure actors in higher layers.
+ * Layered actors inherit position etc. as normal, but are drawn in an order
+ * determined by the layers. In case of LAYER_3D, the depth buffer is cleared
+ * before each layer is rendered unless depth test is disabled or there's no
+ * need for it based on the layer's contents; actors in lower layers cannot
+ * obscure actors in higher layers.
  *
- * A layer has either LAYER_2D or LAYER_3D mode. LAYER_2D has better performance,
- * the depth test is disabled, and a child actor hides its parent actor.
- * LAYER_3D uses the depth test, thus a close actor hides a farther one.
- * LAYER_2D is the default mode and recommended for general cases.
- * See Layer::Behavior and SetBehavior() for more information.
+ * A layer has either LAYER_2D or LAYER_3D mode. LAYER_2D has better
+ * performance, the depth test is disabled, and a child actor hides its
+ * parent actor.  LAYER_3D uses the depth test, thus a close actor hides a
+ * farther one.  LAYER_2D is the default mode and recommended for general
+ * cases.  See Layer::Behavior and SetBehavior() for more information.
  *
- * Layer is a type of Actor, thus can have parent or children actors.
- * A layer influences rendering of its all descendant actors,
- * until another layer appears in the actor tree and manages its own subtree.
+ * Layer is a type of Actor, thus can have parent or children actors.  A
+ * layer influences rendering of its all descendant actors, until another
+ * layer appears in the actor tree and manages its own subtree.
  *
- * If depth test is disabled, there is no performance overhead from clearing the depth buffer.
+ * If depth test is disabled, there is no performance overhead from clearing
+ * the depth buffer.
  *
  * Actions
  * | %Action Name    | %Layer method called |
@@ -122,13 +125,14 @@ public:
     /**
      * @brief UI control rendering mode (default mode).
      *
-     * This mode is designed for UI controls. In this mode renderer order will be respective to tree hierarchy of Actors.
-     * This mode is expected to have better performance than LAYER_3D as renderers can be sorted more efficiently.
+     * This mode is designed for UI controls that can overlap. In this
+     * mode renderer order will be respective to the tree hierarchy of
+     * Actors.
      *
-     * For the following actor tree the rendering order will be A first, then B & C and finally D,E,F regardless of their
-     * Z positions.
-     * Rendering order between siblings, such as D, E & F or B & C, is determined based on the renderers depth index.
-     * In UI we don't normally expect overlap. If you have two overlapped actors, make them parent-child to guarantee order of all renderers.
+     * The rendering order is depth first, so for the following actor tree,
+     * A will be drawn first, then B, D, E, then C, F.  This ensures that
+     * overlapping actors are drawn as expected (whereas, with breadth first
+     * traversal, the actors would interleave).
      *
      * @code
      *
@@ -142,6 +146,10 @@ public:
      *
      * @endcode
      *
+     * To change the order of sibling actors, use the Actor::Raise and
+     * Actor::Lower APIs. Within an actor, the Renderer depth index dictates
+     * the order the renderers are drawn.
+     *
      * @SINCE_1_1.45
      */
     LAYER_UI = LAYER_2D,
@@ -149,16 +157,25 @@ public:
     /**
      * @brief Layer will use depth test.
      *
-     * When using this mode, depth test will be used. A depth clear will happen for each layer,
-     * which means actors in a layer "above" other layers will be rendered in front of actors in
-     * those layers regardless of their Z positions (see Layer::Raise() and Layer::Lower()).
-     * Opaque renderers are drawn first and write to the depth buffer.
-     * Then transparent renderers are drawn with depth test enabled but depth write switched off.
-     * Transparent renderers are drawn based on their distance from the camera.
-     * A renderers DEPTH_INDEX property is used to offset the distance to the camera when ordering transparent renderers.
-     * This is useful if you want to define the draw order of two or more transparent renderers that are
-     * equal distance from the camera.
-     * Unlike LAYER_UI, parent-child relationship does not affect rendering order at all.
+     * This mode is designed for a 3 dimensional scene where actors in front
+     * of other actors will obscure them, i.e. the actors are sorted by the
+     * distance from the camera.
+     *
+     * When using this mode, a depth test will be used. A depth clear will
+     * happen for each layer, which means actors in a layer "above" other
+     * layers will be rendered in front of actors in those layers regardless
+     * of their Z positions (see Layer::Raise() and Layer::Lower()).
+     *
+     * Opaque renderers are drawn first and write to the depth buffer.  Then
+     * transparent renderers are drawn with depth test enabled but depth
+     * write switched off.  Transparent renderers are drawn based on their
+     * distance from the camera.  A renderer's DEPTH_INDEX property is used to
+     * offset the distance to the camera when ordering transparent renderers.
+     *
+     * This is useful if you want to define the draw order of two or more
+     * transparent renderers that are equal distance from the camera.  Unlike
+     * LAYER_UI, parent-child relationship does not affect rendering order at
+     * all.
      *
      * @SINCE_1_0.0
      */
index 6749a07..c2071ce 100644 (file)
@@ -28,7 +28,7 @@ namespace Dali
 
 const unsigned int CORE_MAJOR_VERSION = 1;
 const unsigned int CORE_MINOR_VERSION = 2;
-const unsigned int CORE_MICRO_VERSION = 45;
+const unsigned int CORE_MICRO_VERSION = 46;
 const char * const CORE_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index f374f37..7f34b38 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali
 Summary:    The OpenGLES Canvas Core Library
-Version:    1.2.45
+Version:    1.2.46
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT