Revert "[Tizen] Implement partial update"
[platform/core/uifw/dali-core.git] / dali / internal / update / common / property-condition-step-functions.cpp
index 813247d..e305d42 100644 (file)
@@ -1,18 +1,19 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.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://floralicense.org/license/
-//
-// 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.
-//
+/*
+ * Copyright (c) 2018 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.
+ *
+ */
 
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/math/vector2.h>
@@ -33,9 +34,9 @@ namespace SceneGraph
 namespace
 {
 
-const int ARGINDEX_REF_VALUE = 0;
-const int ARGINDEX_STEP_SIZE = 1;
-const int ARGINDEX_CURRENT_STEP = 2;
+const int32_t ARGINDEX_REF_VALUE = 0;
+const int32_t ARGINDEX_STEP_SIZE = 1;
+const int32_t ARGINDEX_CURRENT_STEP = 2;
 
 } // namespace
 
@@ -45,6 +46,11 @@ ConditionFunction Step::GetFunction(Property::Type valueType)
 
   switch(valueType)
   {
+    case Property::INTEGER:
+    {
+      function = EvalInteger;
+      break;
+    }
     case Property::FLOAT:
     {
       function = EvalFloat;
@@ -79,10 +85,10 @@ bool Step::Evaluate( const float propertyValue, PropertyNotification::RawArgumen
 {
   const float refValue = arg[ARGINDEX_REF_VALUE];
   const float step = arg[ARGINDEX_STEP_SIZE];
-  const int currentStep = static_cast<int>(arg[ARGINDEX_CURRENT_STEP]);
+  const int32_t currentStep = static_cast<int32_t>(arg[ARGINDEX_CURRENT_STEP]);
   const float distance = (propertyValue - refValue);
   // step is actual 1.0f / step so can multiply instead of dividing
-  const int newStep = static_cast<int>(floorf(distance * step));
+  const int32_t newStep = static_cast<int32_t>(floorf(distance * step));
 
   if( newStep != currentStep )
   {
@@ -93,12 +99,18 @@ bool Step::Evaluate( const float propertyValue, PropertyNotification::RawArgumen
   return false;
 }
 
+
+bool Step::EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
+{
+  const float propertyValue = static_cast<float>( value.GetInteger() );
+  return Evaluate( propertyValue, arg );
+}
+
 bool Step::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
 {
   const float propertyValue = value.GetFloat();
   return Evaluate( propertyValue, arg );
 }
-
 bool Step::EvalVector2( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
 {
   const float propertyValue = value.GetVector2().LengthSquared();