Merge remote-tracking branch 'origin/tizen' into devel/new_mesh 32/40732/2
authorFrancisco Santos <f1.santos@samsung.com>
Thu, 4 Jun 2015 16:12:13 +0000 (17:12 +0100)
committerFrancisco Santos <f1.santos@samsung.com>
Tue, 9 Jun 2015 09:46:45 +0000 (10:46 +0100)
Conflicts:
automated-tests/src/dali-internal/utc-Dali-AnimatableMesh.cpp
automated-tests/src/dali-internal/utc-Dali-DynamicsShape.cpp
automated-tests/src/dali-internal/utc-Dali-MeshActor.cpp
automated-tests/src/dali-internal/utc-Dali-MeshData.cpp
automated-tests/src/dali/CMakeLists.txt.in
dali/internal/event/actors/layer-impl.h
dali/internal/event/common/type-info-impl.cpp
dali/internal/event/dynamics/dynamics-mesh-shape-impl.cpp
dali/internal/event/modeling/animatable-mesh-impl.cpp
dali/internal/file.list
dali/public-api/actors/layer.cpp
dali/public-api/actors/layer.h

Change-Id: Id8a451346a2b5c92276cd38bb63fde1e01036455

25 files changed:
1  2 
automated-tests/src/dali-internal/CMakeLists.txt
automated-tests/src/dali-internal/utc-Dali-Context.cpp
automated-tests/src/dali-internal/utc-Dali-DynamicsShape.cpp
automated-tests/src/dali-internal/utc-Dali-Material.cpp
automated-tests/src/dali/CMakeLists.txt.in
automated-tests/src/dali/utc-Dali-Layer.cpp
dali/devel-api/file.list
dali/integration-api/resource-types.h
dali/internal/event/actors/actor-impl.cpp
dali/internal/event/actors/actor-impl.h
dali/internal/event/actors/image-actor-impl.cpp
dali/internal/event/actors/layer-impl.h
dali/internal/event/common/object-impl-helper.h
dali/internal/event/common/object-impl.cpp
dali/internal/event/effects/shader-effect-impl.cpp
dali/internal/event/resources/resource-client.h
dali/internal/file.list
dali/internal/update/node-attachments/scene-graph-image-attachment.cpp
dali/internal/update/resources/resource-manager.h
dali/public-api/actors/actor.cpp
dali/public-api/actors/actor.h
dali/public-api/actors/layer.cpp
dali/public-api/actors/layer.h
dali/public-api/dali-core.h
dali/public-api/file.list

@@@ -6,8 -6,25 +6,21 @@@ SET(RPM_NAME "core-${PKG_NAME}-tests"
  SET(CAPI_LIB "dali-internal")
  
  SET(TC_SOURCES
 -        utc-Dali-AnimatableMesh.cpp
+         utc-Dali-Atlas.cpp
 -        utc-Dali-MeshActor.cpp
 -        utc-Dali-MeshData.cpp
+         utc-Dali-Context.cpp
+         utc-Dali-Constrainer.cpp
+         utc-Dali-DistanceField.cpp
+         utc-Dali-DynamicsBodyConfig.cpp
+         utc-Dali-DynamicsShape.cpp
+         utc-Dali-DynamicsWorld.cpp
+         utc-Dali-DynamicsWorldConfig.cpp
+         utc-Dali-Hash.cpp
+         utc-Dali-HitTestAlgorithm.cpp
+         utc-Dali-Material.cpp
+         utc-Dali-Mutex.cpp
+         utc-Dali-Scripting.cpp
          utc-Dali-Internal-Handles.cpp
          utc-Dali-Internal-ImageFactory.cpp
 -        utc-Dali-Internal-Mesh.cpp
          utc-Dali-Internal-ResourceClient.cpp
          utc-Dali-Internal-Image-Culling.cpp
          utc-Dali-Internal-FixedSizeMemoryPool.cpp
@@@ -20,14 -21,8 +21,9 @@@ SET(TC_SOURCE
          utc-Dali-ConnectionTracker.cpp
          utc-Dali-CustomActor.cpp
          utc-Dali-Degree.cpp
-         utc-Dali-DistanceField.cpp
-         utc-Dali-DynamicsBodyConfig.cpp
-         utc-Dali-DynamicsShape.cpp
-         utc-Dali-DynamicsWorld.cpp
-         utc-Dali-DynamicsWorldConfig.cpp
          utc-Dali-EncodedBufferImage.cpp
          utc-Dali-FrameBufferImage.cpp
 +        utc-Dali-Geometry.cpp
          utc-Dali-Gesture.cpp
          utc-Dali-GestureDetector.cpp
          utc-Dali-Handle.cpp
          utc-Dali-MathUtils.cpp
          utc-Dali-Matrix.cpp
          utc-Dali-Matrix3.cpp
-         utc-Dali-MouseWheelEvent.cpp
-         utc-Dali-Mutex.cpp
 +        utc-Dali-MeshMaterial.cpp
          utc-Dali-NativeImage.cpp
          utc-Dali-NinePatchImages.cpp
          utc-Dali-ObjectRegistry.cpp
          utc-Dali-Radian.cpp
          utc-Dali-Random.cpp
          utc-Dali-Rect.cpp
 +        utc-Dali-Renderer.cpp
          utc-Dali-RenderTask.cpp
          utc-Dali-RenderTaskList.cpp
 -        utc-Dali-RenderableActor.cpp
          utc-Dali-ResourceImage.cpp
-         utc-Dali-Scripting.cpp
 +        utc-Dali-Sampler.cpp
 +        utc-Dali-Shader.cpp
          utc-Dali-ShaderEffect.cpp
          utc-Dali-SignalTemplatesFunctors.cpp
          utc-Dali-SignalTemplates.cpp
@@@ -51,10 -66,12 +50,8 @@@ devel_api_core_geometry_header_files = 
  
  devel_api_core_images_header_files = \
    $(devel_api_src_dir)/images/atlas.h \
-   $(devel_api_src_dir)/images/distance-field.h \
-   $(devel_api_src_dir)/images/image-operations.h \
-   $(devel_api_src_dir)/images/native-image-interface.h
+   $(devel_api_src_dir)/images/distance-field.h
  
 -devel_api_core_modeling_header_files =  \
 -  $(devel_api_src_dir)/modeling/bone.h \
 -  $(devel_api_src_dir)/modeling/material.h
 -
  devel_api_core_object_header_files = \
    $(devel_api_src_dir)/object/type-registry-helper.h
  
Simple merge
@@@ -44,12 -44,22 +44,20 @@@ class Layer : public Acto
  public:
  
    /**
-    * @copydoc Dali::Layer::ZValue(const Vector3&)
 -   * @brief This sort function sorts translucent actors according to the Z-value in view space.
 -   *
 -   * This is useful for 2D user interfaces.
++   * @copydoc Dali::Layer::ZValue(const Vector3&, float)
+    *
+    * This is the default sorting function.
++   * It is useful for 2D user interfaces, and it's used to sort translucent renderers.
+    *
 -   * We return a negative z value as in our translation, a low z means that it should
 -   * be sorted further away and a high z means that it should be closer.
++   * Only the Z signed distance from the camera is considererd, lower values will be drawn on top.
++   * 
+    * @param[in] position     position of actor in view space
 -   * @param[in] sortModifier additional sort modifer
+    * @return depth
     */
 -  static float ZValue(const Vector3& position, float sortModifier)
 +  static float ZValue(const Vector3& position)
    {
      // inlined so we avoid a function call when sorting renderers
 -    return position.z + sortModifier;
 +    return position.z;
    }
  
    /**
index 8826752,0000000..8b5032b
mode 100644,000000..100644
--- /dev/null
@@@ -1,322 -1,0 +1,322 @@@
-     indices.reserve( DEFAULT_PROPERTY_COUNT );
 +#ifndef DALI_INTERNAL_OBJECT_IMPL_HELPER_H
 +#define DALI_INTERNAL_OBJECT_IMPL_HELPER_H
 +
 +/*
 + * Copyright (c) 2014 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.
 + *
 + */
 +
 +// EXTERNAL INCLUDEs
 +#include <cstring>
 +
 +// INTERNAL INCLUDES
 +#include <dali/public-api/object/property.h> // Dali::Property
 +#include <dali/public-api/object/property-index-ranges.h> // DEFAULT_DERIVED_HANDLE_PROPERTY_START_INDEX
 +#include <dali/internal/event/common/property-helper.h> // Dali::Internal::PropertyDetails
 +#include <dali/internal/event/common/stage-impl.h>
 +#include <dali/internal/update/common/animatable-property.h>
 +#include <dali/internal/update/common/property-owner-messages.h>
 +#include <dali/internal/update/manager/update-manager.h>
 +
 +namespace Dali
 +{
 +namespace Internal
 +{
 +class PropertyMetadata;
 +class AnimatablePropertyMetadata;
 +class CustomPropertyMetadata;
 +class PropertyInputImpl;
 +
 +namespace SceneGraph
 +{
 +
 +class PropertyBase;
 +class PropertyOwner;
 +
 +
 +} // namespace SceneGraph
 +
 +// Typedefs to allow object methods to be passed via parameter
 +typedef AnimatablePropertyMetadata* (Object::*FindAnimatablePropertyMethod)( Property::Index index ) const;
 +typedef CustomPropertyMetadata* (Object::*FindCustomPropertyMethod)( Property::Index index ) const;
 +
 +
 +/**
 + * Helper template class to be used by class that implement Object
 + *
 + * Example:
 + *<pre>
 + * typename ObjectImplHelper<DEFAULT_PROPERTY_COUNT, DEFAULT_PROPERTY_DETAILS> MyObjectImpl;
 + *
 + * MyObjectImpl::GetDefaultPropertyCount();
 + * </pre>
 + */
 +template<int DEFAULT_PROPERTY_COUNT>
 +struct ObjectImplHelper
 +{
 +  const PropertyDetails* DEFAULT_PROPERTY_DETAILS;
 +
 +  unsigned int GetDefaultPropertyCount() const
 +  {
 +    return DEFAULT_PROPERTY_COUNT;
 +  }
 +
 +  void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
 +  {
-       indices.push_back( DEFAULT_OBJECT_PROPERTY_START_INDEX + i );
++    indices.Reserve( DEFAULT_PROPERTY_COUNT );
 +
 +    for( unsigned int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
 +    {
++      indices.PushBack( DEFAULT_OBJECT_PROPERTY_START_INDEX + i );
 +    }
 +  }
 +
 +  const char* GetDefaultPropertyName( Property::Index index ) const
 +  {
 +    const char* name = NULL;
 +
 +    if( index >= DEFAULT_OBJECT_PROPERTY_START_INDEX && index < DEFAULT_PROPERTY_COUNT )
 +    {
 +      name = DEFAULT_PROPERTY_DETAILS[index].name;
 +    }
 +
 +    return name;
 +  }
 +
 +  Property::Index GetDefaultPropertyIndex( const std::string& name ) const
 +  {
 +    Property::Index index = Property::INVALID_INDEX;
 +
 +    //@todo MESH_REWORK - Are we assuming that the index into the array is the
 +    // same as the enumerated property? if enumIndex in the table was no longer
 +    // debug only, wouldn't need to make this assumption.
 +
 +    // Look for name in default properties
 +    for( unsigned int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
 +    {
 +      const Internal::PropertyDetails* property = &DEFAULT_PROPERTY_DETAILS[ i ];
 +      if( 0 == strcmp( name.c_str(), property->name ) ) // dont want to convert rhs to string
 +      {
 +        index = i;
 +        break;
 +      }
 +    }
 +
 +    return index;
 +  }
 +
 +  bool IsDefaultPropertyWritable( Property::Index index ) const
 +  {
 +    bool isWritable = false;
 +
 +    if( index >= DEFAULT_OBJECT_PROPERTY_START_INDEX && index < DEFAULT_PROPERTY_COUNT )
 +    {
 +      isWritable = DEFAULT_PROPERTY_DETAILS[index].writable;
 +    }
 +
 +    return isWritable;
 +  }
 +
 +  bool IsDefaultPropertyAnimatable( Property::Index index ) const
 +  {
 +    bool isAnimatable = false;
 +
 +    if( index >= DEFAULT_OBJECT_PROPERTY_START_INDEX && index < DEFAULT_PROPERTY_COUNT )
 +    {
 +      isAnimatable =  DEFAULT_PROPERTY_DETAILS[index].animatable;
 +    }
 +
 +    return isAnimatable;
 +  }
 +
 +  bool IsDefaultPropertyAConstraintInput( Property::Index index ) const
 +  {
 +    bool isConstraintInput = false;
 +
 +    if( index >= DEFAULT_OBJECT_PROPERTY_START_INDEX && index < DEFAULT_PROPERTY_COUNT )
 +    {
 +      isConstraintInput = DEFAULT_PROPERTY_DETAILS[index].constraintInput;
 +    }
 +
 +    return isConstraintInput;
 +  }
 +
 +  Property::Type GetDefaultPropertyType( Property::Index index ) const
 +  {
 +    Property::Type type = Property::NONE;
 +
 +    if( index >= DEFAULT_OBJECT_PROPERTY_START_INDEX && index < DEFAULT_PROPERTY_COUNT )
 +    {
 +      type =  DEFAULT_PROPERTY_DETAILS[index].type;
 +    }
 +
 +    return type;
 +  }
 +
 +  // Get the (animatable) scene graph property. (All registered scene graph properties are animatable)
 +  const SceneGraph::PropertyBase* GetRegisteredSceneGraphProperty(
 +    const Object* object,
 +    FindAnimatablePropertyMethod findAnimatablePropertyMethod,
 +    FindCustomPropertyMethod findCustomPropertyMethod,
 +    Property::Index index ) const
 +  {
 +    const SceneGraph::PropertyBase* property = NULL;
 +    if ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX && index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX )
 +    {
 +      AnimatablePropertyMetadata* animatable = (object->*findAnimatablePropertyMethod)( index );
 +      DALI_ASSERT_ALWAYS( animatable && "Property index is invalid" );
 +      property = animatable->GetSceneGraphProperty();
 +    }
 +    else if ( index >= DEFAULT_PROPERTY_MAX_COUNT )
 +    {
 +      CustomPropertyMetadata* custom = (object->*findCustomPropertyMethod)( index );
 +      DALI_ASSERT_ALWAYS( custom && "Property index is invalid" );
 +      property = custom->GetSceneGraphProperty();
 +    }
 +    return property;
 +  }
 +
 +  void SetSceneGraphProperty( EventThreadServices& eventThreadServices,
 +                              const Object* object,
 +                              Property::Index index,
 +                              const PropertyMetadata& entry,
 +                              const Property::Value& value ) const
 +  {
 +    const SceneGraph::PropertyOwner* sceneObject = object->GetSceneObject();
 +
 +    switch ( entry.type )
 +    {
 +      case Property::BOOLEAN:
 +      {
 +        const SceneGraph::AnimatableProperty<bool>* property = dynamic_cast< const SceneGraph::AnimatableProperty<bool>* >( entry.GetSceneGraphProperty() );
 +        DALI_ASSERT_DEBUG( NULL != property );
 +
 +        // property is being used in a separate thread; queue a message to set the property
 +        SceneGraph::AnimatablePropertyMessage<bool>::Send( eventThreadServices, sceneObject, property, &SceneGraph::AnimatableProperty<bool>::Bake, value.Get<bool>() );
 +
 +        break;
 +      }
 +
 +      case Property::FLOAT:
 +      {
 +        const SceneGraph::AnimatableProperty<float>* property = dynamic_cast< const SceneGraph::AnimatableProperty<float>* >( entry.GetSceneGraphProperty() );
 +        DALI_ASSERT_DEBUG( NULL != property );
 +
 +        // property is being used in a separate thread; queue a message to set the property
 +        SceneGraph::AnimatablePropertyMessage<float>::Send( eventThreadServices, sceneObject, property, &SceneGraph::AnimatableProperty<float>::Bake, value.Get<float>() );
 +
 +        break;
 +      }
 +
 +      case Property::INTEGER:
 +      {
 +        const SceneGraph::AnimatableProperty<int>* property = dynamic_cast< const SceneGraph::AnimatableProperty<int>* >( entry.GetSceneGraphProperty() );
 +        DALI_ASSERT_DEBUG( NULL != property );
 +
 +        // property is being used in a separate thread; queue a message to set the property
 +        SceneGraph::AnimatablePropertyMessage<int>::Send( eventThreadServices, sceneObject, property, &SceneGraph::AnimatableProperty<int>::Bake, value.Get<int>() );
 +
 +        break;
 +      }
 +
 +      case Property::VECTOR2:
 +      {
 +        const SceneGraph::AnimatableProperty<Vector2>* property = dynamic_cast< const SceneGraph::AnimatableProperty<Vector2>* >( entry.GetSceneGraphProperty() );
 +        DALI_ASSERT_DEBUG( NULL != property );
 +
 +        // property is being used in a separate thread; queue a message to set the property
 +        SceneGraph::AnimatablePropertyMessage<Vector2>::Send( eventThreadServices, sceneObject, property, &SceneGraph::AnimatableProperty<Vector2>::Bake, value.Get<Vector2>() );
 +
 +        break;
 +      }
 +
 +      case Property::VECTOR3:
 +      {
 +        const SceneGraph::AnimatableProperty<Vector3>* property = dynamic_cast< const SceneGraph::AnimatableProperty<Vector3>* >( entry.GetSceneGraphProperty() );
 +        DALI_ASSERT_DEBUG( NULL != property );
 +
 +        // property is being used in a separate thread; queue a message to set the property
 +        SceneGraph::AnimatablePropertyMessage<Vector3>::Send( eventThreadServices, sceneObject, property, &SceneGraph::AnimatableProperty<Vector3>::Bake, value.Get<Vector3>() );
 +
 +        break;
 +      }
 +
 +      case Property::VECTOR4:
 +      {
 +        const SceneGraph::AnimatableProperty<Vector4>* property = dynamic_cast< const SceneGraph::AnimatableProperty<Vector4>* >( entry.GetSceneGraphProperty() );
 +        DALI_ASSERT_DEBUG( NULL != property );
 +
 +        // property is being used in a separate thread; queue a message to set the property
 +        SceneGraph::AnimatablePropertyMessage<Vector4>::Send( eventThreadServices, sceneObject, property, &SceneGraph::AnimatableProperty<Vector4>::Bake, value.Get<Vector4>() );
 +
 +        break;
 +      }
 +
 +      case Property::ROTATION:
 +      {
 +        const SceneGraph::AnimatableProperty<Quaternion>* property = dynamic_cast< const SceneGraph::AnimatableProperty<Quaternion>* >( entry.GetSceneGraphProperty() );
 +        DALI_ASSERT_DEBUG( NULL != property );
 +
 +        // property is being used in a separate thread; queue a message to set the property
 +        SceneGraph::AnimatablePropertyMessage<Quaternion>::Send( eventThreadServices, sceneObject, property,&SceneGraph::AnimatableProperty<Quaternion>::Bake,  value.Get<Quaternion>() );
 +
 +        break;
 +      }
 +
 +      case Property::MATRIX:
 +      {
 +        const SceneGraph::AnimatableProperty<Matrix>* property = dynamic_cast< const SceneGraph::AnimatableProperty<Matrix>* >( entry.GetSceneGraphProperty() );
 +        DALI_ASSERT_DEBUG( NULL != property );
 +
 +        // property is being used in a separate thread; queue a message to set the property
 +        SceneGraph::AnimatablePropertyMessage<Matrix>::Send( eventThreadServices, sceneObject, property,&SceneGraph::AnimatableProperty<Matrix>::Bake,  value.Get<Matrix>() );
 +
 +        break;
 +      }
 +
 +      case Property::MATRIX3:
 +      {
 +        const SceneGraph::AnimatableProperty<Matrix3>* property = dynamic_cast< const SceneGraph::AnimatableProperty<Matrix3>* >( entry.GetSceneGraphProperty() );
 +        DALI_ASSERT_DEBUG( NULL != property );
 +
 +        // property is being used in a separate thread; queue a message to set the property
 +        SceneGraph::AnimatablePropertyMessage<Matrix3>::Send( eventThreadServices, sceneObject, property, &SceneGraph::AnimatableProperty<Matrix3>::Bake,  value.Get<Matrix3>() );
 +
 +        break;
 +      }
 +
 +      default:
 +      {
 +        DALI_ASSERT_ALWAYS( false && "Property type enumeration out of bounds" ); // should not come here
 +        break;
 +      }
 +    }
 +  }
 +
 +  int GetPropertyComponentIndex( Property::Index index ) const
 +  {
 +    // TODO: MESH_REWORK
 +    DALI_ASSERT_ALWAYS( false && "TODO: MESH_REWORK" );
 +    return 0;
 +  }
 +};
 +
 +
 +
 +} // namespace Internal
 +
 +} // namespace Dali
 +
 +#endif // DALI_INTERNAL_OBJECT_IMPL_HELPER_H
@@@ -185,7 -178,7 +185,6 @@@ internal_dynamics_src_files = 
    $(internal_src_dir)/event/dynamics/dynamics-cube-shape-impl.cpp \
    $(internal_src_dir)/event/dynamics/dynamics-cylinder-shape-impl.cpp \
    $(internal_src_dir)/event/dynamics/dynamics-joint-impl.cpp \
-   $(internal_src_dir)/event/dynamics/dynamics-notifier.cpp \
 -  $(internal_src_dir)/event/dynamics/dynamics-mesh-shape-impl.cpp \
    $(internal_src_dir)/event/dynamics/dynamics-shape-impl.cpp \
    $(internal_src_dir)/event/dynamics/dynamics-sphere-shape-impl.cpp \
    $(internal_src_dir)/event/dynamics/dynamics-world-config-impl.cpp \
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge