[dali_1.3.46] Merge branch 'devel/master' 77/191577/1
authorAnton Obzhirov <a.obzhirov@samsung.com>
Thu, 18 Oct 2018 13:27:12 +0000 (14:27 +0100)
committerAnton Obzhirov <a.obzhirov@samsung.com>
Thu, 18 Oct 2018 13:27:12 +0000 (14:27 +0100)
Change-Id: I25ed9e36e022aefe48377c83885c46b180a34fd8

112 files changed:
automated-tests/patch-coverage.pl
automated-tests/src/dali/utc-Dali-Actor.cpp
automated-tests/src/dali/utc-Dali-FrameCallbackInterface.cpp
dali/devel-api/CMakeLists.txt
dali/devel-api/common/bitwise-enum.h [new file with mode: 0644]
dali/devel-api/common/stage-devel.h
dali/devel-api/file.list
dali/devel-api/update/frame-callback-interface.cpp [new file with mode: 0644]
dali/devel-api/update/frame-callback-interface.h
dali/devel-api/update/update-proxy.cpp
dali/devel-api/update/update-proxy.h
dali/internal/event/animation/animation-impl.cpp
dali/internal/update/manager/frame-callback-processor.cpp
dali/internal/update/manager/frame-callback-processor.h
dali/internal/update/manager/update-algorithms.cpp
dali/internal/update/manager/update-algorithms.h
dali/internal/update/manager/update-manager.cpp
dali/internal/update/manager/update-proxy-impl.cpp
dali/internal/update/manager/update-proxy-impl.h
dali/internal/update/nodes/node-declarations.h
dali/internal/update/nodes/node.cpp
dali/internal/update/nodes/node.h
dali/internal/update/render-tasks/scene-graph-camera.cpp
dali/public-api/actors/actor.cpp
dali/public-api/actors/actor.h
dali/public-api/actors/custom-actor-impl.h
dali/public-api/actors/layer.cpp
dali/public-api/actors/layer.h
dali/public-api/animation/alpha-function.cpp
dali/public-api/animation/animation.cpp
dali/public-api/animation/animation.h
dali/public-api/animation/constraint.cpp
dali/public-api/animation/constraint.h
dali/public-api/common/dali-common.cpp
dali/public-api/common/dali-vector.cpp
dali/public-api/common/dali-vector.h
dali/public-api/common/stage.cpp
dali/public-api/common/stage.h
dali/public-api/dali-core-version.cpp
dali/public-api/dali-core-version.h
dali/public-api/events/gesture-detector.h
dali/public-api/events/gesture.h
dali/public-api/events/hover-event.cpp
dali/public-api/events/hover-event.h
dali/public-api/events/key-event.cpp
dali/public-api/events/key-event.h
dali/public-api/events/long-press-gesture-detector.cpp
dali/public-api/events/long-press-gesture-detector.h
dali/public-api/events/long-press-gesture.h
dali/public-api/events/pan-gesture-detector.cpp
dali/public-api/events/pan-gesture-detector.h
dali/public-api/events/pan-gesture.h
dali/public-api/events/tap-gesture-detector.cpp
dali/public-api/events/tap-gesture-detector.h
dali/public-api/events/tap-gesture.h
dali/public-api/events/touch-event.cpp
dali/public-api/events/touch-event.h
dali/public-api/events/touch-point.cpp
dali/public-api/events/touch-point.h
dali/public-api/events/wheel-event.cpp
dali/public-api/events/wheel-event.h
dali/public-api/images/buffer-image.cpp
dali/public-api/images/buffer-image.h
dali/public-api/images/encoded-buffer-image.h
dali/public-api/images/frame-buffer-image.cpp
dali/public-api/images/frame-buffer-image.h
dali/public-api/images/image.cpp
dali/public-api/images/image.h
dali/public-api/images/native-image-interface.h
dali/public-api/images/pixel-data.cpp
dali/public-api/images/pixel-data.h
dali/public-api/images/pixel.cpp
dali/public-api/images/pixel.h
dali/public-api/math/math-utils.h
dali/public-api/math/matrix.cpp
dali/public-api/math/matrix3.cpp
dali/public-api/math/quaternion.cpp
dali/public-api/math/random.h
dali/public-api/math/vector2.h
dali/public-api/math/vector3.h
dali/public-api/math/vector4.h
dali/public-api/math/viewport.h
dali/public-api/object/any.h
dali/public-api/object/handle.cpp
dali/public-api/object/handle.h
dali/public-api/object/property-array.cpp
dali/public-api/object/property-map.cpp
dali/public-api/object/property-types.cpp
dali/public-api/object/property-value.cpp
dali/public-api/object/property-value.h
dali/public-api/object/property.cpp
dali/public-api/object/property.h
dali/public-api/object/ref-object.cpp
dali/public-api/object/ref-object.h
dali/public-api/object/type-registry.cpp
dali/public-api/object/type-registry.h
dali/public-api/render-tasks/render-task-list.cpp
dali/public-api/render-tasks/render-task-list.h
dali/public-api/render-tasks/render-task.cpp
dali/public-api/render-tasks/render-task.h
dali/public-api/rendering/frame-buffer.cpp
dali/public-api/rendering/frame-buffer.h
dali/public-api/rendering/geometry.cpp
dali/public-api/rendering/geometry.h
dali/public-api/rendering/property-buffer.cpp
dali/public-api/rendering/property-buffer.h
dali/public-api/rendering/texture-set.cpp
dali/public-api/rendering/texture.cpp
dali/public-api/rendering/texture.h
dali/public-api/signals/base-signal.cpp
dali/public-api/signals/base-signal.h
packaging/dali.spec

index c19953b..5e5e164 100755 (executable)
@@ -19,8 +19,10 @@ use strict;
 use Git;
 use Getopt::Long;
 use Error qw(:try);
+use HTML::Element;
 use Pod::Usage;
 use File::Basename;
+#use Data::Dumper;
 use File::stat;
 use Scalar::Util qw /looks_like_number/;
 use Cwd qw /getcwd/;
@@ -488,21 +490,17 @@ sub patch_html_output
 {
     my $filesref = shift;
 
-    open( my $filehandle, ">", $opt_output ) || die "Can't open $opt_output for writing:$!\n";
+    my $html = HTML::Element->new('html');
+    my $head = HTML::Element->new('head');
+    my $title = HTML::Element->new('title');
+    $title->push_content("Patch Coverage");
+    $head->push_content($title, "\n");
+    $html->push_content($head, "\n");
 
-    my $OUTPUT_FH = select;
-    select $filehandle;
-    print <<EOH;
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
-"http://www.w3.org/TR/REC-html40/loose.dtd">
-<html>
-<head>
-<title>Patch Coverage</title>
-</head>
-<body bgcolor="white">
-EOH
+    my $body = HTML::Element->new('body');
+    $body->attr('bgcolor', "white");
 
-    foreach my $file (keys(%$filesref))
+    foreach my $file (sort(keys(%$filesref)))
     {
         my ($name, $path, $suffix) = fileparse($file, qr{\.[^.]*$});
         next if($path !~ /^dali/);
@@ -510,33 +508,47 @@ EOH
         my $patchref = $filesref->{$file}->{"patch"};
         my $b_lines_ref = $filesref->{$file}->{"b_lines"};
         my $coverage_ref = $filesref->{$file}->{"coverage"};
-        print "<h2>$file</h2>\n";
 
+        my $header = HTML::Element->new('h2');
+        $header->push_content($file);
+        $body->push_content($header);
+        $body->push_content("\n");
         if($coverage_ref)
         {
             if( $coverage_ref->{"covered_lines"} > 0
                 ||
                 $coverage_ref->{"uncovered_lines"} > 0 )
             {
-                print "<p style=\"color:green;\">Covered: " .
-                    $coverage_ref->{"covered_lines"} . "<p>" .
-                    "<p style=\"color:red;\">Uncovered: " .
-                    $coverage_ref->{"uncovered_lines"} . "</span></p>";
+                my $para = HTML::Element->new('p');
+                my $covered = HTML::Element->new('span');
+                $covered->attr('style', "color:green;");
+                $covered->push_content("Covered: " . $coverage_ref->{"covered_lines"} );
+                $para->push_content($covered);
+
+                my $para2 = HTML::Element->new('p');
+                my $uncovered = HTML::Element->new('span');
+                $uncovered->attr('style', "color:red;");
+                $uncovered->push_content("Uncovered: " . $coverage_ref->{"uncovered_lines"} );
+                $para2->push_content($uncovered);
+                $body->push_content($para, $para2);
+            }
+            else
+            {
+                #print "coverage ref exists for $file:\n" . Data::Dumper::Dumper($coverage_ref) . "\n";
             }
         }
         else
         {
-            print "<p>";
-            my $span=0;
+            my $para = HTML::Element->new('p');
+            my $span = HTML::Element->new('span');
             if($suffix eq ".cpp" || $suffix eq ".c" || $suffix eq ".h")
             {
-                print "<span style=\"color:red;\">";
-                $span=1;
+                $span->attr('style', "color:red;");
             }
-            print "No coverage found";
-            print "</span>" if $span;
+            $span->push_content("No coverage found");
+            $para->push_content($span);
+            $body->push_content($para);
         }
-        print "</p>";
 
         for my $patch (@$patchref)
         {
@@ -545,53 +557,71 @@ EOH
             {
                 $hunkstr .= " - " . ($patch->[0]+$patch->[1]-1);
             }
-            print "<p style=\"font-weight:bold;\">" . $hunkstr . "</p>";
 
-            print "<pre>";
+            my $para = HTML::Element->new('p');
+            my $span = HTML::Element->new('span');
+            $span->attr('style', "font-weight:bold;");
+            $span->push_content($hunkstr);
+            $para->push_content($span);
+            $body->push_content($para);
+
+            my $codeHunk = HTML::Element->new('pre');
             for(my $i = 0; $i < $patch->[1]; $i++ )
             {
                 my $line = $i + $patch->[0];
                 my $num_line_digits=log($line)/log(10);
                 for $i (0..(6-$num_line_digits-1))
                 {
-                    print " ";
+                    $codeHunk->push_content(" ");
                 }
-                print "$line  ";
 
+                $codeHunk->push_content("$line  ");
+
+                my $srcLine = HTML::Element->new('span');
                 if($coverage_ref)
                 {
                     my $color;
+
                     if($coverage_ref->{"covered"}->{$line})
                     {
-                        print("<span style=\"color:green;\">");
+                        $srcLine->attr('style', "color:green;");
                     }
                     elsif($coverage_ref->{"uncovered"}->{$line})
                     {
-                        print("<span style=\"color:red;font-weight:bold;\">");
+                        $srcLine->attr('style', "color:red;font-weight:bold;");
                     }
                     else
                     {
-                        #print("<span style=\"color:black;font-weight:normal;\">");
+                        $srcLine->attr('style', "color:black;font-weight:normal;");
                     }
                     my $src=$coverage_ref->{"src"}->{$line};
                     chomp($src);
-                    #print $color, "$src\n", RESET;
-                    print "$src</span>\n";
+                    $srcLine->push_content($src);
                 }
                 else
                 {
                     # We don't have coverage data, so print it from the patch instead.
                     my $src = $b_lines_ref->{$line};
-                    print "$src\n";
+                    $srcLine->attr('style', "color:black;font-weight:normal;");
+                    $srcLine->push_content($src);
                 }
+                $codeHunk->push_content($srcLine, "\n");
             }
-            print "<\pre>\n";
+            $body->push_content($codeHunk, "\n");
         }
     }
+    $body->push_content(HTML::Element->new('hr'));
+    $html->push_content($body, "\n");
+
+    open( my $filehandle, ">", $opt_output ) || die "Can't open $opt_output for writing:$!\n";
 
-    print $filehandle "<hr>\n</body>\n</html>\n";
+    print $filehandle <<EOH;
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
+"http://www.w3.org/TR/REC-html40/loose.dtd">
+EOH
+;
+    print $filehandle $html->as_HTML();
     close $filehandle;
-    select $OUTPUT_FH;
 }
 
 
index b0a5138..2fede1b 100644 (file)
@@ -1660,6 +1660,41 @@ int UtcDaliActorSetInheritPosition(void)
   END_TEST;
 }
 
+int UtcDaliActorInheritOpacity(void)
+{
+  tet_infoline("Testing Actor::Inherit Opacity");
+  TestApplication application;
+
+  Actor parent = Actor::New();
+  Actor child = Actor::New();
+  parent.Add( child );
+  Stage::GetCurrent().Add( parent );
+
+  DALI_TEST_EQUALS( parent.GetProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 1.0f, 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( child.GetProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 1.0f, 0.0001f, TEST_LOCATION );
+
+  // flush the queue and render once
+  application.SendNotification();
+  application.Render();
+
+  parent.SetOpacity( 0.1f );
+
+  DALI_TEST_EQUALS( parent.GetProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 0.1f, 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( child.GetProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 1.0f, 0.0001f, TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( parent.GetProperty( Actor::Property::WORLD_COLOR ).Get<Vector4>(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( parent.GetCurrentProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 0.1f, 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( parent.GetCurrentProperty( Actor::Property::WORLD_COLOR ).Get<Vector4>(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( child.GetProperty( Actor::Property::WORLD_COLOR ).Get<Vector4>(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( child.GetCurrentProperty( Actor::Property::WORLD_COLOR ).Get<Vector4>(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( child.GetCurrentProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 1.f, 0.0001f, TEST_LOCATION );
+
+  END_TEST;
+}
+
 // SetOrientation(float angleRadians, Vector3 axis)
 int UtcDaliActorSetOrientation01(void)
 {
index 0a3afb2..858e20b 100644 (file)
@@ -45,17 +45,19 @@ class FrameCallbackBasic : public FrameCallbackInterface
 {
 public:
 
-  FrameCallbackBasic()
-  : mCalled( false )
-  {
-  }
+  FrameCallbackBasic() = default;
 
   virtual void Update( Dali::UpdateProxy& updateProxy, float elapsedSeconds )
   {
     mCalled = true;
   }
 
-  bool mCalled;
+  virtual void Reset()
+  {
+    mCalled = false;
+  }
+
+  bool mCalled{ false };
 };
 
 } // anon namespace
@@ -69,27 +71,24 @@ public:
   {
   }
 
-  virtual void Update( Dali::UpdateProxy& updateProxy, float elapsedSeconds )
+  virtual void Update( Dali::UpdateProxy& updateProxy, float elapsedSeconds ) override
   {
     FrameCallbackBasic::Update( updateProxy, elapsedSeconds );
-    updateProxy.GetWorldMatrixAndSize( mActorId, mWorldMatrix, mSize );
-    mWorldMatrixGetWorldMatrixCall = updateProxy.GetWorldMatrix( mActorId );
-    mSizeGetSizeCall = updateProxy.GetSize( mActorId );
-    mPositionGetPositionCall = updateProxy.GetPosition( mActorId );
+    updateProxy.GetSize( mActorId, mSizeGetSizeCall );
+    updateProxy.GetPosition( mActorId, mPositionGetPositionCall );
     updateProxy.GetPositionAndSize( mActorId, mPositionGetPositionAndSizeCall, mSizeGetPositionAndSizeCall );
-    mWorldColor = updateProxy.GetWorldColor( mActorId );
+    updateProxy.GetColor( mActorId, mColor );
+    updateProxy.GetScale( mActorId, mScale );
   }
 
   const unsigned int mActorId;
 
-  Matrix mWorldMatrix;
-  Matrix mWorldMatrixGetWorldMatrixCall;
-  Vector3 mSize;
   Vector3 mSizeGetSizeCall;
   Vector3 mPositionGetPositionCall;
   Vector3 mPositionGetPositionAndSizeCall;
   Vector3 mSizeGetPositionAndSizeCall;
-  Vector4 mWorldColor;
+  Vector4 mColor;
+  Vector3 mScale;
 };
 
 class FrameCallbackSetter : public FrameCallbackBasic
@@ -98,40 +97,84 @@ public:
 
   FrameCallbackSetter(
       unsigned int actorId,
-      const Matrix& matrixToSet,
       const Vector3& sizeToSet,
       const Vector3& positionToSet,
-      const Vector4& colorToSet )
+      const Vector4& colorToSet,
+      const Vector3& scaleToSet )
   : mActorId( actorId ),
-    mMatrixToSet( matrixToSet ),
     mSizeToSet( sizeToSet ),
     mPositionToSet( positionToSet ),
-    mColorToSet( colorToSet )
+    mColorToSet( colorToSet ),
+    mScaleToSet( scaleToSet )
   {
   }
 
-  virtual void Update( Dali::UpdateProxy& updateProxy, float elapsedSeconds )
+  virtual void Update( Dali::UpdateProxy& updateProxy, float elapsedSeconds ) override
   {
     FrameCallbackBasic::Update( updateProxy, elapsedSeconds );
-    updateProxy.SetWorldMatrix( mActorId, mMatrixToSet );
     updateProxy.SetSize( mActorId, mSizeToSet );
-    updateProxy.GetWorldMatrixAndSize( mActorId, mWorldMatrixAfterSetting, mSizeAfterSetting );
     updateProxy.SetPosition( mActorId, mPositionToSet );
-    mPositionAfterSetting = updateProxy.GetPosition( mActorId );
-    updateProxy.SetWorldColor( mActorId, mColorToSet );
-    mColorAfterSetting = updateProxy.GetWorldColor( mActorId );
+    updateProxy.SetColor( mActorId, mColorToSet );
+    updateProxy.SetScale( mActorId, mScaleToSet );
+    updateProxy.GetSize( mActorId, mSizeAfterSetting );
+    updateProxy.GetPosition( mActorId, mPositionAfterSetting );
+    updateProxy.GetColor( mActorId, mColorAfterSetting );
+    updateProxy.GetScale( mActorId, mScaleAfterSetting );
+  }
+
+  const unsigned int mActorId;
+  const Vector3& mSizeToSet;
+  const Vector3& mPositionToSet;
+  const Vector4& mColorToSet;
+  const Vector3& mScaleToSet;
+
+  Vector3 mSizeAfterSetting;
+  Vector3 mPositionAfterSetting;
+  Vector4 mColorAfterSetting;
+  Vector3 mScaleAfterSetting;
+};
+
+class FrameCallbackBaker : public FrameCallbackBasic
+{
+public:
+
+  FrameCallbackBaker(
+      unsigned int actorId,
+      const Vector3& sizeToSet,
+      const Vector3& positionToSet,
+      const Vector4& colorToSet,
+      const Vector3& scaleToSet )
+  : mActorId( actorId ),
+    mSizeToSet( sizeToSet ),
+    mPositionToSet( positionToSet ),
+    mColorToSet( colorToSet ),
+    mScaleToSet( scaleToSet )
+  {
+  }
+
+  virtual void Update( Dali::UpdateProxy& updateProxy, float elapsedSeconds ) override
+  {
+    FrameCallbackBasic::Update( updateProxy, elapsedSeconds );
+    updateProxy.BakeSize( mActorId, mSizeToSet );
+    updateProxy.BakePosition( mActorId, mPositionToSet );
+    updateProxy.BakeColor( mActorId, mColorToSet );
+    updateProxy.BakeScale( mActorId, mScaleToSet );
+    updateProxy.GetSize( mActorId, mSizeAfterSetting );
+    updateProxy.GetPosition( mActorId, mPositionAfterSetting );
+    updateProxy.GetColor( mActorId, mColorAfterSetting );
+    updateProxy.GetScale( mActorId, mScaleAfterSetting );
   }
 
   const unsigned int mActorId;
-  const Matrix& mMatrixToSet;
   const Vector3& mSizeToSet;
   const Vector3& mPositionToSet;
   const Vector4& mColorToSet;
+  const Vector3& mScaleToSet;
 
-  Matrix mWorldMatrixAfterSetting;
   Vector3 mSizeAfterSetting;
   Vector3 mPositionAfterSetting;
   Vector4 mColorAfterSetting;
+  Vector3 mScaleAfterSetting;
 };
 
 class FrameCallbackMultipleActors : public FrameCallbackBasic
@@ -142,29 +185,97 @@ public:
   {
   }
 
-  virtual void Update( Dali::UpdateProxy& updateProxy, float elapsedSeconds )
+  virtual void Update( Dali::UpdateProxy& updateProxy, float elapsedSeconds ) override
   {
     FrameCallbackBasic::Update( updateProxy, elapsedSeconds );
     for( auto&& i : mActorIds )
     {
-      Matrix matrix( false );
+      Vector3 position;
       Vector3 size;
-      updateProxy.GetWorldMatrixAndSize( i, matrix, size );
-      mWorldMatrices[ i ] = matrix;
+      updateProxy.GetPositionAndSize( i, position, size );
+      mPositions[ i ] = position;
       mSizes[ i ] = size;
     }
   }
 
   Vector< unsigned int > mActorIds;
 
-  std::map< unsigned int, Matrix > mWorldMatrices;
+  std::map< unsigned int, Vector3 > mPositions;
   std::map< unsigned int, Vector3 > mSizes;
 };
 
+class FrameCallbackActorIdCheck : public FrameCallbackBasic
+{
+public:
+
+  FrameCallbackActorIdCheck( unsigned int actorId )
+  : mActorId( actorId )
+  {
+  }
+
+  virtual void Update( Dali::UpdateProxy& updateProxy, float elapsedSeconds ) override
+  {
+    FrameCallbackBasic::Update( updateProxy, elapsedSeconds );
+    Vector3 vec3;
+    Vector4 vec4;
+
+    mGetSizeCallSuccess            = updateProxy.GetSize( mActorId, vec3 );
+    mGetPositionCallSuccess        = updateProxy.GetPosition( mActorId, vec3 );
+    mGetColorCallSuccess           = updateProxy.GetColor( mActorId, vec4 );
+    mGetScaleCallSuccess           = updateProxy.GetScale( mActorId, vec3 );
+    mGetPositionAndSizeCallSuccess = updateProxy.GetPositionAndSize( mActorId, vec3, vec3 );
+    mSetSizeCallSuccess            = updateProxy.SetSize( mActorId, vec3 );
+    mSetPositionCallSuccess        = updateProxy.SetPosition( mActorId, vec3 );
+    mSetColorCallSuccess           = updateProxy.SetColor( mActorId, vec4 );
+    mSetScaleCallSuccess           = updateProxy.SetScale( mActorId, vec3 );
+    mBakeSizeCallSuccess           = updateProxy.BakeSize( mActorId, vec3 );
+    mBakePositionCallSuccess       = updateProxy.BakePosition( mActorId, vec3 );
+    mBakeColorCallSuccess          = updateProxy.BakeColor( mActorId, vec4 );
+    mBakeScaleCallSuccess          = updateProxy.BakeScale( mActorId, vec3 );
+  }
+
+  virtual void Reset() override
+  {
+    // Up-call
+    FrameCallbackBasic::Reset();
+
+    mGetSizeCallSuccess = false;
+    mGetPositionCallSuccess = false;
+    mGetColorCallSuccess = false;
+    mGetScaleCallSuccess = false;
+    mGetPositionAndSizeCallSuccess = false;
+    mSetSizeCallSuccess = false;
+    mSetPositionCallSuccess = false;
+    mSetColorCallSuccess = false;
+    mSetScaleCallSuccess = false;
+    mBakeSizeCallSuccess = false;
+    mBakePositionCallSuccess = false;
+    mBakeColorCallSuccess = false;
+    mBakeScaleCallSuccess = false;
+  }
+
+  const uint32_t mActorId;
+  bool mGetSizeCallSuccess{ false };
+  bool mGetPositionCallSuccess{ false };
+  bool mGetColorCallSuccess{ false };
+  bool mGetScaleCallSuccess{ false };
+  bool mGetPositionAndSizeCallSuccess{ false };
+  bool mSetSizeCallSuccess{ false };
+  bool mSetPositionCallSuccess{ false };
+  bool mSetColorCallSuccess{ false };
+  bool mSetScaleCallSuccess{ false };
+  bool mBakeSizeCallSuccess{ false };
+  bool mBakePositionCallSuccess{ false };
+  bool mBakeColorCallSuccess{ false };
+  bool mBakeScaleCallSuccess{ false };
+};
+
 ///////////////////////////////////////////////////////////////////////////////
 
 int UtcDaliFrameCallbackCheckInstallationAndRemoval(void)
 {
+  // Basic test to check that the frame-callback can be installed and removed correctly
+
   TestApplication application;
 
   FrameCallbackBasic frameCallback;
@@ -191,10 +302,13 @@ int UtcDaliFrameCallbackCheckInstallationAndRemoval(void)
 
 int UtcDaliFrameCallbackGetters(void)
 {
+  // Test to see that the Getters all return the expected values
+
   TestApplication application;
   Vector2 actorSize( 200, 300 );
   Vector4 color( 0.5f, 0.6f, 0.7f, 0.8f );
   Vector3 position( 10.0f, 20.0f, 30.0f );
+  Vector3 scale( 2.0f, 4.0f, 6.0f );
 
   Actor actor = Actor::New();
   actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
@@ -202,10 +316,10 @@ int UtcDaliFrameCallbackGetters(void)
   actor.SetSize( actorSize );
   actor.SetColor( color );
   actor.SetPosition( position );
+  actor.SetScale( scale );
 
   Stage stage = Stage::GetCurrent();
   stage.Add( actor );
-  Vector2 stageSize = stage.GetSize();
 
   FrameCallbackOneActor frameCallback( actor.GetId() );
   DevelStage::AddFrameCallback( stage, frameCallback, stage.GetRootLayer() );
@@ -213,29 +327,21 @@ int UtcDaliFrameCallbackGetters(void)
   application.SendNotification();
   application.Render();
 
-  Vector3 expectedPosition( -stageSize.width * 0.5f + actorSize.width * 0.5f + position.x,
-                            -stageSize.height * 0.5f + actorSize.height * 0.5f + position.y,
-                            0.0f + position.z );
-
-  Matrix expectedWorldMatrix( false );
-  expectedWorldMatrix.SetIdentity();
-  expectedWorldMatrix.SetTranslation( expectedPosition );
-
   DALI_TEST_EQUALS( frameCallback.mCalled, true, TEST_LOCATION );
-  DALI_TEST_EQUALS( frameCallback.mWorldMatrix, expectedWorldMatrix, TEST_LOCATION );
-  DALI_TEST_EQUALS( frameCallback.mWorldMatrixGetWorldMatrixCall, expectedWorldMatrix, TEST_LOCATION );
-  DALI_TEST_EQUALS( frameCallback.mSize, Vector3( actorSize.width, actorSize.height, 0.0f ), TEST_LOCATION );
   DALI_TEST_EQUALS( frameCallback.mSizeGetSizeCall, Vector3( actorSize.width, actorSize.height, 0.0f ), TEST_LOCATION );
-  DALI_TEST_EQUALS( frameCallback.mPositionGetPositionCall, expectedPosition, TEST_LOCATION );
-  DALI_TEST_EQUALS( frameCallback.mPositionGetPositionAndSizeCall, expectedPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mPositionGetPositionCall, position, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mPositionGetPositionAndSizeCall, position, TEST_LOCATION );
   DALI_TEST_EQUALS( frameCallback.mSizeGetPositionAndSizeCall, Vector3( actorSize.width, actorSize.height, 0.0f ), TEST_LOCATION );
-  DALI_TEST_EQUALS( frameCallback.mWorldColor, color, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mColor, color, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mScale, scale, TEST_LOCATION );
 
   END_TEST;
 }
 
 int UtcDaliFrameCallbackSetters(void)
 {
+  // Test to see that the setters set the values appropriately
+
   TestApplication application;
   Vector2 actorSize( 200, 300 );
 
@@ -246,39 +352,90 @@ int UtcDaliFrameCallbackSetters(void)
 
   Stage stage = Stage::GetCurrent();
   stage.Add( actor );
-  Vector2 stageSize = stage.GetSize();
 
-  Matrix matrixToSet( Matrix::IDENTITY );
-  matrixToSet.SetTranslation( Vector3( 100.0f, 500.0f, 50.0f ) );
   Vector3 sizeToSet( 1.0f, 2.0f, 3.0f );
   Vector3 positionToSet( 10.0f, 20.0f, 30.0f );
   Vector4 colorToSet( Color::MAGENTA );
+  Vector3 scaleToSet( 1.0f, 3.0f, 5.0f );
 
-  FrameCallbackSetter frameCallback( actor.GetId(), matrixToSet, sizeToSet, positionToSet, colorToSet );
+  FrameCallbackSetter frameCallback( actor.GetId(), sizeToSet, positionToSet, colorToSet, scaleToSet );
   DevelStage::AddFrameCallback( stage, frameCallback, stage.GetRootLayer() );
 
   application.SendNotification();
   application.Render();
 
-  Matrix expectedWorldMatrix( false );
-  expectedWorldMatrix.SetIdentity();
-  expectedWorldMatrix.SetTranslation( Vector3( -stageSize.width * 0.5f + actorSize.width * 0.5f,
-                                               -stageSize.height * 0.5f + actorSize.height * 0.5f,
-                                               0.0f ) );
+  DALI_TEST_EQUALS( frameCallback.mCalled, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSizeAfterSetting, sizeToSet, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mPositionAfterSetting, positionToSet, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mColorAfterSetting, colorToSet, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mScaleAfterSetting, scaleToSet, TEST_LOCATION );
+
+  // Ensure the actual actor values haven't changed as we didn't bake the values after removing the callback
+  DevelStage::RemoveFrameCallback( stage, frameCallback );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::POSITION ).Get< Vector3 >(), Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(), Vector3( actorSize ), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::COLOR ).Get< Vector4 >(), Color::WHITE, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::SCALE ).Get< Vector3 >(), Vector3::ONE, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliFrameCallbackBake(void)
+{
+  // Test to see that the bake methods bake the values
+
+  TestApplication application;
+  Vector2 actorSize( 200, 300 );
+
+  Actor actor = Actor::New();
+  actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  actor.SetSize( actorSize );
+
+  Stage stage = Stage::GetCurrent();
+  stage.Add( actor );
+
+  Vector3 sizeToSet( 1.0f, 2.0f, 3.0f );
+  Vector3 positionToSet( 10.0f, 20.0f, 30.0f );
+  Vector4 colorToSet( Color::MAGENTA );
+  Vector3 scaleToSet( 1.0f, 3.0f, 5.0f );
+
+  FrameCallbackBaker frameCallback( actor.GetId(), sizeToSet, positionToSet, colorToSet, scaleToSet );
+  DevelStage::AddFrameCallback( stage, frameCallback, stage.GetRootLayer() );
+
+  application.SendNotification();
+  application.Render();
 
   DALI_TEST_EQUALS( frameCallback.mCalled, true, TEST_LOCATION );
-  DALI_TEST_CHECK( expectedWorldMatrix != matrixToSet );
-  DALI_TEST_EQUALS( frameCallback.mWorldMatrixAfterSetting, matrixToSet, TEST_LOCATION );
   DALI_TEST_EQUALS( frameCallback.mSizeAfterSetting, sizeToSet, TEST_LOCATION );
   DALI_TEST_EQUALS( frameCallback.mPositionAfterSetting, positionToSet, TEST_LOCATION );
   DALI_TEST_EQUALS( frameCallback.mColorAfterSetting, colorToSet, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mScaleAfterSetting, scaleToSet, TEST_LOCATION );
+
+  // Ensure the new values are saved after removing the callback
+  DevelStage::RemoveFrameCallback( stage, frameCallback );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::POSITION ).Get< Vector3 >(), positionToSet, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(), sizeToSet, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::COLOR ).Get< Vector4 >(), colorToSet, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::SCALE ).Get< Vector3 >(), scaleToSet, TEST_LOCATION );
 
   END_TEST;
 }
 
+
 int UtcDaliFrameCallbackMultipleActors(void)
 {
   /**
+   * Test to check that the frame callback behaves appropriately with multiple actors
+   *
    * Tree:
    *              root-layer
    *              /        \
@@ -292,7 +449,7 @@ int UtcDaliFrameCallbackMultipleActors(void)
    *      /                        \
    *   actorC                     actorH
    *
-   *  Screen positions:
+   *  Screen positions (with minor alterations due to local position):
    *  -----------------------
    *  |actorA|actorD        |
    *  |      actorB         |
@@ -309,7 +466,6 @@ int UtcDaliFrameCallbackMultipleActors(void)
 
   TestApplication application;
   Stage stage = Stage::GetCurrent();
-  const Vector2 stageSize = stage.GetSize();
 
   std::map< char, Vector3 > sizes;
   sizes['A'] = Vector3(  50.0f,  50.0f, 0.0f );
@@ -321,81 +477,70 @@ int UtcDaliFrameCallbackMultipleActors(void)
   sizes['G'] = Vector3( 350.0f, 350.0f, 0.0f );
   sizes['H'] = Vector3( 400.0f, 350.0f, 0.0f );
 
-  std::map< char, Matrix > matrices;
-  for( char i = 'A'; i <= 'H'; ++i )
-  {
-    matrices[i] = Matrix::IDENTITY;
-  }
-
-  matrices['A'].SetTranslation( Vector3( -stageSize.width * 0.5f + sizes['A'].width * 0.5f,
-                                         -stageSize.height * 0.5f + sizes['A'].height * 0.5f,
-                                         0.0f ) );
-  matrices['B'].SetTranslation( Vector3( matrices['A'].GetTranslation3() + sizes['A'] * 0.5f + sizes['B'] * 0.5f ) );
-  matrices['C'].SetTranslation( Vector3( matrices['B'].GetTranslation3().x,
-                                         matrices['B'].GetTranslation3().y + sizes['B'].height * 0.5f + sizes['C'].height * 0.5f,
-                                         0.0f ) );
-  matrices['D'].SetTranslation( Vector3( matrices['A'].GetTranslation3().x + sizes['A'].width * 0.5f + sizes['D'].width * 0.5f,
-                                         matrices['A'].GetTranslation3().y,
-                                         0.0f ) );
-  matrices['E'].SetTranslation( Vector3( -stageSize.width * 0.5f + sizes['E'].width * 0.5f,
-                                         stageSize.height * 0.5f - sizes['E'].height * 0.5f,
-                                         0.0f ) );
-  matrices['F'].SetTranslation( Vector3( matrices['E'].GetTranslation3().x,
-                                         matrices['E'].GetTranslation3().y - sizes['E'].height * 0.5f - sizes['F'].height * 0.5f,
-                                         0.0f ) );
-  matrices['G'].SetTranslation( Vector3( matrices['E'].GetTranslation3().x + sizes['E'].width * 0.5f + sizes['G'].width * 0.5f,
-                                         matrices['E'].GetTranslation3().y,
-                                         0.0f ) );
-  matrices['H'].SetTranslation( Vector3( matrices['G'].GetTranslation3().x + sizes['G'].width * 0.5f + sizes['H'].width * 0.5f,
-                                         matrices['G'].GetTranslation3().y - sizes['G'].height * 0.5f - sizes['H'].height * 0.5f,
-                                         0.0f ) );
+  std::map< char, Vector3 > positions;
+  positions['A'] = Vector3(  0.0f,  1.0f,  2.0f );
+  positions['B'] = Vector3(  2.0f,  3.0f,  4.0f );
+  positions['C'] = Vector3(  5.0f,  6.0f,  7.0f );
+  positions['D'] = Vector3(  8.0f,  9.0f, 10.0f );
+  positions['E'] = Vector3( 11.0f, 12.0f, 13.0f );
+  positions['F'] = Vector3( 14.0f, 15.0f, 16.0f );
+  positions['G'] = Vector3( 17.0f, 18.0f, 19.0f );
+  positions['H'] = Vector3( 20.0f, 21.0f, 22.0f );
 
   Actor actorA = Actor::New();
   actorA.SetParentOrigin( ParentOrigin::TOP_LEFT );
   actorA.SetAnchorPoint( AnchorPoint::TOP_LEFT );
   actorA.SetSize( sizes['A'] );
+  actorA.SetPosition( positions['A'] );
   stage.Add( actorA );
 
   Actor actorB = Actor::New();
   actorB.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT );
   actorB.SetAnchorPoint( AnchorPoint::TOP_LEFT );
   actorB.SetSize( sizes['B'] );
+  actorB.SetPosition( positions['B'] );
   actorA.Add( actorB );
 
   Actor actorC = Actor::New();
   actorC.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
   actorC.SetAnchorPoint( AnchorPoint::TOP_CENTER );
   actorC.SetSize( sizes['C'] );
+  actorC.SetPosition( positions['C'] );
   actorB.Add( actorC );
 
   Actor actorD = Actor::New();
   actorD.SetParentOrigin( ParentOrigin::CENTER_RIGHT );
   actorD.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
   actorD.SetSize( sizes['D'] );
+  actorD.SetPosition( positions['D'] );
   actorA.Add( actorD );
 
   Actor actorE = Actor::New();
   actorE.SetParentOrigin( ParentOrigin::BOTTOM_LEFT );
   actorE.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT );
   actorE.SetSize( sizes['E'] );
+  actorE.SetPosition( positions['E'] );
   stage.Add( actorE );
 
   Actor actorF = Actor::New();
   actorF.SetParentOrigin( ParentOrigin::TOP_CENTER );
   actorF.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
   actorF.SetSize( sizes['F'] );
+  actorF.SetPosition( positions['F'] );
   actorE.Add( actorF );
 
   Actor actorG = Actor::New();
   actorG.SetParentOrigin( ParentOrigin::CENTER_RIGHT );
   actorG.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
   actorG.SetSize( sizes['G'] );
+  actorG.SetPosition( positions['G'] );
   actorE.Add( actorG );
 
   Actor actorH = Actor::New();
   actorH.SetParentOrigin( ParentOrigin::TOP_RIGHT );
   actorH.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT );
   actorH.SetSize( sizes['H'] );
+  actorH.SetPosition( positions['H'] );
   actorG.Add( actorH );
 
   std::map< char, unsigned int > actorIds;
@@ -423,7 +568,7 @@ int UtcDaliFrameCallbackMultipleActors(void)
 
   for( char i = 'A'; i <= 'H'; ++i )
   {
-    DALI_TEST_EQUALS( frameCallback.mWorldMatrices[ actorIds[ i ] ], matrices[ i ], TEST_LOCATION );
+    DALI_TEST_EQUALS( frameCallback.mPositions[ actorIds[ i ] ], positions[ i ], TEST_LOCATION );
     DALI_TEST_EQUALS( frameCallback.mSizes[ actorIds[ i ] ], sizes[ i ], TEST_LOCATION );
   }
 
@@ -437,7 +582,7 @@ int UtcDaliFrameCallbackMultipleActors(void)
 
   for( char i = 'A'; i <= 'H'; ++i )
   {
-    DALI_TEST_EQUALS( frameCallback.mWorldMatrices[ actorIds[ i ] ], matrices[ i ], TEST_LOCATION );
+    DALI_TEST_EQUALS( frameCallback.mPositions[ actorIds[ i ] ], positions[ i ], TEST_LOCATION );
     DALI_TEST_EQUALS( frameCallback.mSizes[ actorIds[ i ] ], sizes[ i ], TEST_LOCATION );
   }
 
@@ -460,11 +605,277 @@ int UtcDaliFrameCallbackCheckActorNotAdded(void)
   application.SendNotification();
   application.Render();
 
+  // All should be default constructed objects
   DALI_TEST_EQUALS( frameCallback.mCalled, true, TEST_LOCATION );
-  DALI_TEST_EQUALS( frameCallback.mWorldMatrix, Matrix(true) /* Unchanged Matrix */, TEST_LOCATION );
-  DALI_TEST_EQUALS( frameCallback.mWorldMatrixGetWorldMatrixCall, Matrix::IDENTITY, TEST_LOCATION );
-  DALI_TEST_EQUALS( frameCallback.mSize, Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mPositionGetPositionCall, Vector3::ZERO, TEST_LOCATION );
   DALI_TEST_EQUALS( frameCallback.mSizeGetSizeCall, Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mColor, Vector4::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mScale, Vector3::ZERO, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliFrameCallbackInvalidActorId(void)
+{
+  // Test to ensure that there are no issues when trying to use the update-proxy methods with an invalid actor ID.
+
+  TestApplication application;
+  Stage stage = Stage::GetCurrent();
+
+  FrameCallbackActorIdCheck frameCallback( 10000 );
+  DevelStage::AddFrameCallback( stage, frameCallback, stage.GetRootLayer() );
+
+  application.SendNotification();
+  application.Render();
+
+  // Invalid Actor ID so all the methods should not return successfully.
+
+  DALI_TEST_EQUALS( frameCallback.mCalled,                        true,  TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetSizeCallSuccess,            false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetPositionCallSuccess,        false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetColorCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetScaleCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetPositionAndSizeCallSuccess, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetSizeCallSuccess,            false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetPositionCallSuccess,        false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetColorCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetScaleCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeSizeCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakePositionCallSuccess,       false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeColorCallSuccess,          false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeScaleCallSuccess,          false, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliFrameCallbackActorRemovedAndAdded(void)
+{
+  // Test to ensure that we do not call methods on actors that have been removed on the stage
+  // and then re-start calling the required methods if that actor is re-added back to the stage
+
+  TestApplication application;
+  Stage stage = Stage::GetCurrent();
+
+  Actor actor = Actor::New();
+  stage.Add( actor );
+
+  FrameCallbackActorIdCheck frameCallback( actor.GetId() );
+  DevelStage::AddFrameCallback( stage, frameCallback, stage.GetRootLayer() );
+
+  application.SendNotification();
+  application.Render();
+
+  // All methods should return successfully.
+
+  DALI_TEST_EQUALS( frameCallback.mCalled,                        true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetSizeCallSuccess,            true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetPositionCallSuccess,        true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetColorCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetScaleCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetPositionAndSizeCallSuccess, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetSizeCallSuccess,            true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetPositionCallSuccess,        true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetColorCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetScaleCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeSizeCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakePositionCallSuccess,       true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeColorCallSuccess,          true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeScaleCallSuccess,          true, TEST_LOCATION );
+  frameCallback.Reset();
+
+  // Remove the actor from stage, the methods should not return successfully.
+
+  stage.Remove( actor );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback.mCalled,                        true,  TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetSizeCallSuccess,            false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetPositionCallSuccess,        false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetColorCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetScaleCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetPositionAndSizeCallSuccess, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetSizeCallSuccess,            false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetPositionCallSuccess,        false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetColorCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetScaleCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeSizeCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakePositionCallSuccess,       false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeColorCallSuccess,          false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeScaleCallSuccess,          false, TEST_LOCATION );
+  frameCallback.Reset();
+
+  // Re-add the actor back to the stage, all the methods should once again, return successfully.
+
+  stage.Add( actor );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback.mCalled,                        true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetSizeCallSuccess,            true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetPositionCallSuccess,        true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetColorCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetScaleCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetPositionAndSizeCallSuccess, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetSizeCallSuccess,            true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetPositionCallSuccess,        true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetColorCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetScaleCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeSizeCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakePositionCallSuccess,       true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeColorCallSuccess,          true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeScaleCallSuccess,          true, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliFrameCallbackMultipleCallbacks(void)
+{
+  // Test to ensure multiple frame-callbacks work as expected
+
+  TestApplication application;
+  Stage stage = Stage::GetCurrent();
+
+  Actor actor = Actor::New();
+  stage.Add( actor );
+
+  FrameCallbackBasic frameCallback1;
+  FrameCallbackBasic frameCallback2;
+  DevelStage::AddFrameCallback( stage, frameCallback1, stage.GetRootLayer() );
+  DevelStage::AddFrameCallback( stage, frameCallback2, stage.GetRootLayer() );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback1.mCalled, true,  TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback2.mCalled, true,  TEST_LOCATION );
+  frameCallback1.Reset();
+  frameCallback2.Reset();
+
+  // Remove the second frame-callback, only the first should be called
+
+  DevelStage::RemoveFrameCallback( stage, frameCallback2 );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback1.mCalled, true,  TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback2.mCalled, false, TEST_LOCATION );
+  frameCallback1.Reset();
+  frameCallback2.Reset();
+
+  // Re-add the second frame-callback and remove the first, only the second should be called
+
+  DevelStage::AddFrameCallback( stage, frameCallback2, stage.GetRootLayer() );
+  DevelStage::RemoveFrameCallback( stage, frameCallback1 );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback1.mCalled, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback2.mCalled, true,  TEST_LOCATION );
+  frameCallback1.Reset();
+  frameCallback2.Reset();
+
+  // Attempt removal of the first frame-callback again, should be a no-op and yield the exact same results as the last run
+  DevelStage::RemoveFrameCallback( stage, frameCallback1 );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback1.mCalled, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback2.mCalled, true,  TEST_LOCATION );
+  frameCallback1.Reset();
+  frameCallback2.Reset();
+
+  // Remove the second frame-callback as well, neither should be called
+  DevelStage::RemoveFrameCallback( stage, frameCallback2 );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback1.mCalled, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback2.mCalled, false, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliFrameCallbackActorDestroyed(void)
+{
+  // Test to ensure that the frame-callback behaves gracefully if the connected root-actor is destroyed
+
+  TestApplication application;
+  Stage stage = Stage::GetCurrent();
+
+  Actor actor = Actor::New();
+  stage.Add( actor );
+
+  FrameCallbackBasic frameCallback1;
+  FrameCallbackBasic frameCallback2;
+  DevelStage::AddFrameCallback( stage, frameCallback1, actor );
+  DevelStage::AddFrameCallback( stage, frameCallback2, actor );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback1.mCalled, true,  TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback2.mCalled, true,  TEST_LOCATION );
+  frameCallback1.Reset();
+  frameCallback2.Reset();
+
+  // Remove the second frame-callback, only the first should be called
+
+  DevelStage::RemoveFrameCallback( stage, frameCallback2 );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback1.mCalled, true,  TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback2.mCalled, false, TEST_LOCATION );
+  frameCallback1.Reset();
+  frameCallback2.Reset();
+
+  // Remove and destroy the actor, the first one should not be called either
+  stage.Remove( actor );
+  actor.Reset();
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback1.mCalled, false,  TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback2.mCalled, false, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliFrameCallbackDestroyedBeforeRemoving(void)
+{
+  // Ensure there's no segmentation fault if the callback is deleted without being removed
+
+  TestApplication application;
+  Stage stage = Stage::GetCurrent();
+
+  Actor actor = Actor::New();
+  stage.Add( actor );
+
+  {
+    FrameCallbackBasic frameCallback;
+    DevelStage::AddFrameCallback( stage, frameCallback, actor );
+
+    application.SendNotification();
+    application.Render();
+
+    DALI_TEST_EQUALS( frameCallback.mCalled, true,  TEST_LOCATION );
+    frameCallback.Reset();
+  }
+
+  // frameCallback has now been destroyed but not removed
+
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_CHECK( true ); // If it runs to here then there's no segmentation fault
 
   END_TEST;
 }
index d0663c3..5572eeb 100644 (file)
@@ -19,6 +19,8 @@ SET( SOURCES ${SOURCES}
   ${CMAKE_CURRENT_SOURCE_DIR}/threading/conditional-wait.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/threading/mutex.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/threading/thread.cpp
+  ${CMAKE_CURRENT_SOURCE_DIR}/update/frame-callback-interface.cpp
+  ${CMAKE_CURRENT_SOURCE_DIR}/update/update-proxy.cpp
 
   PARENT_SCOPE )
 
@@ -63,4 +65,7 @@ SET( DEVEL_API_HEADERS
   ${CMAKE_CURRENT_SOURCE_DIR}/threading/mutex.h
   ${CMAKE_CURRENT_SOURCE_DIR}/threading/thread.h
 
+  ${CMAKE_CURRENT_SOURCE_DIR}/update/frame-callback-interface.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/update/update-proxy.h
+
   PARENT_SCOPE )
diff --git a/dali/devel-api/common/bitwise-enum.h b/dali/devel-api/common/bitwise-enum.h
new file mode 100644 (file)
index 0000000..2717a92
--- /dev/null
@@ -0,0 +1,83 @@
+#ifndef DALI_BITWISE_ENUM_H
+#define DALI_BITWISE_ENUM_H
+
+/*
+ * 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 <type_traits> // std::enable_if, std::underlying_type
+
+namespace Dali
+{
+
+/**
+ * Type traits and methods to enable type safe bit field operators for an enum.
+ * usage:
+ *   template<> struct EnableBitMaskOperators< MyEnumType > { static const bool ENABLE = true; };
+ * after this one can set bitfields with | and |=, like
+ *   MyEnumType value = FLAG1 | FLAG2;
+ * and test them with &, like:
+ *   if( myFlag & FLAG2 )
+ *    // do something
+ */
+template< typename Enum >
+struct EnableBitMaskOperators
+{
+  static const bool ENABLE = false; // can't be constexpr as it's a data member
+};
+
+/**
+ * Combine two bitfields
+ * @param lhs bitfield to or
+ * @param rhs bitfield to or
+ * @return EnumType with both flags set
+ */
+template < typename EnumType >
+inline typename std::enable_if< EnableBitMaskOperators< EnumType >::ENABLE, EnumType >::type operator|( EnumType lhs, EnumType rhs )
+{
+  using UnderlyingType = typename std::underlying_type<EnumType>::type;
+  return static_cast<EnumType>( static_cast<UnderlyingType>( lhs ) | static_cast<UnderlyingType>(rhs ) );
+}
+
+/**
+ * Combine two bitfields
+ * @param lhs bitfield to or
+ * @param rhs bitfield to or
+ * @return reference to lhs with both flags set
+ */
+template < typename EnumType >
+inline typename std::enable_if< EnableBitMaskOperators< EnumType >::ENABLE, EnumType& >::type operator|=( EnumType& lhs, EnumType rhs )
+{
+  using UnderlyingType = typename std::underlying_type<EnumType>::type;
+  lhs = static_cast<EnumType>(static_cast<UnderlyingType>( lhs ) | static_cast<UnderlyingType>( rhs ) );
+  return lhs;
+}
+
+/**
+ * Test two bitfields.
+ * @param lhs bitfield to AND
+ * @param rhs bitfield to AND
+ * @return true if at least one flag is same in both
+ */
+template < typename EnumType >
+inline typename std::enable_if< EnableBitMaskOperators< EnumType >::ENABLE, bool >::type operator&( EnumType lhs, EnumType rhs )
+{
+  using UnderlyingType = typename std::underlying_type<EnumType>::type;
+  return static_cast<bool>( static_cast<UnderlyingType>( lhs ) & static_cast<UnderlyingType>(rhs ) );
+}
+
+} // namespace Dali
+
+#endif // DALI_BITWISE_ENUM_H
index 3735f04..05b7390 100644 (file)
@@ -85,6 +85,8 @@ DALI_IMPORT_API void AddFrameCallback( Dali::Stage stage, FrameCallbackInterface
  *
  * @param[in] stage The stage to clear the FrameCallbackInterface on
  * @param[in] frameCallback The FrameCallbackInterface implementation to remove
+ *
+ * @note If the callback implementation has already been removed, then this is a no-op.
  */
 DALI_IMPORT_API void RemoveFrameCallback( Dali::Stage stage, FrameCallbackInterface& frameCallback );
 
index 0487c33..7a953c8 100644 (file)
@@ -19,6 +19,7 @@ devel_api_src_files = \
   $(devel_api_src_dir)/threading/conditional-wait.cpp \
   $(devel_api_src_dir)/threading/mutex.cpp \
   $(devel_api_src_dir)/threading/thread.cpp \
+  $(devel_api_src_dir)/update/frame-callback-interface.cpp \
   $(devel_api_src_dir)/update/update-proxy.cpp
 
 # Add devel header files here DALi internal developer files used by Adaptor & Toolkit
@@ -34,6 +35,7 @@ devel_api_core_animation_header_files = \
   $(devel_api_src_dir)/animation/animation-devel.h
 
 devel_api_core_common_header_files = \
+  $(devel_api_src_dir)/common/bitwise-enum.h \
   $(devel_api_src_dir)/common/circular-queue.h \
   $(devel_api_src_dir)/common/hash.h \
   $(devel_api_src_dir)/common/map-wrapper.h \
diff --git a/dali/devel-api/update/frame-callback-interface.cpp b/dali/devel-api/update/frame-callback-interface.cpp
new file mode 100644 (file)
index 0000000..bf4de08
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/devel-api/update/frame-callback-interface.h>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/update/update-proxy.h>
+#include <dali/internal/event/common/stage-impl.h>
+
+namespace Dali
+{
+
+FrameCallbackInterface::~FrameCallbackInterface()
+{
+  if( Internal::Stage::IsInstalled() )
+  {
+    Internal::StagePtr stage = Internal::Stage::GetCurrent();
+    if( stage )
+    {
+      // This will be a no-op if the callback has already been removed
+      stage->RemoveFrameCallback( *this );
+    }
+  }
+}
+
+} // namespace Dali
index d92c7be..e6ad997 100644 (file)
@@ -64,7 +64,7 @@ protected:
   /**
    * @brief Protected virtual destructor.
    */
-  virtual ~FrameCallbackInterface() {}
+  virtual ~FrameCallbackInterface();
 };
 
 } // namespace Dali
index 67511b4..7480569 100644 (file)
 namespace Dali
 {
 
-Vector3 UpdateProxy::GetPosition( unsigned int id ) const
+bool UpdateProxy::GetPosition( uint32_t id, Vector3& position ) const
 {
-  return mImpl.GetPosition( id );
+  return mImpl.GetPosition( id, position );
 }
 
-void UpdateProxy::SetPosition( unsigned int id, const Vector3& position )
+bool UpdateProxy::SetPosition( uint32_t id, const Vector3& position )
 {
-  mImpl.SetPosition( id, position );
+  return mImpl.SetPosition( id, position );
 }
 
-const Vector3& UpdateProxy::GetSize( unsigned int id ) const
+bool UpdateProxy::BakePosition( uint32_t id, const Vector3& position )
 {
-  return mImpl.GetSize( id );
+  return mImpl.BakePosition( id, position );
 }
 
-void UpdateProxy::SetSize( unsigned int id, const Vector3& size )
+bool UpdateProxy::GetSize( uint32_t id, Vector3& size ) const
 {
-  mImpl.SetSize( id, size );
+  return mImpl.GetSize( id, size );
 }
 
-void UpdateProxy::GetPositionAndSize( unsigned int id, Vector3& position, Vector3& size ) const
+bool UpdateProxy::SetSize( uint32_t id, const Vector3& size )
 {
-  mImpl.GetPositionAndSize( id, position, size );
+  return mImpl.SetSize( id, size );
 }
 
-Vector4 UpdateProxy::GetWorldColor( unsigned int id ) const
+bool UpdateProxy::BakeSize( uint32_t id, const Vector3& size )
 {
-  return mImpl.GetWorldColor( id );
+  return mImpl.BakeSize( id, size );
 }
 
-void UpdateProxy::SetWorldColor( unsigned int id, const Vector4& color ) const
+bool UpdateProxy::GetPositionAndSize( uint32_t id, Vector3& position, Vector3& size ) const
 {
-  mImpl.SetWorldColor( id, color );
+  return mImpl.GetPositionAndSize( id, position, size );
 }
 
-void UpdateProxy::GetWorldMatrixAndSize( unsigned int id, Matrix& worldMatrix, Vector3& size ) const
+bool UpdateProxy::GetScale( uint32_t id, Vector3& scale ) const
 {
-  mImpl.GetWorldMatrixAndSize( id, worldMatrix, size );
+  return mImpl.GetScale( id, scale );
 }
 
-const Matrix& UpdateProxy::GetWorldMatrix( unsigned int id ) const
+bool UpdateProxy::SetScale( uint32_t id, const Vector3& scale )
 {
-  return mImpl.GetWorldMatrix( id );
+  return mImpl.SetScale( id, scale );
 }
 
-void UpdateProxy::SetWorldMatrix( unsigned int id, const Matrix& worldMatrix )
+bool UpdateProxy::BakeScale( uint32_t id, const Vector3& scale )
 {
-  mImpl.SetWorldMatrix( id, worldMatrix );
+  return mImpl.BakeScale( id, scale );
+}
+
+bool UpdateProxy::GetColor( uint32_t id, Vector4& color ) const
+{
+  return mImpl.GetColor( id, color );
+}
+
+bool UpdateProxy::SetColor( uint32_t id, const Vector4& color ) const
+{
+  return mImpl.SetColor( id, color );
+}
+
+bool UpdateProxy::BakeColor( uint32_t id, const Vector4& color ) const
+{
+  return mImpl.BakeColor( id, color );
 }
 
 UpdateProxy::UpdateProxy( Internal::UpdateProxy& impl )
index 2ea1194..218739a 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint>
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/math/matrix.h>
@@ -45,83 +48,117 @@ class DALI_CORE_API UpdateProxy
 public:
 
   /**
-   * @brief Given the Actor ID, this retrieves that Actor's position.
-   * @param[in]  id  The Actor ID
-   * @return If valid Actor ID, then the Actor's position is returned.
+   * @brief Given the Actor ID, this retrieves that Actor's local position.
+   * @param[in]   id        The Actor ID
+   * @param[out]  position  Set to the Actor's current position, if Actor ID is valid
+   * @return Whether the method call was successful or not.
+   */
+  bool GetPosition( uint32_t id, Vector3& position ) const;
+
+  /**
+   * @brief Allows setting an Actor's local position from the Frame callback function for the current frame only.
+   * @param[in]  id        The Actor ID
+   * @param[in]  position  The position to set
+   * @return Whether the method call was successful or not.
+   * @note This will get reset to the internally calculated or previously baked value in the next frame, so will have to be set again.
    */
-  Vector3 GetPosition( unsigned int id ) const;
+  bool SetPosition( uint32_t id, const Vector3& position );
 
   /**
-   * @brief Allows setting an Actor's position from the Frame callback function.
+   * @brief Allows baking an Actor's local position from the Frame callback function.
    * @param[in]  id        The Actor ID
-   * @param[in]  position  The position to set.
-   * @note This will get reset to the internally calculated value in the next frame, so will have to be set again.
+   * @param[in]  position  The position to bake
+   * @return Whether the method call was successful or not.
+   * @note The value is saved so will cause undesired effects if this property is being animated.
    */
-  void SetPosition( unsigned int id, const Vector3& position );
+  bool BakePosition( uint32_t id, const Vector3& position );
 
   /**
    * @brief Given the Actor ID, this retrieves that Actor's size.
-   * @param[in]  id  The Actor ID
-   * @return If valid Actor ID, then Actor's size is returned, otherwise Vector3::ZERO.
+   * @param[in]   id    The Actor ID
+   * @param[out]  size  Set to the Actor's current size, if Actor ID is valid
+   * @return Whether the method call was successful or not.
    */
-  const Vector3& GetSize( unsigned int id ) const;
+  bool GetSize( uint32_t id, Vector3& size ) const;
 
   /**
-   * @brief Allows setting an Actor's size from the Frame callback function.
+   * @brief Allows setting an Actor's size from the Frame callback function for the current frame only.
    * @param[in]  id    The Actor ID
-   * @param[in]  size  The size to set.
-   * @note This will get reset to the internally calculated value in the next frame, so will have to be set again.
+   * @param[in]  size  The size to set
+   * @return Whether the method call was successful or not.
+   * @note This will get reset to the internally calculated or previously baked value in the next frame, so will have to be set again.
    */
-  void SetSize( unsigned int id, const Vector3& size );
+  bool SetSize( uint32_t id, const Vector3& size );
 
   /**
-   * @brief Given the Actor ID, this retrieves that Actor's position and size.
-   * @param[in]   id        The Actor ID
-   * @param[out]  position  If valid Actor ID, then Actor's position is set
-   * @param[out]  size      If valid Actor ID, then Actor's size is set
+   * @brief Allows baking an Actor's size from the Frame callback function.
+   * @param[in]  id    The Actor ID
+   * @param[in]  size  The size to bake
+   * @return Whether the method call was successful or not.
+   * @note The value is saved so will cause undesired effects if this property is being animated.
    */
-  void GetPositionAndSize( unsigned int id, Vector3& position, Vector3& size ) const;
+  bool BakeSize( uint32_t id, const Vector3& size );
 
   /**
-   * @brief Given the Actor ID, this retrieves that Actor's color.
+   * @brief Given the Actor ID, this retrieves that Actor's local position and size.
    * @param[in]   id        The Actor ID
-   * @return If valid Actor ID, then Actor's color is returned, otherwise Vector4::ZERO.
+   * @param[out]  position  Set to the Actor's current position, if Actor ID is valid
+   * @param[out]  size      Set to the Actor's current size, if Actor ID is valid
+   * @return Whether the method call was successful or not.
    */
-  Vector4 GetWorldColor( unsigned int id ) const;
+  bool GetPositionAndSize( uint32_t id, Vector3& position, Vector3& size ) const;
 
   /**
-   * @brief Allows setting an Actor's color from the Frame callback function.
+   * @brief Given the Actor ID, this retrieves that Actor's local scale.
+   * @param[in]   id     The Actor ID
+   * @param[out]  scale  Set to the Actor's current scale, if Actor ID is valid
+   * @return Whether the method call was successful or not.
+   */
+  bool GetScale( uint32_t id, Vector3& scale ) const;
+
+  /**
+   * @brief Allows setting an Actor's local scale from the Frame callback function for the current frame only.
    * @param[in]  id     The Actor ID
-   * @param[in]  color  The color to set
-   * @note This will get reset to the internally calculated value in the next frame, so will have to be set again.
+   * @param[in]  scale  The scale to set
+   * @return Whether the method call was successful or not.
+   * @note This will get reset to the internally calculated or previously baked value in the next frame, so will have to be set again.
    */
-  void SetWorldColor( unsigned int id, const Vector4& color ) const;
+  bool SetScale( uint32_t id, const Vector3& scale );
 
   /**
-   * @brief Given the Actor ID, this retrieves that Actor's world-matrix and size.
-   * @param[in]   id           The Actor ID
-   * @param[out]  worldMatrix  If valid Actor ID, then Actor's world matrix is set
-   * @param[out]  size         If valid Actor ID, then Actor's size is set
+   * @brief Allows baking an Actor's local scale from the Frame callback function.
+   * @param[in]  id     The Actor ID
+   * @param[in]  scale  The scale to bake
+   * @return Whether the method call was successful or not.
+   * @note The value is saved so will cause undesired effects if this property is being animated.
    */
-  void GetWorldMatrixAndSize( unsigned int id, Matrix& worldMatrix, Vector3& size ) const;
+  bool BakeScale( uint32_t id, const Vector3& scale );
 
   /**
-   * @brief Given the Actor ID, this retrieves that Actor's world-matrix.
-   * @param[in]  id  The Actor ID
-   * @return If valid Actor ID, then Actor's world matrix is returned, otherwise Matrix::IDENTITY.
+   * @brief Given the Actor ID, this retrieves that Actor's local color.
+   * @param[in]   id     The Actor ID
+   * @param[out]  color  Set to the Actor's current color, if Actor ID is valid
+   * @return Whether the method call was successful or not.
    */
-  const Matrix& GetWorldMatrix( unsigned int id ) const;
+  bool GetColor( uint32_t id, Vector4& color ) const;
 
   /**
-   * @brief Allows the setting an Actor's world-matrix from the Frame callback function.
-   * @param[in]  id           The Actor ID
-   * @param[in]  worldMatrix  The world matrix to set.
-   * @note This will get reset to the internally calculated value in the next frame, so will have to be set again.
-   * @note This will only set the world matrix for that particular actor.
-   *       The world matrices of the children will not change and will have to be manually changed in the callback
-   *       as well (if required).
+   * @brief Allows setting an Actor's local color from the Frame callback function for the current frame only.
+   * @param[in]  id     The Actor ID
+   * @param[in]  color  The color to set
+   * @return Whether the method call was successful or not.
+   * @note This will get reset to the internally calculated or previously baked value in the next frame, so will have to be set again.
+   */
+  bool SetColor( uint32_t id, const Vector4& color ) const;
+
+  /**
+   * @brief Allows baking an Actor's local color from the Frame callback function.
+   * @param[in]  id     The Actor ID
+   * @param[in]  color  The color to bake
+   * @return Whether the method call was successful or not.
+   * @note The value is saved so will cause undesired effects if this property is being animated.
    */
-  void SetWorldMatrix( unsigned int id, const Matrix& worldMatrix );
+  bool BakeColor( uint32_t id, const Vector4& color ) const;
 
 public: // Not intended for application developers
 
index 876c7e6..6a914c3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * 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.
@@ -187,7 +187,6 @@ void Animation::SetDuration(float seconds)
     seconds = 0.0f;
   }
 
-  // Cache for public getters
   mDurationSeconds = seconds;
 
   // mAnimation is being used in a separate thread; queue a message to set the value
index 87f3b89..f837ce2 100644 (file)
 // CLASS HEADER
 #include <dali/internal/update/manager/frame-callback-processor.h>
 
+// EXTERNAL INCLUDES
+#include <algorithm>
+
 // INTERNAL INCLUDES
 #include <dali/devel-api/update/frame-callback-interface.h>
 #include <dali/devel-api/update/update-proxy.h>
-#include <dali/internal/update/manager/update-proxy-impl.h>
 
 namespace Dali
 {
@@ -35,6 +37,9 @@ namespace SceneGraph
 namespace
 {
 
+/**
+ * Given a node, it matches all update-proxies using that node as their root-node.
+ */
 template< typename FrameCallbackInfoT >
 class MatchRootNode
 {
@@ -52,15 +57,15 @@ public:
 
 private:
 
-  PropertyOwner& mRootNode;
+  const PropertyOwner& mRootNode;
 };
 
 } // unnamed namespace
 
-FrameCallbackProcessor::FrameCallbackProcessor( TransformManager& transformManager, Node& rootNode )
+FrameCallbackProcessor::FrameCallbackProcessor( TransformManager& transformManager )
 : mFrameCallbacks(),
   mTransformManager( transformManager ),
-  mRootNode( rootNode )
+  mNodeHierarchyChanged( true )
 {
 }
 
@@ -72,10 +77,6 @@ void FrameCallbackProcessor::AddFrameCallback( FrameCallbackInterface* frameCall
 {
   Node& node = const_cast< Node& >( *rootNode ); // Was sent as const from event thread, we need to be able to use non-const version here.
 
-  FrameCallbackInfo info;
-  info.frameCallback = frameCallback;
-  info.updateProxyImpl = new UpdateProxy( mTransformManager, node );
-
   // We want to be notified when the node is destroyed (if we're not observing it already)
   auto iter = std::find_if( mFrameCallbacks.begin(), mFrameCallbacks.end(), MatchRootNode< FrameCallbackInfo >( node ) );
   if( iter == mFrameCallbacks.end() )
@@ -83,20 +84,37 @@ void FrameCallbackProcessor::AddFrameCallback( FrameCallbackInterface* frameCall
     node.AddObserver( *this );
   }
 
-  mFrameCallbacks.push_back( info );
+  mFrameCallbacks.emplace_back( FrameCallbackInfo( frameCallback , new UpdateProxy( mTransformManager, node ) ) );
 }
 
 void FrameCallbackProcessor::RemoveFrameCallback( FrameCallbackInterface* frameCallback )
 {
-  auto iter = std::remove_if( mFrameCallbacks.begin(), mFrameCallbacks.end(),
-                              [ this, frameCallback ]
-                                ( const FrameCallbackInfo& info )
-                                {
-                                  info.updateProxyImpl->GetRootNode().RemoveObserver( *this );
-                                  delete info.updateProxyImpl;
-                                  return info.frameCallback == frameCallback;
-                                } );
+  std::vector< SceneGraph::Node* > nodesToStopObserving;
+
+  // Find and remove all matching frame-callbacks
+  auto iter =
+    std::remove_if( mFrameCallbacks.begin(), mFrameCallbacks.end(),
+                    [ frameCallback, &nodesToStopObserving ] ( FrameCallbackInfo& info )
+                    {
+                      bool match = false;
+                      if( info.frameCallback == frameCallback )
+                      {
+                        nodesToStopObserving.push_back( &info.updateProxyImpl->GetRootNode() );
+                        match = true;
+                      }
+                      return match;
+                    } );
   mFrameCallbacks.erase( iter, mFrameCallbacks.end() );
+
+  // Only stop observing the removed frame-callback nodes if none of the other frame-callbacks use them as root nodes
+  for( auto&& node : nodesToStopObserving )
+  {
+    auto nodeMatchingIter = std::find_if( mFrameCallbacks.begin(), mFrameCallbacks.end(), MatchRootNode< FrameCallbackInfo >( *node ) );
+    if( nodeMatchingIter == mFrameCallbacks.end() )
+    {
+      node->RemoveObserver( *this );
+    }
+  }
 }
 
 void FrameCallbackProcessor::Update( BufferIndex bufferIndex, float elapsedSeconds )
@@ -105,9 +123,16 @@ void FrameCallbackProcessor::Update( BufferIndex bufferIndex, float elapsedSecon
   {
     UpdateProxy& updateProxyImpl = *iter.updateProxyImpl;
     updateProxyImpl.SetCurrentBufferIndex( bufferIndex );
+
+    if( mNodeHierarchyChanged )
+    {
+      updateProxyImpl.NodeHierarchyChanged();
+    }
+
     Dali::UpdateProxy updateProxy( updateProxyImpl );
     iter.frameCallback->Update( updateProxy, elapsedSeconds );
   }
+  mNodeHierarchyChanged = false;
 }
 
 void FrameCallbackProcessor::PropertyOwnerDestroyed( PropertyOwner& owner )
index 90d9c7d..440227d 100644 (file)
  *
  */
 
+// EXTERNAL INCLUDES
+#include <memory>
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/internal/common/buffer-index.h>
 #include <dali/internal/update/common/property-owner.h>
+#include <dali/internal/update/manager/update-proxy-impl.h>
 
 namespace Dali
 {
@@ -31,8 +35,6 @@ class FrameCallbackInterface;
 namespace Internal
 {
 
-class UpdateProxy;
-
 namespace SceneGraph
 {
 
@@ -49,7 +51,7 @@ public:
   /**
    * Construct a new FrameCallbackProcessor.
    */
-  FrameCallbackProcessor( TransformManager& transformManager, Node& rootNode );
+  FrameCallbackProcessor( TransformManager& transformManager );
 
   /**
    * Non-virtual Destructor.
@@ -83,6 +85,14 @@ public:
    */
   void Update( BufferIndex bufferIndex, float elapsedSeconds );
 
+  /**
+   * Called by the UpdateManager when the node hierarchy changes.
+   */
+  void NodeHierarchyChanged()
+  {
+    mNodeHierarchyChanged = true;
+  }
+
 private:
 
   // From PropertyOwner::Observer
@@ -108,14 +118,36 @@ private:
 
   struct FrameCallbackInfo
   {
-    FrameCallbackInterface* frameCallback;
-    UpdateProxy* updateProxyImpl;
+    /**
+     * Default Constructor
+     * @param[in]  frameCallbackObject  A pointer to the frame-callback object
+     * @param[in]  updateProxyPtr       A raw pointer to the newly created updateProxy
+     * @note Ownership of @updateProxyPtr is passed to this class.
+     */
+    FrameCallbackInfo( FrameCallbackInterface* frameCallbackObject, UpdateProxy* updateProxyPtr )
+    : frameCallback( frameCallbackObject ),
+      updateProxyImpl( updateProxyPtr )
+    {
+    }
+
+    ~FrameCallbackInfo() = default; ///< Default destructor.
+
+    // Movable but not copyable
+    FrameCallbackInfo( const FrameCallbackInfo& )            = delete;  ///< Deleted copy constructor.
+    FrameCallbackInfo( FrameCallbackInfo&& )                 = default; ///< Default move constructor.
+    FrameCallbackInfo& operator=( const FrameCallbackInfo& ) = delete;  ///< Deleted copy assignment operator.
+    FrameCallbackInfo& operator=( FrameCallbackInfo&& )      = default; ///< Default move assignment operator.
+
+    // Data
+    FrameCallbackInterface* frameCallback{ nullptr }; ///< Pointer to the implementation of the FrameCallbackInterface.
+    std::unique_ptr< UpdateProxy > updateProxyImpl{ nullptr }; ///< A unique pointer to the implementation of the UpdateProxy.
   };
 
-  std::vector< FrameCallbackInfo > mFrameCallbacks;
+  std::vector< FrameCallbackInfo > mFrameCallbacks; ///< A container of all the frame-callbacks & accompanying update-proxies.
 
   TransformManager& mTransformManager;
-  Node& mRootNode;
+
+  bool mNodeHierarchyChanged; ///< Set to true if the node hierarchy changes
 };
 
 } // namespace SceneGraph
index ead7154..b767b58 100644 (file)
@@ -71,9 +71,9 @@ void ConstrainPropertyOwner( PropertyOwner& propertyOwner, BufferIndex updateBuf
  ************************** Update node hierarchy *****************************
  ******************************************************************************/
 
-inline void UpdateRootNodeOpacity( Layer& rootNode, int nodeDirtyFlags, BufferIndex updateBufferIndex )
+inline void UpdateRootNodeOpacity( Layer& rootNode, NodePropertyFlags nodeDirtyFlags, BufferIndex updateBufferIndex )
 {
-  if ( nodeDirtyFlags & ColorFlag )
+  if ( nodeDirtyFlags & NodePropertyFlags::COLOR )
   {
     rootNode.SetWorldColor( rootNode.GetColor( updateBufferIndex ), updateBufferIndex );
   }
@@ -84,10 +84,10 @@ inline void UpdateRootNodeOpacity( Layer& rootNode, int nodeDirtyFlags, BufferIn
   }
 }
 
-inline void UpdateNodeOpacity( Node& node, int nodeDirtyFlags, BufferIndex updateBufferIndex )
+inline void UpdateNodeOpacity( Node& node, NodePropertyFlags nodeDirtyFlags, BufferIndex updateBufferIndex )
 {
   // If opacity needs to be recalculated
-  if ( nodeDirtyFlags & ColorFlag )
+  if ( nodeDirtyFlags & NodePropertyFlags::COLOR )
   {
     node.InheritWorldColor( updateBufferIndex );
   }
@@ -101,12 +101,12 @@ inline void UpdateNodeOpacity( Node& node, int nodeDirtyFlags, BufferIndex updat
 /**
  * This is called recursively for all children of the root Node
  */
-inline int UpdateNodes( Node& node,
-                        int parentFlags,
-                        BufferIndex updateBufferIndex,
-                        RenderQueue& renderQueue,
-                        Layer& currentLayer,
-                        int inheritedDrawMode )
+inline NodePropertyFlags UpdateNodes( Node& node,
+                                      NodePropertyFlags parentFlags,
+                                      BufferIndex updateBufferIndex,
+                                      RenderQueue& renderQueue,
+                                      Layer& currentLayer,
+                                      uint32_t inheritedDrawMode )
 {
   // Apply constraints to the node
   ConstrainPropertyOwner( node, updateBufferIndex );
@@ -114,7 +114,7 @@ inline int UpdateNodes( Node& node,
   // Short-circuit for invisible nodes
   if ( !node.IsVisible( updateBufferIndex ) )
   {
-    return 0;
+    return NodePropertyFlags::NOTHING;
   }
 
   // If the node was not previously visible
@@ -126,9 +126,9 @@ inline int UpdateNodes( Node& node,
   }
 
   // Some dirty flags are inherited from parent
-  int nodeDirtyFlags( node.GetDirtyFlags() | ( parentFlags & InheritedDirtyFlags ) );
+  NodePropertyFlags nodeDirtyFlags = node.GetInheritedDirtyFlags( parentFlags );
 
-  int cumulativeDirtyFlags = nodeDirtyFlags;
+  NodePropertyFlags cumulativeDirtyFlags = nodeDirtyFlags;
 
   Layer* layer = &currentLayer;
   Layer* nodeIsLayer( node.GetLayer() );
@@ -179,16 +179,16 @@ inline int UpdateNodes( Node& node,
 /**
  * The root node is treated separately; it cannot inherit values since it has no parent
  */
-int UpdateNodeTree( Layer& rootNode,
-                    BufferIndex updateBufferIndex,
-                    RenderQueue& renderQueue )
+NodePropertyFlags UpdateNodeTree( Layer& rootNode,
+                                  BufferIndex updateBufferIndex,
+                                  RenderQueue& renderQueue )
 {
   DALI_ASSERT_DEBUG( rootNode.IsRoot() );
 
   // Short-circuit for invisible nodes
   if ( DALI_UNLIKELY( !rootNode.IsVisible( updateBufferIndex ) ) ) // almost never ever true
   {
-    return 0;
+    return NodePropertyFlags::NOTHING;
   }
 
   // If the root node was not previously visible
@@ -199,9 +199,9 @@ int UpdateNodeTree( Layer& rootNode,
     rootNode.SetAllDirtyFlags();
   }
 
-  int nodeDirtyFlags( rootNode.GetDirtyFlags() );
+  NodePropertyFlags nodeDirtyFlags( rootNode.GetDirtyFlags() );
 
-  int cumulativeDirtyFlags = nodeDirtyFlags;
+  NodePropertyFlags cumulativeDirtyFlags = nodeDirtyFlags;
 
   UpdateRootNodeOpacity( rootNode, nodeDirtyFlags, updateBufferIndex );
 
index 62f2411..8bfa09a 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SCENE_GRAPH_UPDATE_ALGORITHMS_H__
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,6 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/common/buffer-index.h>
+#include <dali/internal/update/nodes/node-declarations.h>
 
 namespace Dali
 {
@@ -31,7 +32,6 @@ namespace SceneGraph
 {
 
 class Layer;
-class Node;
 class PropertyOwner;
 class RenderQueue;
 
@@ -50,9 +50,9 @@ void ConstrainPropertyOwner( PropertyOwner& propertyOwner, BufferIndex updateBuf
  * @param[in] renderQueue Used to query messages for the next Render.
  * @return The cumulative (ORed) dirty flags for the updated nodes
  */
-int UpdateNodeTree( Layer& rootNode,
-                    BufferIndex updateBufferIndex,
-                    RenderQueue& renderQueue );
+NodePropertyFlags UpdateNodeTree( Layer& rootNode,
+                                  BufferIndex updateBufferIndex,
+                                  RenderQueue& renderQueue );
 
 } // namespace SceneGraph
 
index 10f290f..ff35064 100644 (file)
@@ -198,7 +198,7 @@ struct UpdateManager::Impl
     messageQueue( renderController, sceneGraphBuffers ),
     frameCallbackProcessor( NULL ),
     keepRenderingSeconds( 0.0f ),
-    nodeDirtyFlags( TransformFlag ), // set to TransformFlag to ensure full update the first time through Update()
+    nodeDirtyFlags( NodePropertyFlags::TRANSFORM ), // set to TransformFlag to ensure full update the first time through Update()
     frameCounter( 0 ),
     renderingBehavior( DevelStage::Rendering::IF_REQUIRED ),
     animationFinishedDuringUpdate( false ),
@@ -265,7 +265,7 @@ struct UpdateManager::Impl
   {
     if( ! frameCallbackProcessor )
     {
-      frameCallbackProcessor = new FrameCallbackProcessor( transformManager, *root );
+      frameCallbackProcessor = new FrameCallbackProcessor( transformManager );
     }
     return *frameCallbackProcessor;
   }
@@ -317,7 +317,7 @@ struct UpdateManager::Impl
   OwnerPointer<FrameCallbackProcessor> frameCallbackProcessor;        ///< Owned FrameCallbackProcessor, only created if required.
 
   float                                keepRenderingSeconds;          ///< Set via Dali::Stage::KeepRendering
-  int                                  nodeDirtyFlags;                ///< cumulative node dirty flags from previous frame
+  NodePropertyFlags                    nodeDirtyFlags;                ///< cumulative node dirty flags from previous frame
   int                                  frameCounter;                  ///< Frame counter used in debugging to choose which frame to debug and which to ignore.
 
   DevelStage::Rendering                renderingBehavior;             ///< Set via DevelStage::SetRenderingBehavior
@@ -408,15 +408,27 @@ void UpdateManager::ConnectNode( Node* parent, Node* node )
   DALI_ASSERT_ALWAYS( NULL == node->GetParent() ); // Should not have a parent yet
 
   parent->ConnectChild( node );
+
+  // Inform the frame-callback-processor, if set, about the node-hierarchy changing
+  if( mImpl->frameCallbackProcessor )
+  {
+    mImpl->frameCallbackProcessor->NodeHierarchyChanged();
+  }
 }
 
 void UpdateManager::DisconnectNode( Node* node )
 {
   Node* parent = node->GetParent();
   DALI_ASSERT_ALWAYS( NULL != parent );
-  parent->SetDirtyFlag( ChildDeletedFlag ); // make parent dirty so that render items dont get reused
+  parent->SetDirtyFlag( NodePropertyFlags::CHILD_DELETED ); // make parent dirty so that render items dont get reused
 
   parent->DisconnectChild( mSceneGraphBuffers.GetUpdateBufferIndex(), *node );
+
+  // Inform the frame-callback-processor, if set, about the node-hierarchy changing
+  if( mImpl->frameCallbackProcessor )
+  {
+    mImpl->frameCallbackProcessor->NodeHierarchyChanged();
+  }
 }
 
 void UpdateManager::DestroyNode( Node* node )
@@ -800,7 +812,7 @@ void UpdateManager::UpdateRenderers( BufferIndex bufferIndex )
 
 void UpdateManager::UpdateNodes( BufferIndex bufferIndex )
 {
-  mImpl->nodeDirtyFlags = NothingFlag;
+  mImpl->nodeDirtyFlags = NodePropertyFlags::NOTHING;
 
   if ( !mImpl->root )
   {
@@ -892,15 +904,15 @@ unsigned int UpdateManager::Update( float elapsedSeconds,
     //Update renderers and apply constraints
     UpdateRenderers( bufferIndex );
 
-    //Update the transformations of all the nodes
-    mImpl->transformManager.Update();
-
     // Call the frame-callback-processor if set
     if( mImpl->frameCallbackProcessor )
     {
       mImpl->frameCallbackProcessor->Update( bufferIndex, elapsedSeconds );
     }
 
+    //Update the transformations of all the nodes
+    mImpl->transformManager.Update();
+
     //Process Property Notifications
     ProcessPropertyNotifications( bufferIndex );
 
index 85404a9..4763bc5 100644 (file)
@@ -27,7 +27,7 @@ namespace Internal
 namespace
 {
 
-SceneGraph::Node* FindNodeInSceneGraph( unsigned int id, SceneGraph::Node& node )
+SceneGraph::Node* FindNodeInSceneGraph( uint32_t id, SceneGraph::Node& node )
 {
   SceneGraph::Node* matchingNode = NULL;
 
@@ -65,101 +65,172 @@ UpdateProxy::~UpdateProxy()
 {
 }
 
-Vector3 UpdateProxy::GetPosition( unsigned int id ) const
+bool UpdateProxy::GetPosition( uint32_t id, Vector3& position ) const
 {
-  const Dali::Matrix& matrix = GetWorldMatrix( id );
-  return matrix.GetTranslation3();
+  bool success = false;
+  const SceneGraph::Node* node = GetNodeWithId( id );
+  if( node )
+  {
+    position = mTransformManager.GetVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_POSITION );
+    success = true;
+  }
+  return success;
 }
 
-void UpdateProxy::SetPosition( unsigned int id, const Vector3& position )
+bool UpdateProxy::SetPosition( uint32_t id, const Vector3& position )
 {
-  const SceneGraph::Node* node = GetNodeWithId( id );
+  bool success = false;
+  SceneGraph::Node* node = GetNodeWithId( id );
   if( node )
   {
-    Matrix& matrix = mTransformManager.GetWorldMatrix( node->mTransformId );
-    matrix.SetTranslation( position );
+    mTransformManager.SetVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_POSITION, position );
+    success = true;
   }
+  return success;
 }
 
-const Vector3& UpdateProxy::GetSize( unsigned int id ) const
+bool UpdateProxy::BakePosition( uint32_t id, const Vector3& position )
 {
-  const SceneGraph::Node* node = GetNodeWithId( id );
+  bool success = false;
+  SceneGraph::Node* node = GetNodeWithId( id );
   if( node )
   {
-    return mTransformManager.GetVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_SIZE );
+    mTransformManager.BakeVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_POSITION, position );
+    success = true;
   }
+  return success;
+}
 
-  return Vector3::ZERO;
+bool UpdateProxy::GetSize( uint32_t id, Vector3& size ) const
+{
+  bool success = false;
+  const SceneGraph::Node* node = GetNodeWithId( id );
+  if( node )
+  {
+    size = mTransformManager.GetVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_SIZE );
+    success = true;
+  }
+  return success;
 }
 
-void UpdateProxy::SetSize( unsigned int id, const Vector3& size )
+bool UpdateProxy::SetSize( uint32_t id, const Vector3& size )
 {
+  bool success = false;
   SceneGraph::Node* node = GetNodeWithId( id );
   if( node )
   {
     mTransformManager.SetVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_SIZE, size );
+    success = true;
   }
+  return success;
 }
 
-void UpdateProxy::GetPositionAndSize( unsigned int id, Vector3& position, Vector3& size ) const
+bool UpdateProxy::BakeSize( uint32_t id, const Vector3& size )
 {
-  Matrix worldMatrix( false );
-  GetWorldMatrixAndSize( id, worldMatrix, size );
-  position = worldMatrix.GetTranslation3();
+  bool success = false;
+  SceneGraph::Node* node = GetNodeWithId( id );
+  if( node )
+  {
+    mTransformManager.BakeVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_SIZE, size );
+    success = true;
+  }
+  return success;
 }
 
-Vector4 UpdateProxy::GetWorldColor( unsigned int id ) const
+bool UpdateProxy::GetPositionAndSize( uint32_t id, Vector3& position, Vector3& size ) const
 {
-  SceneGraph::Node* node = GetNodeWithId( id );
+  bool success = false;
+  const SceneGraph::Node* node = GetNodeWithId( id );
   if( node )
   {
-    return node->mWorldColor.Get( mCurrentBufferIndex );
+    position = mTransformManager.GetVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_POSITION );
+    size = mTransformManager.GetVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_SIZE );
+    success = true;
   }
+  return success;
+}
 
-  return Vector4::ZERO;
+bool UpdateProxy::GetScale( uint32_t id, Vector3& scale ) const
+{
+  bool success = false;
+  const SceneGraph::Node* node = GetNodeWithId( id );
+  if( node )
+  {
+    scale = mTransformManager.GetVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_SCALE );
+    success = true;
+  }
+
+  return success;
 }
 
-void UpdateProxy::SetWorldColor( unsigned int id, const Vector4& color ) const
+bool UpdateProxy::SetScale( uint32_t id, const Vector3& scale )
 {
+  bool success = false;
   SceneGraph::Node* node = GetNodeWithId( id );
   if( node )
   {
-    Vector4& currentColor = node->mWorldColor.Get( mCurrentBufferIndex );
-    currentColor = color;
+    mTransformManager.SetVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_SCALE, scale );
+    success = true;
   }
+  return success;
 }
 
-void UpdateProxy::GetWorldMatrixAndSize( unsigned int id, Matrix& worldMatrix, Vector3& size ) const
+bool UpdateProxy::BakeScale( uint32_t id, const Vector3& scale )
 {
-  const SceneGraph::Node* node = GetNodeWithId( id );
+  bool success = false;
+  SceneGraph::Node* node = GetNodeWithId( id );
   if( node )
   {
-    mTransformManager.GetWorldMatrixAndSize( node->mTransformId, worldMatrix, size );
+    mTransformManager.BakeVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_SCALE, scale );
+    success = true;
   }
+  return success;
 }
 
-const Matrix& UpdateProxy::GetWorldMatrix( unsigned int id ) const
+bool UpdateProxy::GetColor( uint32_t id, Vector4& color ) const
 {
-  const SceneGraph::Node* node = GetNodeWithId( id );
+  bool success = false;
+  SceneGraph::Node* node = GetNodeWithId( id );
   if( node )
   {
-    return mTransformManager.GetWorldMatrix( node->mTransformId );
+    color = node->mColor.Get( mCurrentBufferIndex );
+    success = true;
   }
 
-  return Matrix::IDENTITY;
+  return success;
 }
 
-void UpdateProxy::SetWorldMatrix( unsigned int id, const Matrix& worldMatrix )
+bool UpdateProxy::SetColor( uint32_t id, const Vector4& color ) const
 {
+  bool success = false;
   SceneGraph::Node* node = GetNodeWithId( id );
   if( node )
   {
-    Matrix& currentMatrix = mTransformManager.GetWorldMatrix( node->mTransformId );
-    currentMatrix = worldMatrix;
+    node->mColor.Set( mCurrentBufferIndex, color );
+    success = true;
   }
+  return success;
+}
+
+bool UpdateProxy::BakeColor( uint32_t id, const Vector4& color ) const
+{
+  bool success = false;
+  SceneGraph::Node* node = GetNodeWithId( id );
+  if( node )
+  {
+    node->mColor.Bake( mCurrentBufferIndex, color );
+    success = true;
+  }
+  return success;
+}
+
+void UpdateProxy::NodeHierarchyChanged()
+{
+  mLastCachedIdNodePair = { 0u, NULL };
+  mNodeContainer.clear();
 }
 
-SceneGraph::Node* UpdateProxy::GetNodeWithId( unsigned int id ) const
+SceneGraph::Node* UpdateProxy::GetNodeWithId( uint32_t id ) const
 {
   SceneGraph::Node* node = NULL;
 
index f730a75..44d97f6 100644 (file)
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/common/vector-wrapper.h>
+#include <cstdint>
 
 // INTERNAL INCLUDES
+#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/math/matrix.h>
 #include <dali/public-api/math/vector3.h>
 #include <dali/internal/common/buffer-index.h>
@@ -67,52 +68,67 @@ public:
   /**
    * @copydoc Dali::UpdateProxy::GetPosition()
    */
-  Vector3 GetPosition( unsigned int id ) const;
+  bool GetPosition( uint32_t id, Vector3& position) const;
 
   /**
    * @copydoc Dali::UpdateProxy::SetPosition()
    */
-  void SetPosition( unsigned int id, const Vector3& position );
+  bool SetPosition( uint32_t id, const Vector3& position );
+
+  /**
+   * @copydoc Dali::UpdateProxy::BakePosition()
+   */
+  bool BakePosition( uint32_t id, const Vector3& position );
 
   /**
    * @copydoc Dali::UpdateProxy::GetSize()
    */
-  const Vector3& GetSize( unsigned int id ) const;
+  bool GetSize( uint32_t id, Vector3& size ) const;
 
   /**
    * @copydoc Dali::UpdateProxy::SetSize()
    */
-  void SetSize( unsigned int id, const Vector3& size );
+  bool SetSize( uint32_t id, const Vector3& size );
+
+  /**
+   * @copydoc Dali::UpdateProxy::BakeSize()
+   */
+  bool BakeSize( uint32_t id, const Vector3& size );
 
   /**
    * @copydoc Dali::UpdateProxy::GetPositionAndSize()
    */
-  void GetPositionAndSize( unsigned int id, Vector3& position, Vector3& size ) const;
+  bool GetPositionAndSize( uint32_t id, Vector3& position, Vector3& size ) const;
 
   /**
-   * @copydoc Dali::UpdateProxy::GetColor()
+   * @copydoc Dali::UpdateProxy::GetScale()
    */
-  Vector4 GetWorldColor( unsigned int id ) const;
+  bool GetScale( uint32_t id, Vector3& scale ) const;
 
   /**
-   * @copydoc Dali::UpdateProxy::SetColor()
+   * @copydoc Dali::UpdateProxy::SetScale()
    */
-  void SetWorldColor( unsigned int id, const Vector4& color ) const;
+  bool SetScale( uint32_t id, const Vector3& scale );
 
   /**
-   * @copydoc Dali::UpdateProxy::GetWorldMatrixAndSize()
+   * @copydoc Dali::UpdateProxy::BakeScale()
    */
-  void GetWorldMatrixAndSize( unsigned int id, Matrix& worldMatrix, Vector3& size ) const;
+  bool BakeScale( uint32_t id, const Vector3& scale );
 
   /**
-   * @copydoc Dali::UpdateProxy::GetWorldMatrix()
+   * @copydoc Dali::UpdateProxy::GetColor()
+   */
+  bool GetColor( uint32_t id, Vector4& color ) const;
+
+  /**
+   * @copydoc Dali::UpdateProxy::SetColor()
    */
-  const Matrix& GetWorldMatrix( unsigned int id ) const;
+  bool SetColor( uint32_t id, const Vector4& color ) const;
 
   /**
-   * @copydoc Dali::UpdateProxy::SetWorldMatrix()
+   * @copydoc Dali::UpdateProxy::BakeColor()
    */
-  void SetWorldMatrix( unsigned int id, const Matrix& worldMatrix );
+  bool BakeColor( uint32_t id, const Vector4& color ) const;
 
   /**
    * @brief Retrieves the root-node used by this class
@@ -123,11 +139,20 @@ public:
     return mRootNode;
   }
 
+  /**
+   * @brief Sets the buffer index to use when processing the next callback.
+   * @param[in]  bufferIndex  The current buffer index
+   */
   void SetCurrentBufferIndex( BufferIndex bufferIndex )
   {
     mCurrentBufferIndex = bufferIndex;
   }
 
+  /**
+   * @brief Informs the update-proxy that the node hierarchy has changed.
+   */
+  void NodeHierarchyChanged();
+
 private:
 
   /**
@@ -136,7 +161,7 @@ private:
    * @return A pointer to the required node if found.
    * @note This caches the last accessed node.
    */
-  SceneGraph::Node* GetNodeWithId( unsigned int id ) const;
+  SceneGraph::Node* GetNodeWithId( uint32_t id ) const;
 
 private:
 
@@ -145,13 +170,13 @@ private:
    */
   struct IdNodePair
   {
-    unsigned int id; ///< The ID of the node
+    uint32_t id; ///< The ID of the node
     SceneGraph::Node* node; ///< The node itself
   };
 
   mutable std::vector< IdNodePair > mNodeContainer; ///< Used to store cached pointers to already searched for Nodes.
   mutable IdNodePair mLastCachedIdNodePair; ///< Used to cache the last retrieved id-node pair.
-  unsigned int mCurrentBufferIndex;
+  BufferIndex mCurrentBufferIndex;
 
   SceneGraph::TransformManager& mTransformManager; ///< Reference to the Transform Manager.
   SceneGraph::Node& mRootNode; ///< The root node of this update proxy.
index 131ba19..0c288f8 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SCENE_GRAPH_NODE_DECLARATIONS_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,6 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-vector.h>
+#include <dali/devel-api/common/bitwise-enum.h>
 #include <dali/devel-api/common/owner-container.h>
 #include <dali/internal/common/owner-pointer.h>
 
@@ -38,10 +39,27 @@ typedef Dali::Vector< Node* > NodeContainer;
 typedef NodeContainer::Iterator NodeIter;
 typedef NodeContainer::ConstIterator NodeConstIter;
 
+/**
+ * Flag whether property has changed, during the Update phase.
+ */
+enum class NodePropertyFlags : uint8_t
+// 8 bits is enough for 4 flags (compiler will check it)
+{
+  NOTHING          = 0x000,
+  TRANSFORM        = 0x001,
+  VISIBLE          = 0x002,
+  COLOR            = 0x004,
+  CHILD_DELETED    = 0x008,
+  ALL = ( CHILD_DELETED << 1 ) - 1 // all the flags
+};
+
 } // namespace SceneGraph
 
 } // namespace Internal
 
+// specialization has to be done in the same namespace
+template<> struct EnableBitMaskOperators< Internal::SceneGraph::NodePropertyFlags > { static const bool ENABLE = true; };
+
 } // namespace Dali
 
 #endif // __DALI_INTERNAL_SCENE_GRAPH_NODE_DECLARATIONS_H__
index 6c39e87..eaef08e 100755 (executable)
@@ -32,7 +32,7 @@ namespace //Unnamed namespace
 Dali::Internal::MemoryPoolObjectAllocator<Dali::Internal::SceneGraph::Node> gNodeMemoryPool;
 #ifdef DEBUG_ENABLED
 // keep track of nodes created / deleted, to ensure we have 0 when the process exits or DALi library is unloaded
-int gNodeCount =0;
+int32_t gNodeCount =0;
 
 // Called when the process is about to exit, Node count should be zero at this point.
 void __attribute__ ((destructor)) ShutDown(void)
@@ -54,8 +54,7 @@ namespace SceneGraph
 const PositionInheritanceMode Node::DEFAULT_POSITION_INHERITANCE_MODE( INHERIT_PARENT_POSITION );
 const ColorMode Node::DEFAULT_COLOR_MODE( USE_OWN_MULTIPLY_PARENT_ALPHA );
 
-
-Node* Node::New( unsigned int id )
+Node* Node::New( uint32_t id )
 {
   return new ( gNodeMemoryPool.AllocateRawThreadSafe() ) Node( id );
 }
@@ -78,7 +77,7 @@ void Node::Delete( Node* node )
   }
 }
 
-Node::Node( unsigned int id )
+Node::Node( uint32_t id )
 : mTransformManager( NULL ),
   mTransformId( INVALID_TRANSFORM_ID ),
   mParentOrigin( TRANSFORM_PROPERTY_PARENT_ORIGIN ),
@@ -103,8 +102,8 @@ Node::Node( unsigned int id )
   mClippingDepth( 0u ),
   mScissorDepth( 0u ),
   mDepthIndex( 0u ),
+  mDirtyFlags( NodePropertyFlags::ALL ),
   mRegenerateUniformMap( 0 ),
-  mDirtyFlags( AllFlags ),
   mDrawMode( DrawMode::NORMAL ),
   mColorMode( DEFAULT_COLOR_MODE ),
   mClippingMode( ClippingMode::DISABLED ),
@@ -184,14 +183,14 @@ void Node::RemoveUniformMapping( const std::string& uniformName )
 
 void Node::PrepareRender( BufferIndex bufferIndex )
 {
-  if(mRegenerateUniformMap != 0 )
+  if( mRegenerateUniformMap != 0 )
   {
     if( mRegenerateUniformMap == 2 )
     {
       CollectedUniformMap& localMap = mCollectedUniformMap[ bufferIndex ];
       localMap.Resize(0);
 
-      for( unsigned int i=0, count=mUniformMaps.Count(); i<count; ++i )
+      for( uint32_t i = 0, count=mUniformMaps.Count(); i<count; ++i )
       {
         localMap.PushBack( &mUniformMaps[i] );
       }
@@ -203,7 +202,7 @@ void Node::PrepareRender( BufferIndex bufferIndex )
 
       localMap.Resize( oldMap.Count() );
 
-      unsigned int index=0;
+      CollectedUniformMap::SizeType index = 0;
       for( CollectedUniformMap::Iterator iter = oldMap.Begin(), end = oldMap.End() ; iter != end ; ++iter, ++index )
       {
         localMap[index] = *iter;
@@ -258,22 +257,23 @@ void Node::DisconnectChild( BufferIndex updateBufferIndex, Node& childNode )
 
 void Node::AddRenderer( Renderer* renderer )
 {
-  // Check that it has not been already added.
-  unsigned int rendererCount( mRenderer.Size() );
-  for( unsigned int i(0); i < rendererCount; ++i )
-  {
-    if( mRenderer[i] == renderer )
-    {
-      // Renderer is already in the list.
-      return;
-    }
-  }
-
   // If it is the first renderer added, make sure the world transform will be calculated
   // in the next update as world transform is not computed if node has no renderers.
-  if( rendererCount == 0 )
+  if( mRenderer.Empty() )
   {
-    mDirtyFlags |= TransformFlag;
+    mDirtyFlags |= NodePropertyFlags::TRANSFORM;
+  }
+  else
+  {
+    // Check that it has not been already added.
+    for( auto&& existingRenderer : mRenderer )
+    {
+      if( existingRenderer == renderer )
+      {
+        // Renderer is already in the list.
+        return;
+      }
+    }
   }
 
   mRenderer.PushBack( renderer );
@@ -281,8 +281,8 @@ void Node::AddRenderer( Renderer* renderer )
 
 void Node::RemoveRenderer( Renderer* renderer )
 {
-  unsigned int rendererCount( mRenderer.Size() );
-  for( unsigned int i(0); i<rendererCount; ++i )
+  RendererContainer::SizeType rendererCount( mRenderer.Size() );
+  for( RendererContainer::SizeType i = 0; i < rendererCount; ++i )
   {
     if( mRenderer[i] == renderer )
     {
@@ -292,29 +292,39 @@ void Node::RemoveRenderer( Renderer* renderer )
   }
 }
 
-int Node::GetDirtyFlags() const
+NodePropertyFlags Node::GetDirtyFlags() const
 {
   // get initial dirty flags, they are reset ResetDefaultProperties, but setters may have made the node dirty already
-  int flags = mDirtyFlags;
+  NodePropertyFlags flags = mDirtyFlags;
 
   // Check whether the visible property has changed
   if ( !mVisible.IsClean() )
   {
-    flags |= VisibleFlag;
+    flags |= NodePropertyFlags::VISIBLE;
   }
 
   // Check whether the color property has changed
   if ( !mColor.IsClean() )
   {
-    flags |= ColorFlag;
+    flags |= NodePropertyFlags::COLOR;
   }
 
   return flags;
 }
 
+NodePropertyFlags Node::GetInheritedDirtyFlags( NodePropertyFlags parentFlags ) const
+{
+  // Size is not inherited. VisibleFlag is inherited
+  static const NodePropertyFlags InheritedDirtyFlags = NodePropertyFlags::TRANSFORM | NodePropertyFlags::VISIBLE | NodePropertyFlags::COLOR;
+  using UnderlyingType = typename std::underlying_type<NodePropertyFlags>::type;
+
+  return static_cast<NodePropertyFlags>( static_cast<UnderlyingType>( mDirtyFlags ) |
+                                         ( static_cast<UnderlyingType>( parentFlags ) & static_cast<UnderlyingType>( InheritedDirtyFlags ) ) );
+}
+
 void Node::ResetDirtyFlags( BufferIndex updateBufferIndex )
 {
-  mDirtyFlags = NothingFlag;
+  mDirtyFlags = NodePropertyFlags::NOTHING;
 }
 
 void Node::SetParent( Node& parentNode )
index f025726..903f8c2 100755 (executable)
@@ -57,30 +57,9 @@ class Layer;
 class RenderTask;
 class UpdateManager;
 
-/**
- * Flag whether property has changed, during the Update phase.
- */
-enum NodePropertyFlags
-{
-  NothingFlag          = 0x000,
-  TransformFlag        = 0x001,
-  VisibleFlag          = 0x002,
-  ColorFlag            = 0x004,
-  SizeFlag             = 0x008,
-  OverlayFlag          = 0x010,
-  SortModifierFlag     = 0x020,
-  ChildDeletedFlag     = 0x040,
-};
-
-static const int AllFlags = ( ChildDeletedFlag << 1 ) - 1; // all the flags
-
-/**
- * Size is not inherited. VisibleFlag is inherited
- */
-static const int InheritedDirtyFlags = TransformFlag | VisibleFlag | ColorFlag | OverlayFlag;
 
 // Flags which require the scene renderable lists to be updated
-static const int RenderableUpdateFlags = TransformFlag | SortModifierFlag | ChildDeletedFlag;
+static NodePropertyFlags RenderableUpdateFlags = NodePropertyFlags::TRANSFORM | NodePropertyFlags::CHILD_DELETED;
 
 /**
  * Node is the base class for all nodes in the Scene Graph.
@@ -104,7 +83,7 @@ public:
    * Construct a new Node.
    * @param[in] id The unique ID of the node
    */
-  static Node* New( unsigned int id );
+  static Node* New( uint32_t id );
 
   /**
    * Deletes a Node.
@@ -230,7 +209,7 @@ public:
    * Get the renderer at the given index
    * @param[in] index
    */
-  Renderer* GetRendererAt( unsigned int index ) const
+  Renderer* GetRendererAt( uint32_t index ) const
   {
     return mRenderer[index];
   }
@@ -238,9 +217,9 @@ public:
   /**
    * Retrieve the number of renderers for the node
    */
-  unsigned int GetRendererCount()
+  uint32_t GetRendererCount() const
   {
-    return mRenderer.Size();
+    return static_cast<uint32_t>( mRenderer.Size() );
   }
 
   // Containment methods
@@ -323,7 +302,7 @@ public:
    * Flag that one of the node values has changed in the current frame.
    * @param[in] flag The flag to set.
    */
-  void SetDirtyFlag(NodePropertyFlags flag)
+  void SetDirtyFlag( NodePropertyFlags flag )
   {
     mDirtyFlags |= flag;
   }
@@ -333,14 +312,22 @@ public:
    */
   void SetAllDirtyFlags()
   {
-    mDirtyFlags = AllFlags;
+    mDirtyFlags = NodePropertyFlags::ALL;
   }
 
   /**
    * Query whether a node is dirty.
    * @return The dirty flags
    */
-  int GetDirtyFlags() const;
+  NodePropertyFlags GetDirtyFlags() const;
+
+  /**
+   * Query inherited dirty flags.
+   *
+   * @param The parentFlags to or with
+   * @return The inherited dirty flags
+   */
+  NodePropertyFlags GetInheritedDirtyFlags( NodePropertyFlags parentFlags ) const;
 
   /**
    * Retrieve the parent-origin of the node.
@@ -586,11 +573,11 @@ public:
    * or inherits its parent color.
    * @param[in] colorMode The new color mode.
    */
-  void SetColorMode(ColorMode colorMode)
+  void SetColorMode( ColorMode colorMode )
   {
     mColorMode = colorMode;
 
-    SetDirtyFlag(ColorFlag);
+    SetDirtyFlag( NodePropertyFlags::COLOR );
   }
 
   /**
@@ -722,13 +709,19 @@ public:
    * @brief Sets the sibling order of the node
    * @param[in] order The new order
    */
-  void SetDepthIndex( unsigned int depthIndex ){ mDepthIndex = depthIndex; }
+  void SetDepthIndex( uint32_t depthIndex )
+  {
+    mDepthIndex = depthIndex;
+  }
 
   /**
    * @brief Get the depth index of the node
    * @return Current depth index
    */
-  unsigned int GetDepthIndex(){ return mDepthIndex; }
+  uint32_t GetDepthIndex()
+  {
+    return mDepthIndex;
+  }
 
   /**
    * @brief Sets the boolean which states whether the position should use the anchor-point.
@@ -808,7 +801,7 @@ protected:
    * Protected constructor; See also Node::New()
    * @param[in] id The Unique ID of the actor creating the node
    */
-  Node( unsigned int id );
+  Node( uint32_t id );
 
   /**
    * Protected virtual destructor; See also Node::Delete( Node* )
@@ -821,17 +814,17 @@ private: // from NodeDataProvider
   /**
    * @copydoc NodeDataProvider::GetModelMatrix
    */
-  virtual const Matrix& GetModelMatrix( unsigned int bufferId ) const
+  virtual const Matrix& GetModelMatrix( BufferIndex bufferIndex ) const
   {
-    return GetWorldMatrix( bufferId );
+    return GetWorldMatrix( bufferIndex );
   }
 
   /**
    * @copydoc NodeDataProvider::GetRenderColor
    */
-  virtual const Vector4& GetRenderColor( unsigned int bufferId ) const
+  virtual const Vector4& GetRenderColor( BufferIndex bufferIndex ) const
   {
-    return GetWorldColor( bufferId );
+    return GetWorldColor( bufferIndex );
   }
 
 public: // From UniformMapDataProvider
@@ -870,8 +863,8 @@ public: // Default properties
 
   TransformManager*                  mTransformManager;
   TransformId                        mTransformId;
-  TransformManagerPropertyVector3    mParentOrigin;           ///< Local transform; the position is relative to this. Sets the TransformFlag dirty when changed
-  TransformManagerPropertyVector3    mAnchorPoint;            ///< Local transform; local center of rotation. Sets the TransformFlag dirty when changed
+  TransformManagerPropertyVector3    mParentOrigin;           ///< Local transform; the position is relative to this. Sets the Transform flag dirty when changed
+  TransformManagerPropertyVector3    mAnchorPoint;            ///< Local transform; local center of rotation. Sets the Transform flag dirty when changed
   TransformManagerPropertyVector3    mSize;                   ///< Size is provided for layouting
   TransformManagerPropertyVector3    mPosition;               ///< Local transform; distance between parent-origin & anchor-point
   TransformManagerPropertyQuaternion mOrientation;            ///< Local transform; rotation relative to parent node
@@ -890,7 +883,7 @@ public: // Default properties
   InheritedColor                     mWorldColor;             ///< Full inherited color
 
   uint32_t                           mClippingSortModifier;   ///< Contains bit-packed clipping information for quick access when sorting
-  const unsigned int                 mId;                     ///< The Unique ID of the node.
+  const uint32_t                     mId;                     ///< The Unique ID of the node.
 
 protected:
 
@@ -902,15 +895,15 @@ protected:
   NodeContainer                      mChildren;               ///< Container of children; not owned
 
   CollectedUniformMap                mCollectedUniformMap[2]; ///< Uniform maps of the node
-  unsigned int                       mUniformMapChanged[2];   ///< Records if the uniform map has been altered this frame
+  uint32_t                           mUniformMapChanged[2];   ///< Records if the uniform map has been altered this frame
   uint32_t                           mClippingDepth;          ///< The number of stencil clipping nodes deep this node is
   uint32_t                           mScissorDepth;           ///< The number of scissor clipping nodes deep this node is
 
   uint32_t                           mDepthIndex;             ///< Depth index of the node
 
   // flags, compressed to bitfield
-  unsigned int                       mRegenerateUniformMap:2; ///< Indicate if the uniform map has to be regenerated this frame
-  int                                mDirtyFlags:8;           ///< A composite set of flags for each of the Node properties
+  NodePropertyFlags                  mDirtyFlags;             ///< Dirty flags for each of the Node properties
+  uint32_t                           mRegenerateUniformMap:2; ///< Indicate if the uniform map has to be regenerated this frame
   DrawMode::Type                     mDrawMode:3;             ///< How the Node and its children should be drawn
   ColorMode                          mColorMode:3;            ///< Determines whether mWorldColor is inherited, 2 bits is enough
   ClippingMode::Type                 mClippingMode:3;         ///< The clipping mode of this node
@@ -928,7 +921,7 @@ inline void SetInheritOrientationMessage( EventThreadServices& eventThreadServic
   typedef MessageValue1< Node, bool > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetInheritOrientation, inherit );
@@ -939,7 +932,7 @@ inline void SetParentOriginMessage( EventThreadServices& eventThreadServices, co
   typedef MessageValue1< Node, Vector3 > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetParentOrigin, origin );
@@ -950,7 +943,7 @@ inline void SetAnchorPointMessage( EventThreadServices& eventThreadServices, con
   typedef MessageValue1< Node, Vector3 > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetAnchorPoint, anchor );
@@ -961,7 +954,7 @@ inline void SetInheritPositionMessage( EventThreadServices& eventThreadServices,
   typedef MessageValue1< Node, bool > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetInheritPosition, inherit );
@@ -972,7 +965,7 @@ inline void SetInheritScaleMessage( EventThreadServices& eventThreadServices, co
   typedef MessageValue1< Node, bool > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetInheritScale, inherit );
@@ -983,7 +976,7 @@ inline void SetColorModeMessage( EventThreadServices& eventThreadServices, const
   typedef MessageValue1< Node, ColorMode > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetColorMode, colorMode );
@@ -994,7 +987,7 @@ inline void SetDrawModeMessage( EventThreadServices& eventThreadServices, const
   typedef MessageValue1< Node, DrawMode::Type > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetDrawMode, drawMode );
@@ -1005,7 +998,7 @@ inline void AddRendererMessage( EventThreadServices& eventThreadServices, const
   typedef MessageValue1< Node, Renderer* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::AddRenderer, renderer );
@@ -1016,18 +1009,18 @@ inline void RemoveRendererMessage( EventThreadServices& eventThreadServices, con
   typedef MessageValue1< Node, Renderer* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::RemoveRenderer, renderer );
 }
 
-inline void SetDepthIndexMessage( EventThreadServices& eventThreadServices, const Node& node, unsigned int depthIndex )
+inline void SetDepthIndexMessage( EventThreadServices& eventThreadServices, const Node& node, uint32_t depthIndex )
 {
-  typedef MessageValue1< Node, unsigned int > LocalType;
+  typedef MessageValue1< Node, uint32_t > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetDepthIndex, depthIndex );
@@ -1038,7 +1031,7 @@ inline void SetClippingModeMessage( EventThreadServices& eventThreadServices, co
   typedef MessageValue1< Node, ClippingMode::Type > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetClippingMode, clippingMode );
@@ -1049,7 +1042,7 @@ inline void SetPositionUsesAnchorPointMessage( EventThreadServices& eventThreadS
   typedef MessageValue1< Node, bool > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetPositionUsesAnchorPoint, positionUsesAnchorPoint );
index 56e6b9e..ad2df4b 100644 (file)
@@ -297,7 +297,7 @@ void Camera::Update( BufferIndex updateBufferIndex )
   {
     mUpdateViewFlag = UPDATE_COUNT;
   }
-  if( mNode->GetDirtyFlags() & VisibleFlag )
+  if( mNode->GetDirtyFlags() & NodePropertyFlags::VISIBLE )
   {
     // If the visibility changes, the projection matrix needs to be re-calculated.
     // It may happen the first time an actor is rendered it's rendered only once and becomes invisible,
index 0cd89e1..bfa73fd 100644 (file)
@@ -75,7 +75,7 @@ void Actor::SetName(const std::string& name)
   GetImplementation(*this).SetName(name);
 }
 
-unsigned int Actor::GetId() const
+uint32_t Actor::GetId() const
 {
   return GetImplementation(*this).GetId();
 }
@@ -115,12 +115,12 @@ void Actor::Unparent()
   GetImplementation(*this).Unparent();
 }
 
-unsigned int Actor::GetChildCount() const
+uint32_t Actor::GetChildCount() const
 {
   return GetImplementation(*this).GetChildCount();
 }
 
-Actor Actor::GetChildAt(unsigned int index) const
+Actor Actor::GetChildAt( uint32_t index ) const
 {
   Internal::ActorPtr child = GetImplementation(*this).GetChildAt( index );
   return Actor( child.Get() );
@@ -132,7 +132,7 @@ Actor Actor::FindChildByName(const std::string& actorName)
   return Actor( child.Get() );
 }
 
-Actor Actor::FindChildById(const unsigned int id)
+Actor Actor::FindChildById( const uint32_t id )
 {
   Internal::ActorPtr child = GetImplementation(*this).FindChildById( id );
   return Actor( child.Get() );
@@ -563,7 +563,7 @@ Vector2 Actor::GetMaximumSize()
   return Vector2( impl.GetMaximumSize( Dimension::WIDTH ), impl.GetMaximumSize( Dimension::HEIGHT ) );
 }
 
-int Actor::GetHierarchyDepth()
+int32_t Actor::GetHierarchyDepth()
 {
   return GetImplementation(*this).GetHierarchyDepth();
 }
@@ -600,17 +600,17 @@ Actor::OffStageSignalType& Actor::OffStageSignal()
   return GetImplementation(*this).OffStageSignal();
 }
 
-unsigned int Actor::AddRenderer( Renderer& renderer )
+uint32_t Actor::AddRenderer( Renderer& renderer )
 {
   return GetImplementation(*this).AddRenderer( GetImplementation( renderer ) );
 }
 
-unsigned int Actor::GetRendererCount() const
+uint32_t Actor::GetRendererCount() const
 {
   return GetImplementation(*this).GetRendererCount();
 }
 
-Renderer Actor::GetRendererAt( unsigned int index )
+Renderer Actor::GetRendererAt( uint32_t index )
 {
   Internal::RendererPtr renderer = GetImplementation(*this).GetRendererAt( index );
   return Renderer( renderer.Get() );
@@ -621,7 +621,7 @@ void Actor::RemoveRenderer( Renderer& renderer )
   GetImplementation(*this).RemoveRenderer( GetImplementation( renderer ) );
 }
 
-void Actor::RemoveRenderer( unsigned int index )
+void Actor::RemoveRenderer( uint32_t index )
 {
   GetImplementation(*this).RemoveRenderer( index );
 }
index ebb7a19..97756b0 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <string>
+#include <cstdint> // uint32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/actors/actor-enumerations.h>
@@ -417,7 +418,7 @@ public:
    * @return The ID
    * @pre The Actor has been initialized.
    */
-  unsigned int GetId() const;
+  uint32_t GetId() const;
 
   // Containment
 
@@ -503,7 +504,7 @@ public:
    * @return The number of children
    * @pre The Actor has been initialized.
    */
-  unsigned int GetChildCount() const;
+  uint32_t GetChildCount() const;
 
   /**
    * @brief Retrieve and child actor by index.
@@ -513,7 +514,7 @@ public:
    * @return The actor for the given index or empty handle if children not initialized
    * @pre The Actor has been initialized.
    */
-  Actor GetChildAt(unsigned int index) const;
+  Actor GetChildAt( uint32_t index ) const;
 
   /**
    * @brief Search through this actor's hierarchy for an actor with the given name.
@@ -535,7 +536,7 @@ public:
    * @return A handle to the actor if found, or an empty handle if not
    * @pre The Actor has been initialized.
    */
-  Actor FindChildById(const unsigned int id);
+  Actor FindChildById( const uint32_t id );
 
   /**
    * @brief Retrieves the actor's parent.
@@ -1458,7 +1459,7 @@ public:
    * @SINCE_1_0.0
    * @return The current depth in the hierarchy of the actor, or @c -1 if actor is not in the hierarchy
    */
-  int GetHierarchyDepth();
+  int32_t GetHierarchyDepth();
 
 public: // Renderer
 
@@ -1471,7 +1472,7 @@ public: // Renderer
    * @pre The renderer must be initialized.
    *
    */
-  unsigned int AddRenderer( Renderer& renderer );
+  uint32_t AddRenderer( Renderer& renderer );
 
   /**
    * @brief Gets the number of renderers on this actor.
@@ -1479,7 +1480,7 @@ public: // Renderer
    * @SINCE_1_0.0
    * @return The number of renderers on this actor
    */
-  unsigned int GetRendererCount() const;
+  uint32_t GetRendererCount() const;
 
   /**
    * @brief Gets a Renderer by index.
@@ -1490,7 +1491,7 @@ public: // Renderer
    * @pre The index must be between 0 and GetRendererCount()-1
    *
    */
-  Renderer GetRendererAt( unsigned int index );
+  Renderer GetRendererAt( uint32_t index );
 
   /**
    * @brief Removes a renderer from the actor.
@@ -1508,7 +1509,7 @@ public: // Renderer
    * @pre The index must be between 0 and GetRendererCount()-1
    *
    */
-  void RemoveRenderer( unsigned int index );
+  void RemoveRenderer( uint32_t index );
 
 public: // Signals
 
index d834606..f4cc9fe 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/object/property.h>
 #include <dali/public-api/object/ref-object.h>
@@ -106,7 +109,7 @@ public:
    * @endcode
    * @param[in] depth The depth in the hierarchy for the actor
    */
-  virtual void OnStageConnection( int depth ) = 0;
+  virtual void OnStageConnection( int32_t depth ) = 0;
 
   /**
    * @brief Called after the actor has been disconnected from Stage.
@@ -337,7 +340,7 @@ protected: // For derived classes
     LAST_ACTOR_FLAG                             ///< Special marker for last actor flag @SINCE_1_0.0
   };
 
-  static const int ACTOR_FLAG_COUNT = Log< LAST_ACTOR_FLAG - 1 >::value + 1;      ///< Value for deriving classes to continue on the flag enum
+  static const int32_t ACTOR_FLAG_COUNT = Log< LAST_ACTOR_FLAG - 1 >::value + 1;      ///< Value for deriving classes to continue on the flag enum
 
   /**
    * @brief Creates a CustomActorImpl.
index 029ee45..5e31ff7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -58,7 +58,7 @@ Layer& Layer::operator=(const Layer& rhs)
   return *this;
 }
 
-unsigned int Layer::GetDepth() const
+uint32_t Layer::GetDepth() const
 {
   return GetImplementation(*this).GetDepth();
 }
@@ -123,7 +123,7 @@ bool Layer::IsClipping() const
   return GetImplementation(*this).IsClipping();
 }
 
-void Layer::SetClippingBox(int x, int y, int width, int height)
+void Layer::SetClippingBox(int32_t x, int32_t y, int32_t width, int32_t height)
 {
   GetImplementation(*this).SetClippingBox(x, y, width, height);
 }
index c21e32f..15683cf 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/actors/actor.h>
@@ -43,7 +46,7 @@ class Layer;
  * @SINCE_1_0.0
  * @see Dali::Layer::SetClippingBox()
  */
-typedef Rect<int> ClippingBox;
+typedef Rect<int32_t> ClippingBox;
 
 /**
  * @brief Layers provide a mechanism for overlaying groups of actors on top of each other.
@@ -101,7 +104,7 @@ public:
     enum
     {
       CLIPPING_ENABLE = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX, ///< name "clippingEnable",   type bool @SINCE_1_0.0
-      CLIPPING_BOX,                                                 ///< name "clippingBox",      type Rect<int> @SINCE_1_0.0
+      CLIPPING_BOX,                                                 ///< name "clippingBox",      type Rect<int32_t> @SINCE_1_0.0
       BEHAVIOR,                                                     ///< name "behavior",         type String @SINCE_1_0.0
     };
   };
@@ -263,7 +266,7 @@ public:
    * @pre Layer is on the stage.
    * If layer is not added to the stage, returns 0.
    */
-  unsigned int GetDepth() const;
+  uint32_t GetDepth() const;
 
   /**
    * @brief Increments the depth of the layer.
@@ -391,7 +394,7 @@ public:
    * @param[in] width The width of the box
    * @param[in] height The height of the box
    */
-  void SetClippingBox(int x, int y, int width, int height);
+  void SetClippingBox(int32_t x, int32_t y, int32_t width, int32_t height);
 
   /**
    * @brief Sets the clipping box of a layer in window coordinates.
index 21133dc..28f7c41 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -25,10 +25,11 @@ namespace Dali
 
 namespace
 {
-constexpr unsigned int BitMaskOfN( unsigned int bits )
+constexpr uint32_t BitMaskOfN( uint32_t bits )
 {
   return ( 1 << bits ) - 1;
 }
+
 } // unnamed namespace
 
 AlphaFunction::AlphaFunction()
index 980223d..bd3ce98 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * 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.
@@ -79,17 +79,17 @@ void Animation::SetLooping(bool looping)
   GetImplementation(*this).SetLooping(looping);
 }
 
-void Animation::SetLoopCount(int count)
+void Animation::SetLoopCount(int32_t count)
 {
   GetImplementation(*this).SetLoopCount(count);
 }
 
-int Animation::GetLoopCount()
+int32_t Animation::GetLoopCount()
 {
   return GetImplementation(*this).GetLoopCount();
 }
 
-int Animation::GetCurrentLoop()
+int32_t Animation::GetCurrentLoop()
 {
   return GetImplementation(*this).GetCurrentLoop();
 }
index 50fb999..2fb2606 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/animation/alpha-function.h>
 #include <dali/public-api/animation/key-frames.h>
@@ -267,7 +270,7 @@ public:
    * @SINCE_1_1.20
    * @param[in] count The number of times to loop
    */
-  void SetLoopCount(int count);
+  void SetLoopCount(int32_t  count);
 
   /**
    * @brief Gets the loop count.
@@ -278,7 +281,7 @@ public:
    * @SINCE_1_1.20
    * @return The number of times to loop
    */
-  int GetLoopCount();
+  int32_t  GetLoopCount();
 
   /**
    * @brief Gets the current loop count.
@@ -288,7 +291,7 @@ public:
    * @SINCE_1_1.20
    * @return The current number of loops that have occured
    */
-  int GetCurrentLoop();
+  int32_t  GetCurrentLoop();
 
   /**
    * @brief Queries whether the animation will loop.
index 31f6fdc..4951c7e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -104,12 +104,12 @@ Constraint::RemoveAction Constraint::GetRemoveAction() const
   return GetImplementation(*this).GetRemoveAction();
 }
 
-void Constraint::SetTag( const unsigned int tag )
+void Constraint::SetTag( uint32_t tag )
 {
   GetImplementation(*this).SetTag( tag );
 }
 
-unsigned int Constraint::GetTag() const
+uint32_t Constraint::GetTag() const
 {
   return GetImplementation(*this).GetTag();
 }
index eaf4509..c2722fb 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/animation/constraint-source.h>
 #include <dali/public-api/common/dali-vector.h>
@@ -499,7 +502,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] tag An integer to identify the constraint
    */
-  void SetTag( const unsigned int tag );
+  void SetTag( uint32_t tag );
 
   /**
    * @brief Gets the tag.
@@ -507,7 +510,7 @@ public:
    * @SINCE_1_0.0
    * @return The tag
    */
-  unsigned int GetTag() const;
+  uint32_t GetTag() const;
 
 public: // Not intended for use by Application developers
 
index 14e362b..42d1331 100644 (file)
@@ -38,7 +38,7 @@ namespace Dali
 
 namespace
 {
-const int MAX_NUM_STACK_FRAMES = 25;
+const int32_t MAX_NUM_STACK_FRAMES = 25;
 }
 
 std::string Demangle(const char* symbol)
@@ -74,7 +74,7 @@ std::string Demangle(const char* symbol)
         mangledSymbol[tokenLength] = '\0';
 
         size_t size;
-        int    status;
+        int32_t    status;
         char*  demangled=NULL;
         demangled = abi::__cxa_demangle( mangledSymbol, NULL, &size, &status );
         if( demangled != NULL )
@@ -111,9 +111,9 @@ DALI_CORE_API DaliException::DaliException( const char* location, const char* co
   DALI_LOG_ERROR_NOFN("Backtrace:\n");
 
   void* frameArray[MAX_NUM_STACK_FRAMES];
-  int nSize = backtrace(frameArray, MAX_NUM_STACK_FRAMES);
+  int32_t nSize = backtrace(frameArray, MAX_NUM_STACK_FRAMES);
   char** symbols = backtrace_symbols(frameArray, nSize);
-  for(int i=1; i< nSize; i++)
+  for(int32_t i=1; i< nSize; i++)
   {
     std::string demangled_symbol = Demangle(symbols[i]);
     DALI_LOG_ERROR_NOFN("[%02d]   %s\n", i, demangled_symbol.c_str() );
index 2e2bd8f..31fad54 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * 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.
@@ -51,8 +51,7 @@ void VectorBase::Release()
   {
     // adjust pointer to real beginning
     SizeType* metadata = reinterpret_cast< SizeType* >( mData );
-    // TODO would be nice to memset to a bitpattern to catch illegal use of container after release
-    // but that would require knowledge of the itemsize
+
     delete [] ( metadata - 2u );
     mData = 0u;
   }
@@ -75,7 +74,7 @@ void VectorBase::Reserve( SizeType capacity, SizeType elementSize )
   if( capacity > oldCapacity )
   {
     const SizeType wholeAllocation = sizeof(SizeType) * 2u + capacity * elementSize;
-    void* wholeData = reinterpret_cast< void* >( new unsigned char[ wholeAllocation ] );
+    void* wholeData = reinterpret_cast< void* >( new uint8_t[ wholeAllocation ] );
     DALI_ASSERT_ALWAYS( wholeData && "VectorBase::Reserve - Memory allocation failed" );
 
 #if defined( DEBUG_ENABLED )
index 4140049..2b7b786 100755 (executable)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <cstddef>
 #include <algorithm>
+#include <cstdint> // uint32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
@@ -360,7 +361,7 @@ protected: // API for deriving classes
       std::size_t offset = at - reinterpret_cast<char*>( mData );
 
       // need more space
-      Reserve( NextPowerOfTwo( newCount ), elementSize ); // reserve enough space to store at least the next power of two elements of the new required size.
+      Reserve( NextPowerOfTwo( static_cast<uint32_t>( newCount ) ), elementSize ); // reserve enough space to store at least the next power of two elements of the new required size.
 
       // Set the new at pointer.
       at = reinterpret_cast<char*>( mData ) + offset;
index 13825ff..cf5c03a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -90,12 +90,12 @@ Vector2 Stage::GetSize() const
   return GetImplementation(*this).GetSize();
 }
 
-unsigned int Stage::GetLayerCount() const
+uint32_t Stage::GetLayerCount() const
 {
   return GetImplementation(*this).GetLayerCount();
 }
 
-Layer Stage::GetLayer(unsigned int depth) const
+Layer Stage::GetLayer(uint32_t depth) const
 {
   return GetImplementation(*this).GetLayer(depth);
 }
index 9ca8a9b..ede3983 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/signals/dali-signal.h>
@@ -198,7 +201,7 @@ public:
    * @SINCE_1_0.0
    * @return The number of layers
    */
-  unsigned int GetLayerCount() const;
+  uint32_t GetLayerCount() const;
 
   /**
    * @brief Retrieves the layer at a specified depth.
@@ -208,7 +211,7 @@ public:
    * @return The layer found at the given depth
    * @pre Depth is less than layer count; see GetLayerCount().
    */
-  Layer GetLayer(unsigned int depth) const;
+  Layer GetLayer(uint32_t depth) const;
 
   /**
    * @brief Returns the Stage's Root Layer.
index e4e25f2..6e7c58f 100644 (file)
@@ -26,9 +26,9 @@
 namespace Dali
 {
 
-const unsigned int CORE_MAJOR_VERSION = 1;
-const unsigned int CORE_MINOR_VERSION = 3;
-const unsigned int CORE_MICRO_VERSION = 45;
+const uint32_t CORE_MAJOR_VERSION = 1;
+const uint32_t CORE_MINOR_VERSION = 3;
+const uint32_t CORE_MICRO_VERSION = 46;
 const char * const CORE_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 5872984..e8658bb 100644 (file)
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 
 namespace Dali
 {
-DALI_CORE_API extern const unsigned int CORE_MAJOR_VERSION; ///< The major version number of the Core library.
-DALI_CORE_API extern const unsigned int CORE_MINOR_VERSION; ///< The minor version number of the Core library.
-DALI_CORE_API extern const unsigned int CORE_MICRO_VERSION; ///< The micro version number of the Core library.
+DALI_CORE_API extern const uint32_t CORE_MAJOR_VERSION; ///< The major version number of the Core library.
+DALI_CORE_API extern const uint32_t CORE_MINOR_VERSION; ///< The minor version number of the Core library.
+DALI_CORE_API extern const uint32_t CORE_MICRO_VERSION; ///< The micro version number of the Core library.
 DALI_CORE_API extern const char * const CORE_BUILD_DATE;    ///< The date/time the Core library was built.
 } // namespace Dali
 
index 08f1999..b866818 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/handle.h>
 
 namespace Dali
index bf93789..2696f7b 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 
@@ -112,7 +115,7 @@ struct DALI_CORE_API Gesture
   /**
    * @brief The time the gesture took place.
    */
-  unsigned int time;
+  uint32_t time;
 
 protected: // Creation
 
index 395a569..69f02e1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -38,12 +38,12 @@ HoverEvent::~HoverEvent()
 {
 }
 
-unsigned int HoverEvent::GetPointCount() const
+uint32_t HoverEvent::GetPointCount() const
 {
-  return points.size();
+  return static_cast<uint32_t>( points.size() );
 }
 
-const TouchPoint& HoverEvent::GetPoint(unsigned int point) const
+const TouchPoint& HoverEvent::GetPoint( uint32_t point ) const
 {
   DALI_ASSERT_ALWAYS( point < points.size() && "No point at index" );
   return points[point];
index ff7d719..e5c9f48 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/events/touch-point.h>
@@ -82,7 +85,7 @@ struct DALI_CORE_API HoverEvent
    * @SINCE_1_0.0
    * @return Total number of Points
    */
-  unsigned int GetPointCount() const;
+  uint32_t GetPointCount() const;
 
   /**
    * @brief Returns a touch point at the index requested.
@@ -95,7 +98,7 @@ struct DALI_CORE_API HoverEvent
    * @note "point" should be less than the value returned by GetPointCount().
    *       If out of range, then program asserts.
    */
-  const TouchPoint& GetPoint(unsigned int point) const;
+  const TouchPoint& GetPoint( uint32_t point) const;
 };
 
 /**
index aa5ba9a..30a1323 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * 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.
@@ -26,10 +26,10 @@ namespace Dali
 
 namespace
 {
-const unsigned int MODIFIER_SHIFT = 0x1;
-const unsigned int MODIFIER_CTRL  = 0x2;
-const unsigned int MODIFIER_ALT   = 0x4;
-const int KEY_INVALID_CODE = -1;
+const uint32_t MODIFIER_SHIFT = 0x1;
+const uint32_t MODIFIER_CTRL  = 0x2;
+const uint32_t MODIFIER_ALT   = 0x4;
+const int32_t KEY_INVALID_CODE = -1;
 }
 
 KeyEvent::KeyEvent()
@@ -43,7 +43,7 @@ KeyEvent::KeyEvent()
   new Internal::KeyEventImpl( this );
 }
 
-KeyEvent::KeyEvent(const std::string& keyName, const std::string& keyString, int keyCode, int keyModifier,unsigned long timeStamp, const State& keyState)
+KeyEvent::KeyEvent(const std::string& keyName, const std::string& keyString, int32_t keyCode, int32_t keyModifier,unsigned long timeStamp, const State& keyState)
 : keyPressedName(keyName),
   keyPressed(keyString),
   keyCode(keyCode),
index 8aaadad..336e737 100755 (executable)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <string>
+#include <cstdint> // int32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
@@ -79,7 +80,7 @@ struct DALI_CORE_API KeyEvent
    * @param[in] timeStamp The time (in ms) that the key event occurred
    * @param[in] keyState The state of the key event
    */
-  KeyEvent(const std::string& keyName, const std::string& keyString, int keyCode, int keyModifier, unsigned long timeStamp, const State& keyState);
+  KeyEvent(const std::string& keyName, const std::string& keyString, int32_t keyCode, int32_t keyModifier, unsigned long timeStamp, const State& keyState);
 
   /**
    * @brief Copy constructor.
@@ -180,12 +181,12 @@ struct DALI_CORE_API KeyEvent
    * platform-specific key code. You need to use IsKey() to know what a key event means
    * instead of direct comparison of key code value.
    */
-  int  keyCode;
+  int32_t keyCode;
 
   /**
    * @brief special keys like shift, alt and control which modify the next key pressed.
    */
-  int  keyModifier;
+  int32_t keyModifier;
 
   /**
    * @brief The time (in ms) that the key event occurred.
index d49e9b9..98c7ed3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -40,14 +40,14 @@ LongPressGestureDetector LongPressGestureDetector::New()
   return LongPressGestureDetector(internal.Get());
 }
 
-LongPressGestureDetector LongPressGestureDetector::New(unsigned int touchesRequired)
+LongPressGestureDetector LongPressGestureDetector::New(uint32_t touchesRequired)
 {
   Internal::LongPressGestureDetectorPtr internal = Internal::LongPressGestureDetector::New(touchesRequired);
 
   return LongPressGestureDetector(internal.Get());
 }
 
-LongPressGestureDetector LongPressGestureDetector::New(unsigned int minTouches, unsigned int maxTouches)
+LongPressGestureDetector LongPressGestureDetector::New(uint32_t minTouches, uint32_t maxTouches)
 {
   Internal::LongPressGestureDetectorPtr internal = Internal::LongPressGestureDetector::New(minTouches, maxTouches);
 
@@ -74,22 +74,22 @@ LongPressGestureDetector& LongPressGestureDetector::operator=(const LongPressGes
   return *this;
 }
 
-void LongPressGestureDetector::SetTouchesRequired(unsigned int touches)
+void LongPressGestureDetector::SetTouchesRequired(uint32_t touches)
 {
   GetImplementation(*this).SetTouchesRequired(touches);
 }
 
-void LongPressGestureDetector::SetTouchesRequired(unsigned int minTouches, unsigned int maxTouches)
+void LongPressGestureDetector::SetTouchesRequired(uint32_t minTouches, uint32_t maxTouches)
 {
   GetImplementation(*this).SetTouchesRequired(minTouches, maxTouches);
 }
 
-unsigned int LongPressGestureDetector::GetMinimumTouchesRequired() const
+uint32_t LongPressGestureDetector::GetMinimumTouchesRequired() const
 {
   return GetImplementation(*this).GetMinimumTouchesRequired();
 }
 
-unsigned int LongPressGestureDetector::GetMaximumTouchesRequired() const
+uint32_t LongPressGestureDetector::GetMaximumTouchesRequired() const
 {
   return GetImplementation(*this).GetMaximumTouchesRequired();
 }
index 111bbf2..3696df0 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/events/gesture-detector.h>
 #include <dali/public-api/signals/dali-signal.h>
@@ -92,7 +95,7 @@ public: // Creation & Destruction
    * @param[in] touchesRequired The number of touches required
    * @return A handle to a newly allocated Dali resource
    */
-  static LongPressGestureDetector New(unsigned int touchesRequired);
+  static LongPressGestureDetector New(uint32_t touchesRequired);
 
   /**
    * @brief Creates an initialized LongPressGestureDetector with the minimum and maximum number of touches required.
@@ -104,7 +107,7 @@ public: // Creation & Destruction
    * @param[in] maxTouches The maximum number of touches required
    * @return A handle to a newly allocated Dali resource
    */
-  static LongPressGestureDetector New(unsigned int minTouches, unsigned int maxTouches);
+  static LongPressGestureDetector New(uint32_t minTouches, uint32_t maxTouches);
 
   /**
    * @brief Downcasts a handle to LongPressGestureDetector handle.
@@ -156,7 +159,7 @@ public: // Setters
    * @pre The gesture detector has been initialized.
    * @note The default is '1'.
    */
-  void SetTouchesRequired(unsigned int touches);
+  void SetTouchesRequired(uint32_t touches);
 
   /**
    * @brief Sets the minimum and maximum touches required.
@@ -170,7 +173,7 @@ public: // Setters
    * @pre The gesture detector has been initialized.
    * @note The default is '1'.
    */
-  void SetTouchesRequired(unsigned int minTouches, unsigned int maxTouches);
+  void SetTouchesRequired(uint32_t minTouches, uint32_t maxTouches);
 
 public: // Getters
 
@@ -181,7 +184,7 @@ public: // Getters
    * @return The minimum number of touches required
    * @pre The gesture detector has been initialized.
    */
-  unsigned int GetMinimumTouchesRequired() const;
+  uint32_t GetMinimumTouchesRequired() const;
 
   /**
    * @brief Retrieves the maximum number of touches required.
@@ -190,7 +193,7 @@ public: // Getters
    * @return The maximum number of touches required
    * @pre The gesture detector has been initialized.
    */
-  unsigned int GetMaximumTouchesRequired() const;
+  uint32_t GetMaximumTouchesRequired() const;
 
 public: // Signals
 
index 414cc06..d994ea5 100644 (file)
@@ -79,7 +79,7 @@ struct DALI_CORE_API LongPressGesture : public Gesture
    * @brief The number of touch points in this long press gesture, i.e. the number of fingers the user had
    * on the screen to generate the long press gesture.
    */
-  unsigned int numberOfTouches;
+  uint32_t numberOfTouches;
 
   /**
    * @brief This is the point, in screen coordinates, where the long press occurred.
index 78ed53d..860e6a8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -68,22 +68,22 @@ PanGestureDetector& PanGestureDetector::operator=(const PanGestureDetector& rhs)
   return *this;
 }
 
-void PanGestureDetector::SetMinimumTouchesRequired(unsigned int minimum)
+void PanGestureDetector::SetMinimumTouchesRequired(uint32_t minimum)
 {
   GetImplementation(*this).SetMinimumTouchesRequired(minimum);
 }
 
-void PanGestureDetector::SetMaximumTouchesRequired(unsigned int maximum)
+void PanGestureDetector::SetMaximumTouchesRequired(uint32_t maximum)
 {
   GetImplementation(*this).SetMaximumTouchesRequired(maximum);
 }
 
-unsigned int PanGestureDetector::GetMinimumTouchesRequired() const
+uint32_t PanGestureDetector::GetMinimumTouchesRequired() const
 {
   return GetImplementation(*this).GetMinimumTouchesRequired();
 }
 
-unsigned int PanGestureDetector::GetMaximumTouchesRequired() const
+uint32_t PanGestureDetector::GetMaximumTouchesRequired() const
 {
   return GetImplementation(*this).GetMaximumTouchesRequired();
 }
index ec83a38..3f6449d 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/events/gesture-detector.h>
 #include <dali/public-api/object/property-index-ranges.h>
@@ -168,7 +171,7 @@ public: // Setters
    * @pre The gesture detector has been initialized.
    * @note The default minimum is '1'.
    */
-  void SetMinimumTouchesRequired(unsigned int minimum);
+  void SetMinimumTouchesRequired(uint32_t minimum);
 
   /**
    * @brief This is the maximum number of touches required for the pan gesture to be detected.
@@ -178,7 +181,7 @@ public: // Setters
    * @pre The gesture detector has been initialized.
    * @note The default maximum is '1'.
    */
-  void SetMaximumTouchesRequired(unsigned int maximum);
+  void SetMaximumTouchesRequired(uint32_t maximum);
 
 public: // Getters
 
@@ -189,7 +192,7 @@ public: // Getters
    * @return The minimum touches required
    * @pre The gesture detector has been initialized.
    */
-  unsigned int GetMinimumTouchesRequired() const;
+  uint32_t GetMinimumTouchesRequired() const;
 
   /**
    * @brief Retrieves the maximum number of touches required for the pan gesture to be detected.
@@ -198,7 +201,7 @@ public: // Getters
    * @return The maximum touches required
    * @pre The gesture detector has been initialized.
    */
-  unsigned int GetMaximumTouchesRequired() const;
+  uint32_t GetMaximumTouchesRequired() const;
 
 public: // Directional Panning
 
index d2fcb35..8c6dbfb 100644 (file)
@@ -140,7 +140,7 @@ struct DALI_CORE_API PanGesture: public Gesture
   /**
    * @brief The total number of fingers touching the screen in a pan gesture.
    */
-  unsigned int numberOfTouches;
+  uint32_t numberOfTouches;
 
   // Convenience Methods
 
index 9611496..e979fb7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -39,7 +39,7 @@ TapGestureDetector TapGestureDetector::New()
   return TapGestureDetector(internal.Get());
 }
 
-TapGestureDetector TapGestureDetector::New(unsigned int tapsRequired )
+TapGestureDetector TapGestureDetector::New(uint32_t tapsRequired )
 {
   Internal::TapGestureDetectorPtr internal = Internal::TapGestureDetector::New( tapsRequired );
 
@@ -66,22 +66,22 @@ TapGestureDetector& TapGestureDetector::operator=(const TapGestureDetector& rhs)
   return *this;
 }
 
-void TapGestureDetector::SetMinimumTapsRequired(unsigned int taps)
+void TapGestureDetector::SetMinimumTapsRequired(uint32_t taps)
 {
   GetImplementation(*this).SetMinimumTapsRequired(taps);
 }
 
-void TapGestureDetector::SetMaximumTapsRequired(unsigned int taps)
+void TapGestureDetector::SetMaximumTapsRequired(uint32_t taps)
 {
   GetImplementation(*this).SetMaximumTapsRequired(taps);
 }
 
-unsigned int TapGestureDetector::GetMinimumTapsRequired() const
+uint32_t TapGestureDetector::GetMinimumTapsRequired() const
 {
   return GetImplementation(*this).GetMinimumTapsRequired();
 }
 
-unsigned int TapGestureDetector::GetMaximumTapsRequired() const
+uint32_t TapGestureDetector::GetMaximumTapsRequired() const
 {
   return GetImplementation(*this).GetMaximumTapsRequired();
 }
index f51ebb4..0d2b829 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/events/gesture-detector.h>
 #include <dali/public-api/signals/dali-signal.h>
@@ -100,7 +103,7 @@ public: // Creation & Destruction
    * @param[in] tapsRequired The minimum & maximum number of taps required
    * @return A handle to a newly allocated Dali resource
    */
-  static TapGestureDetector New( unsigned int tapsRequired );
+  static TapGestureDetector New( uint32_t tapsRequired );
 
   /**
    * @brief Downcasts a handle to TapGestureDetector handle.
@@ -149,7 +152,7 @@ public: // Setters
    * @pre The gesture detector has been initialized.
    * @note The default is '1'.
    */
-  void SetMinimumTapsRequired( unsigned int minimumTaps );
+  void SetMinimumTapsRequired( uint32_t minimumTaps );
 
   /**
    * @brief Sets the maximum number of taps required.
@@ -160,7 +163,7 @@ public: // Setters
    * @pre The gesture detector has been initialized.
    * @note The default is '1'.
    */
-  void SetMaximumTapsRequired( unsigned int maximumTaps );
+  void SetMaximumTapsRequired( uint32_t maximumTaps );
 
 public: // Getters
 
@@ -171,7 +174,7 @@ public: // Getters
    * @return The minimum taps required
    * @pre The gesture detector has been initialized.
    */
-  unsigned int GetMinimumTapsRequired() const;
+  uint32_t GetMinimumTapsRequired() const;
 
   /**
    * @brief Retrieves the maximum number of taps required.
@@ -180,7 +183,7 @@ public: // Getters
    * @return The maximum taps required
    * @pre The gesture detector has been initialized.
    */
-  unsigned int GetMaximumTapsRequired() const;
+  uint32_t GetMaximumTapsRequired() const;
 
 public: // Signals
 
index e752400..6fc6852 100644 (file)
@@ -72,13 +72,13 @@ struct DALI_CORE_API TapGesture : public Gesture
   /**
    * @brief The number of taps in this tap gesture.
    */
-  unsigned int numberOfTaps;
+  uint32_t numberOfTaps;
 
   /**
    * @brief The number of touch points in this tap gesture, i.e. the number of fingers the user had on the
    * screen to generate the tap gesture.
    */
-  unsigned int numberOfTouches;
+  uint32_t numberOfTouches;
 
   /**
    * @brief This is the point, in screen coordinates, where the tap occurred.
index 2ec7411..9a3a821 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * 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.
@@ -41,12 +41,12 @@ TouchEvent::~TouchEvent()
 {
 }
 
-unsigned int TouchEvent::GetPointCount() const
+uint32_t TouchEvent::GetPointCount() const
 {
-  return points.size();
+  return static_cast<uint32_t>( points.size() );
 }
 
-const TouchPoint& TouchEvent::GetPoint(unsigned int point) const
+const TouchPoint& TouchEvent::GetPoint( uint32_t point ) const
 {
   DALI_ASSERT_ALWAYS( point < points.size() && "No point at index" );
   return points[point];
index 9ce558e..f4adbf8 100644 (file)
@@ -90,7 +90,7 @@ struct DALI_CORE_API TouchEvent
    * @SINCE_1_0.0
    * @return Total number of Points
    */
-  unsigned int GetPointCount() const DALI_DEPRECATED_API;
+  uint32_t GetPointCount() const DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.37
@@ -104,7 +104,7 @@ struct DALI_CORE_API TouchEvent
    * @note "point" should be less than the value returned by GetPointCount().
    *       If out of range, then program asserts.
    */
-  const TouchPoint& GetPoint(unsigned int point) const DALI_DEPRECATED_API;
+  const TouchPoint& GetPoint( uint32_t point ) const DALI_DEPRECATED_API;
 };
 
 /**
index dbc588d..41a3785 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -21,7 +21,7 @@
 namespace Dali
 {
 
-TouchPoint::TouchPoint(int id, State state, float screenX, float screenY)
+TouchPoint::TouchPoint(int32_t id, State state, float screenX, float screenY)
 : deviceId(id),
   state(state),
   local(screenX, screenY),
@@ -29,7 +29,7 @@ TouchPoint::TouchPoint(int id, State state, float screenX, float screenY)
 {
 }
 
-TouchPoint::TouchPoint(int id, State state, float screenX, float screenY, float localX, float localY)
+TouchPoint::TouchPoint(int32_t id, State state, float screenX, float screenY, float localX, float localY)
 : deviceId(id),
   state(state),
   local(localX, localY),
index 671ea4d..e6f099b 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/actors/actor.h>
@@ -69,7 +72,7 @@ struct DALI_CORE_API TouchPoint
    * @param[in] screenX The X co-ordinate relative to the screen's origin
    * @param[in] screenY The Y co-ordinate relative to the screen's origin
    */
-  TouchPoint(int id, State state, float screenX, float screenY);
+  TouchPoint(int32_t id, State state, float screenX, float screenY);
 
   /**
    * @brief Constructor.
@@ -82,7 +85,7 @@ struct DALI_CORE_API TouchPoint
    * @param[in] localX  The X co-ordinate relative to the top-left (0.0, 0.0, 0.5) of the actor
    * @param[in] localY  The Y co-ordinate relative to the top-left (0.0, 0.0, 0.5) of the actor
    */
-  TouchPoint(int id, State state, float screenX, float screenY, float localX, float localY);
+  TouchPoint(int32_t id, State state, float screenX, float screenY, float localX, float localY);
 
   /**
    * @brief Destructor.
@@ -95,7 +98,7 @@ struct DALI_CORE_API TouchPoint
   /**
    * @brief Each touch point has a unique device ID which specifies the touch device for that point.
    */
-  int deviceId;
+  int32_t deviceId;
 
   /**
    * @brief State of the point.
index 5bbb271..7494ef0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -23,9 +23,9 @@ namespace Dali
 
 namespace
 {
-const unsigned int MODIFIER_SHIFT = 0x1;
-const unsigned int MODIFIER_CTRL  = 0x2;
-const unsigned int MODIFIER_ALT   = 0x4;
+const uint32_t MODIFIER_SHIFT = 0x1;
+const uint32_t MODIFIER_CTRL  = 0x2;
+const uint32_t MODIFIER_ALT   = 0x4;
 
 }
 
@@ -39,7 +39,7 @@ WheelEvent::WheelEvent()
 {
 }
 
-WheelEvent::WheelEvent( Type type, int direction, unsigned int modifiers, Vector2 point, int z, unsigned int timeStamp )
+WheelEvent::WheelEvent( Type type, int32_t direction, uint32_t modifiers, Vector2 point, int32_t z, uint32_t timeStamp )
 : type( type ),
   direction( direction ),
   modifiers( modifiers ),
index a0edc8f..541b33e 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/math/vector2.h>
@@ -72,7 +75,7 @@ struct DALI_CORE_API WheelEvent
    * @param[in] z         The offset of rolling (positive value means roll down or clockwise, and negative value means roll up or counter-clockwise)
    * @param[in] timeStamp The time the wheel is being rolled
    */
-  WheelEvent( Type type, int direction, unsigned int modifiers, Vector2 point, int z, unsigned int timeStamp );
+  WheelEvent( Type type, int32_t direction, uint32_t modifiers, Vector2 point, int32_t z, uint32_t timeStamp );
 
   /**
    * @brief Destructor.
@@ -118,12 +121,12 @@ struct DALI_CORE_API WheelEvent
    *
    * 0 means the default vertical wheel, and 1 means horizontal wheel.
    */
-  int direction;
+  int32_t direction;
 
   /**
    * @brief Modifier keys pressed during the event (such as shift, alt and control).
    */
-  unsigned int modifiers;
+  uint32_t modifiers;
 
   /**
    * @brief The co-ordinates of the cursor relative to the top-left of the screen
@@ -135,12 +138,12 @@ struct DALI_CORE_API WheelEvent
    * @brief The offset of the wheel rolling, where positive value means rolling down or clockwise
    * and negative value means rolling up or counter-clockwise.
    */
-  int z;
+  int32_t z;
 
   /**
    * @brief The time when the wheel is being rolled.
    */
-  unsigned int timeStamp;
+  uint32_t timeStamp;
 
 };
 
index 6be47d3..205f4cc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -66,7 +66,7 @@ const BufferImage BufferImage::WHITE()
   return BufferImage(internal);
 }
 
-BufferImage BufferImage::New(unsigned int width, unsigned int height, Pixel::Format pixelformat)
+BufferImage BufferImage::New(uint32_t width, uint32_t height, Pixel::Format pixelformat)
 {
   DALI_ASSERT_ALWAYS( 0u != width  && "Invalid BufferImage width requested" );
   DALI_ASSERT_ALWAYS( 0u != height && "Invalid BufferImage height requested" );
@@ -75,7 +75,7 @@ BufferImage BufferImage::New(unsigned int width, unsigned int height, Pixel::For
   return BufferImage(internal.Get());
 }
 
-BufferImage BufferImage::New(PixelBuffer* pixBuf, unsigned int width, unsigned int height, Pixel::Format pixelformat, unsigned int stride)
+BufferImage BufferImage::New(PixelBuffer* pixBuf, uint32_t width, uint32_t height, Pixel::Format pixelformat, uint32_t stride)
 {
   DALI_ASSERT_ALWAYS( 0u != width  && "Invalid BufferImage width requested" );
   DALI_ASSERT_ALWAYS( 0u != height && "Invalid BufferImage height requested" );
@@ -89,12 +89,12 @@ PixelBuffer* BufferImage::GetBuffer()
   return GetImplementation(*this).GetBuffer();
 }
 
-unsigned int BufferImage::GetBufferSize() const
+uint32_t BufferImage::GetBufferSize() const
 {
   return GetImplementation(*this).GetBufferSize();
 }
 
-unsigned int BufferImage::GetBufferStride() const
+uint32_t BufferImage::GetBufferStride() const
 {
   return GetImplementation(*this).GetBufferStride();
 }
index 1515f11..a6d72ad 100644 (file)
@@ -35,8 +35,8 @@ namespace Internal DALI_INTERNAL
 class BufferImage;
 }
 
-typedef unsigned char         PixelBuffer;  ///< pixel data buffer @SINCE_1_0.0
-typedef Rect<unsigned int>    RectArea;     ///< rectangular area (x,y,w,h) @SINCE_1_0.0
+typedef uint8_t        PixelBuffer;  ///< pixel data buffer @SINCE_1_0.0
+typedef Rect<uint32_t> RectArea;     ///< rectangular area (x,y,w,h) @SINCE_1_0.0
 
 
 /**
@@ -84,8 +84,8 @@ public:
    * @note default resource management policies are Immediate and Never
    *
    */
-  static BufferImage New(unsigned int width,
-                         unsigned int height,
+  static BufferImage New(uint32_t width,
+                         uint32_t height,
                          Pixel::Format pixelformat=Pixel::RGBA8888) DALI_DEPRECATED_API;
 
   /**
@@ -113,10 +113,10 @@ public:
    * @pre width & height are greater than zero
    */
   static BufferImage New(PixelBuffer*  pixelBuffer,
-                         unsigned int  width,
-                         unsigned int  height,
+                         uint32_t  width,
+                         uint32_t  height,
                          Pixel::Format pixelFormat=Pixel::RGBA8888,
-                         unsigned int  stride=0) DALI_DEPRECATED_API;
+                         uint32_t  stride=0) DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_2.41
@@ -200,7 +200,7 @@ public:
    * @SINCE_1_0.0
    * @return The buffer size in bytes
    */
-  unsigned int GetBufferSize() const DALI_DEPRECATED_API;
+  uint32_t GetBufferSize() const DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_2.41
@@ -210,7 +210,7 @@ public:
    * @SINCE_1_0.0
    * @return The buffer stride
    */
-  unsigned int GetBufferStride() const DALI_DEPRECATED_API;
+  uint32_t GetBufferStride() const DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_2.41
index d160582..49893c5 100644 (file)
@@ -18,9 +18,6 @@
  *
  */
 
-// EXTERNAL INCLUDES
-#include <stdint.h>
-
 // INTERNAL INCLUDES
 #include <dali/public-api/images/image.h>
 #include <dali/public-api/images/image-operations.h>
index 5a97369..572ce79 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -51,12 +51,12 @@ FrameBufferImage& FrameBufferImage::operator=( const FrameBufferImage& rhs )
   return *this;
 }
 
-FrameBufferImage FrameBufferImage::New( unsigned int width, unsigned int height, Pixel::Format pixelformat, RenderBuffer::Format bufferformat )
+FrameBufferImage FrameBufferImage::New( uint32_t width, uint32_t height, Pixel::Format pixelformat, RenderBuffer::Format bufferformat )
 {
   Dali::Vector2 stageSize = Stage::GetCurrent().GetSize();
   Internal::FrameBufferImagePtr internal = Internal::FrameBufferImage::New(
-    (0 == width) ? stageSize.width : width,
-    (0 == height) ? stageSize.height : height,
+    (0 == width) ? static_cast<uint32_t>( stageSize.width ) : width,
+    (0 == height) ? static_cast<uint32_t>( stageSize.height ) : height,
     pixelformat,
     bufferformat);
 
index d7f4051..6230932 100644 (file)
@@ -91,7 +91,7 @@ public:
    * @return A handle to a new instance of a FrameBufferImage
    * @post When the FrameBufferImage is first used as a render target, an exception may be thrown if pixelFormat is not supported on the hardware platform.
    */
-  static FrameBufferImage New(unsigned int width = 0, unsigned int height = 0, Pixel::Format pixelFormat = Pixel::RGBA8888,
+  static FrameBufferImage New(uint32_t width = 0, uint32_t height = 0, Pixel::Format pixelFormat = Pixel::RGBA8888,
                               RenderBuffer::Format bufferFormat = RenderBuffer::COLOR) DALI_DEPRECATED_API;
 
   /**
index a512971..e5888ba 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -53,12 +53,12 @@ Image Image::DownCast( BaseHandle handle )
   return Image( dynamic_cast<Dali::Internal::Image*>(handle.GetObjectPtr()) );
 }
 
-unsigned int Image::GetWidth() const
+uint32_t Image::GetWidth() const
 {
   return GetImplementation(*this).GetWidth();
 }
 
-unsigned int Image::GetHeight() const
+uint32_t Image::GetHeight() const
 {
   return GetImplementation(*this).GetHeight();
 }
index 66af4ff..7c649a2 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <string>
+#include <cstdint> // uint32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/object/base-handle.h>
@@ -138,7 +139,7 @@ public:
    * @SINCE_1_0.0
    * @return Width of the image in pixels
    */
-  unsigned int GetWidth() const DALI_DEPRECATED_API;
+  uint32_t GetWidth() const DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_2.41
@@ -150,7 +151,7 @@ public:
    * @SINCE_1_0.0
    * @return Height of the image in pixels
    */
-  unsigned int GetHeight() const DALI_DEPRECATED_API;
+  uint32_t GetHeight() const DALI_DEPRECATED_API;
 
 public: // Signals
 
index ea18111..a3b4531 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTEGRATION_NATIVE_IMAGE_INTERFACE_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <cstddef>
+#include <cstdint> // uint32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/object/ref-object.h>
@@ -69,7 +70,7 @@ public:
    * @return A GL error code
    * @pre There is a GL context for the current thread.
    */
-  virtual unsigned int TargetTexture() = 0;
+  virtual uint32_t TargetTexture() = 0;
 
   /**
    * @brief Called internally for each Bind call for this texture to allow implementation specific operations.
@@ -86,7 +87,7 @@ public:
    * @SINCE_1_0.0
    * @return Width
    */
-  virtual unsigned int GetWidth() const = 0;
+  virtual uint32_t GetWidth() const = 0;
 
   /**
    * @brief Returns the height of the NativeImage.
@@ -94,7 +95,7 @@ public:
    * @SINCE_1_0.0
    * @return Height
    */
-  virtual unsigned int GetHeight() const = 0;
+  virtual uint32_t GetHeight() const = 0;
 
  /**
   * @brief Queries whether blending is required.
index 1432b5d..b4e7cb3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * 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.
  */
 
 // CLASS HEADER
-#include "pixel-data.h"
-
-// EXTERNAL INLCUDES
-#include <stdlib.h>
+#include <dali/public-api/images/pixel-data.h>
 
 // INTERNAL INCLUDES
 #include <dali/internal/event/images/pixel-data-impl.h>
 namespace Dali
 {
 
-PixelData PixelData::New(unsigned char* buffer,
-                         unsigned int bufferSize,
-                         unsigned int width,
-                         unsigned int height,
-                         Pixel::Format pixelFormat,
-                         ReleaseFunction releaseFunction)
+PixelData PixelData::New( uint8_t* buffer,
+                          uint32_t bufferSize,
+                          uint32_t width,
+                          uint32_t height,
+                          Pixel::Format pixelFormat,
+                          ReleaseFunction releaseFunction )
 {
   IntrusivePtr<Internal::PixelData> internal = Internal::PixelData::New( buffer, bufferSize, width, height, pixelFormat, releaseFunction );
   return PixelData( internal.Get() );
@@ -62,12 +59,12 @@ PixelData& PixelData::operator=(const PixelData& rhs)
   return *this;
 }
 
-unsigned int PixelData::GetWidth() const
+uint32_t PixelData::GetWidth() const
 {
   return GetImplementation(*this).GetWidth();
 }
 
-unsigned int PixelData::GetHeight() const
+uint32_t PixelData::GetHeight() const
 {
   return GetImplementation(*this).GetHeight();
 }
index 2347433..19ffe30 100644 (file)
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint8_t, uint32_t
+
+// INTERNAL INCLUDES
 #include <dali/public-api/images/pixel.h>
 #include <dali/public-api/object/base-handle.h>
 
@@ -62,10 +66,10 @@ public:
    * @param[in] releaseFunction The function used to release the memory
    * @return A handle to the PixelData
    */
-  static PixelData New( unsigned char* buffer,
-                        unsigned int bufferSize,
-                        unsigned int width,
-                        unsigned int height,
+  static PixelData New( uint8_t* buffer,
+                        uint32_t bufferSize,
+                        uint32_t width,
+                        uint32_t height,
                         Pixel::Format pixelFormat,
                         ReleaseFunction releaseFunction);
 
@@ -107,7 +111,7 @@ public:
    * @SINCE_1_1.43
    * @return The width of the buffer in pixels
    */
-  unsigned int GetWidth() const;
+  uint32_t GetWidth() const;
 
   /**
    * @brief Gets the height of the buffer in pixels.
@@ -115,7 +119,7 @@ public:
    * @SINCE_1_1.43
    * @return The height of the buffer in pixels
    */
-  unsigned int GetHeight() const;
+  uint32_t GetHeight() const;
 
   /**
    * @brief Gets the pixel format.
index 725d9e0..b50816f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * 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.
@@ -99,7 +99,7 @@ bool Pixel::HasAlpha(Format pixelformat)
   return false;
 }
 
-unsigned int Pixel::GetBytesPerPixel(Format pixelFormat)
+uint32_t Pixel::GetBytesPerPixel(Format pixelFormat)
 {
   switch (pixelFormat)
   {
index bb80167..f699af4 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 
@@ -144,7 +147,7 @@ DALI_CORE_API bool HasAlpha(Format pixelformat);
  * @param[in] pixelFormat The pixel format
  * @return The number of bytes per pixel
  */
-DALI_CORE_API unsigned int GetBytesPerPixel(Format pixelFormat);
+DALI_CORE_API uint32_t GetBytesPerPixel(Format pixelFormat);
 
 /**
  * @brief Returns the offset of the byte containing the alpha value from the start of the pixel data
index 1c70719..521d266 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_MATH_UTILS_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/common/constants.h>
@@ -38,9 +41,9 @@ namespace Dali
  * @param[in] i Input number
  * @return The next power of two or i itself in case it's a power of two
  */
-inline unsigned int NextPowerOfTwo( unsigned int i )
+inline uint32_t NextPowerOfTwo( uint32_t i )
 {
-  DALI_ASSERT_ALWAYS(i <= 1u << (sizeof(unsigned) * 8 - 1) && "Return type cannot represent the next power of two greater than the argument.");
+  DALI_ASSERT_ALWAYS(i <= 1u << (sizeof(uint32_t) * 8 - 1) && "Return type cannot represent the next power of two greater than the argument.");
   if(i==0u)
   {
     return 1u;
@@ -63,7 +66,7 @@ inline unsigned int NextPowerOfTwo( unsigned int i )
  * @param[in] i Input number
  * @return    True if i is power of two.
  */
-inline bool IsPowerOfTwo( unsigned int i )
+inline bool IsPowerOfTwo( uint32_t i )
 {
   return (i != 0u) && ((i & (i - 1u)) == 0u);
 }
@@ -131,7 +134,7 @@ inline float GetRangedEpsilon( float a, float b )
   const float absA = fabsf( a );
   const float absB = fabsf( b );
   const float absF = absA > absB ? absA : absB;
-  const int absI = absF;
+  const int32_t absI = static_cast<int32_t>( absF ); // truncated
 
   float epsilon = Math::MACHINE_EPSILON_10000;
   if (absF < 0.1f)
@@ -207,12 +210,12 @@ inline bool Equals( float a, float b, float epsilon )
  * @param[in] pos decimal place
  * @return a rounded float
  */
-inline float Round(float value, int pos)
+inline float Round( float value, int32_t pos )
 {
   float temp;
-  temp = value * powf( 10, pos );
-  temp = floorf( temp + 0.5 );
-  temp *= powf( 10, -pos );
+  temp = value * powf( 10.f, static_cast<float>( pos ) );
+  temp = floorf( temp + 0.5f );
+  temp *= powf( 10.f, static_cast<float>( -pos ) );
   return temp;
 }
 
@@ -334,7 +337,7 @@ inline float ShortestDistanceInDomain( float a, float b, float start, float end
  * @return -1 for negative values, +1 for positive values and 0 if value is 0
  */
 template <typename T>
-int Sign( T value )
+int32_t Sign( T value )
 {
   return ( T(0) < value ) - ( value < T(0) );
 }
index f21575b..81630cd 100644 (file)
@@ -192,9 +192,9 @@ static bool InvertMatrix(const float* m, float* out)
     return false;
   }
 
-  det = 1.0 / det;
+  det = 1.0f / det;
 
-  for (int i = 0; i < 16; i++)
+  for( int32_t i = 0; i < 16; i++)
   {
     out[i] = inv[i] * det;
   }
@@ -274,13 +274,13 @@ void Matrix::Multiply( Matrix& result, const Matrix& lhs, const Matrix& rhs )
 
 #ifndef  __ARM_NEON__
 
-  for( int i=0; i < 4; i++ )
+  for( int32_t i=0; i < 4; i++ )
   {
     // i<<2 gives the first vector / column
-    int loc = i<<2;
-    int loc1 = loc + 1;
-    int loc2 = loc + 2;
-    int loc3 = loc + 3;
+    int32_t loc = i<<2;
+    int32_t loc1 = loc + 1;
+    int32_t loc2 = loc + 2;
+    int32_t loc3 = loc + 3;
     float value0 = lhsPtr[loc];
     float value1 = lhsPtr[loc1];
     float value2 = lhsPtr[loc2];
@@ -360,13 +360,13 @@ void Matrix::Multiply( Matrix& result, const Matrix& lhs, const Quaternion& rhs
 
 #ifndef  __ARM_NEON__
 
-  for( int i=0; i < 4; i++ )
+  for( int32_t i=0; i < 4; i++ )
   {
     // i<<2 gives the first vector / column
-    int loc = i<<2;
-    int loc1 = loc + 1;
-    int loc2 = loc + 2;
-    int loc3 = loc + 3;
+    int32_t loc = i<<2;
+    int32_t loc1 = loc + 1;
+    int32_t loc2 = loc + 2;
+    int32_t loc3 = loc + 3;
     float value0 = lhsPtr[loc];
     float value1 = lhsPtr[loc1];
     float value2 = lhsPtr[loc2];
index 50f7903..acb274f 100644 (file)
@@ -136,8 +136,8 @@ bool Matrix3::Invert()
   // In the case where the determinant is exactly zero, the matrix is non-invertible
   if( ! EqualsZero( det ) )
   {
-    det = 1.0 / det;
-    for (int i = 0; i < 9; i++)
+    det = 1.0f / det;
+    for( int32_t i = 0; i < 9; i++ )
     {
       mElements[i] = cof[i] * det;
     }
@@ -237,11 +237,11 @@ void Matrix3::Multiply( Matrix3& result, const Matrix3& lhs, const Matrix3& rhs
   const float* rhsPtr  = rhs.AsFloat();
   const float* lhsPtr = lhs.AsFloat();
 
-  for( int i=0; i < 3; i++ )
+  for( int32_t i=0; i < 3; i++ )
   {
-    int loc = i * 3;
-    int loc1 = loc + 1;
-    int loc2 = loc + 2;
+    int32_t loc = i * 3;
+    int32_t loc1 = loc + 1;
+    int32_t loc2 = loc + 2;
 
     float value0 = lhsPtr[loc];
     float value1 = lhsPtr[loc1];
index 93db036..853cb09 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * 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.
@@ -470,7 +470,7 @@ float Quaternion::AngleBetween( const Quaternion& q1, const Quaternion& q2 )
   //Formula for angle Î¸ between two quaternion is:
   //θ = cos^−1 (2⟨q1,q2⟩^2 âˆ’ 1), Where (q1,q2) is inner product of the quaternions.
   float X = from.mVector.Dot4(to.mVector);
-  float theta = acos( (2 * X * X) - 1);
+  float theta = acosf( (2 * X * X) - 1); // float arc cosine
 
   return theta;
 }
index 2d5d237..1b08956 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_RANDOM_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * 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.
@@ -54,13 +54,13 @@ inline float Range(float f0, float f1)
   static bool initialized( false );
   if( !initialized )
   {
-    auto seed = time( NULL );
+    uint32_t seed = static_cast<uint32_t>( time( NULL ) );
     srand( seed );
     initialized = true;
   }
 
-  auto randValue = rand();
-  return (randValue & 0xfff) * (1.0f/4095.0f) * (max-min) + min;
+  int32_t randValue = rand();
+  return static_cast<float>(randValue & 0xfff) * (1.0f/4095.0f) * (max-min) + min;
 }
 
 /**
index 1ecd8f3..2d7df33 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
 #include <iosfwd>
 
 // INTERNAL INCLUDES
@@ -354,7 +355,7 @@ public:
    * @param[in] index Subscript index
    * @return The float at the given index
    */
-  const float& operator[](const unsigned int index) const
+  const float& operator[](const uint32_t index) const
   {
     DALI_ASSERT_ALWAYS( index < 2 && "Vector element index out of bounds" );
 
@@ -369,7 +370,7 @@ public:
    * @param[in] index Subscript index
    * @return The float at the given index
    */
-  float& operator[](const unsigned int index)
+  float& operator[](const uint32_t index)
   {
     DALI_ASSERT_ALWAYS( index < 2 && "Vector element index out of bounds" );
 
index 1d24444..1a98005 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
 #include <iosfwd>
 
 // INTERNAL INCLUDES
@@ -382,7 +383,7 @@ struct DALI_CORE_API Vector3
    * @param[in] index Subscript index
    * @return The float at the given index
    */
-  const float& operator[](const unsigned int index) const
+  const float& operator[](const uint32_t index) const
   {
     DALI_ASSERT_ALWAYS( index < 3 && "Vector element index out of bounds" );
 
@@ -397,7 +398,7 @@ struct DALI_CORE_API Vector3
    * @param[in] index Subscript index
    * @return The float at the given index
    */
-  float& operator[](const unsigned int index)
+  float& operator[](const uint32_t index)
   {
     DALI_ASSERT_ALWAYS( index < 3 && "Vector element index out of bounds" );
 
index 7516001..a42c55a 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
 #include <iosfwd>
 
 // INTERNAL INCLUDES
@@ -388,7 +389,7 @@ struct DALI_CORE_API Vector4
    * @param[in] index Subscript index
    * @return The float at the given index
    */
-  const float& operator[](const unsigned int index) const
+  const float& operator[](const uint32_t index) const
   {
     DALI_ASSERT_ALWAYS( index < 4 && "Vector element index out of bounds" );
 
@@ -403,7 +404,7 @@ struct DALI_CORE_API Vector4
    * @param[in] index Subscript index
    * @return The float at the given index
    */
-  float& operator[](const unsigned int index)
+  float& operator[](const uint32_t index)
   {
     DALI_ASSERT_ALWAYS( index < 4 && "Vector element index out of bounds" );
 
index cec1c15..b137a64 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_VIEWPORT_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // int32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/math/rect.h>
 
@@ -32,7 +35,7 @@ namespace Dali
  * @brief Typedef for a viewport ( a rectangle representing a screen area ).
  * @SINCE_1_0.0
  */
-typedef Rect<int> Viewport;
+typedef Rect<int32_t> Viewport;
 
 /**
  * @}
index 4752fc0..e3fac2a 100644 (file)
@@ -41,7 +41,7 @@ namespace Dali
  * Any floatVariable( 4.5f );
  * Any strVariable( std::string( "Hello world" ) );
  * uintVariable = 1u;
- * unsigned int variable = AnyCast< unsigned int >( uintVariable );
+ * uint32_t variable = AnyCast< uint32_t >( uintVariable );
  * if ( typeid( int ) == uintVariable.GetType() )
  * \endcode
  * @SINCE_1_0.0
index 9628240..f5a9171 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -75,7 +75,7 @@ bool Handle::Supports( Capability capability ) const
   return GetImplementation(*this).Supports( capability );
 }
 
-unsigned int Handle::GetPropertyCount() const
+uint32_t Handle::GetPropertyCount() const
 {
   return GetImplementation(*this).GetPropertyCount();
 }
@@ -168,7 +168,7 @@ void Handle::RemoveConstraints()
   GetImplementation(*this).RemoveConstraints();
 }
 
-void Handle::RemoveConstraints( unsigned int tag )
+void Handle::RemoveConstraints( uint32_t tag )
 {
   GetImplementation(*this).RemoveConstraints( tag );
 }
index a7fcb36..1894235 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <string>
+#include <cstdint> // uint32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
@@ -155,7 +156,7 @@ public:
    * @SINCE_1_0.0
    * @return The number of properties
    */
-  unsigned int GetPropertyCount() const;
+  uint32_t GetPropertyCount() const;
 
   /**
    * @brief Queries the name of a property.
@@ -390,7 +391,7 @@ public:
    * @param[in] tag The tag of the constraints which will be removed
    * @pre The Object has been initialized.
    */
-  void RemoveConstraints( unsigned int tag );
+  void RemoveConstraints( uint32_t tag );
 };
 
 /**
index eca8182..7fe8447 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -105,7 +105,7 @@ Property::Array& Property::Array::operator=( const Property::Array& other )
 std::ostream& operator<<( std::ostream& stream, const Property::Array& array )
 {
   stream << "Array(" << array.Count() << ") = [";
-  for( unsigned int i=0; i<array.Count(); ++i )
+  for( Property::Array::SizeType i=0; i<array.Count(); ++i )
   {
     if( i>0 )
     {
index ebd95a8..675d910 100644 (file)
@@ -327,7 +327,7 @@ std::ostream& operator<<( std::ostream& stream, const Property::Map& map )
 {
   stream << "Map(" << map.Count() << ") = {";
 
-  int count = 0;
+  int32_t count = 0;
   // Output the String-Value pairs
   for ( StringValueContainer::iterator iter = map.mImpl->mStringValueContainer.begin(), endIter = map.mImpl->mStringValueContainer.end(); iter != endIter; ++iter )
   {
index 67264ae..f9ac88c 100644 (file)
@@ -41,7 +41,7 @@ const char* const PROPERTY_TYPE_NAMES[] =
   "MAP",
   "EXTENTS",
 };
-const unsigned int PROPERTY_TYPE_NAMES_COUNT = sizeof( PROPERTY_TYPE_NAMES ) / sizeof( const char* );
+const uint32_t PROPERTY_TYPE_NAMES_COUNT = static_cast<uint32_t>( sizeof( PROPERTY_TYPE_NAMES ) / sizeof( const char* ) );
 }
 
 namespace PropertyTypes
index 6c3738d..e02e8ce 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * 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.
@@ -68,7 +68,7 @@ struct Property::Value::Impl
     floatValue( floatValue )
   { }
 
-  Impl( int integerValue )
+  Impl( int32_t integerValue )
   : type( Property::INTEGER ),
     integerValue( integerValue )
   { }
@@ -119,7 +119,7 @@ struct Property::Value::Impl
   {
   }
 
-  Impl( const Rect<int>& rectValue )
+  Impl( const Rect<int32_t>& rectValue )
   : type( Property::RECTANGLE ),
     rectValue( new Rect<int>( rectValue ) )
   {
@@ -220,7 +220,7 @@ public: // Data
   Type type;
   union
   {
-    int integerValue;
+    int32_t integerValue;
     float floatValue;
     // must use pointers for any class value pre c++ 11
     Vector2* vector2Value;
@@ -230,7 +230,7 @@ public: // Data
     Matrix* matrixValue;
     AngleAxis* angleAxisValue;
     std::string* stringValue;
-    Rect<int>* rectValue;
+    Rect<int32_t>* rectValue;
     Property::Array* arrayValue;
     Property::Map* mapValue;
     Extents* extentsValue;
@@ -257,7 +257,7 @@ Property::Value::Value( float floatValue )
 {
 }
 
-Property::Value::Value( int integerValue )
+Property::Value::Value( int32_t integerValue )
 : mImpl( new Impl( integerValue ) )
 {
 }
@@ -372,7 +372,7 @@ Property::Value::Value( Type type )
     }
     case Property::RECTANGLE:
     {
-      mImpl = new Impl( Rect<int>(0,0,0,0) );
+      mImpl = new Impl( Rect<int32_t>(0,0,0,0) );
       break;
     }
     case Property::ROTATION:
@@ -663,7 +663,7 @@ bool Property::Value::Get( int& integerValue ) const
     }
     else if( mImpl->type == FLOAT )
     {
-      integerValue = static_cast< int >( mImpl->floatValue );
+      integerValue = static_cast< int32_t >( mImpl->floatValue );
       converted = true;
     }
   }
index 4cb607e..b054810 100755 (executable)
@@ -71,7 +71,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] integerValue An integer value
    */
-  Value( int integerValue );
+  Value( int32_t integerValue );
 
   /**
    * @brief Creates a float property value.
@@ -127,7 +127,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] vectorValue A vector of 4 integer values
    */
-  Value( const Rect<int>& vectorValue );
+  Value( const Rect<int32_t>& vectorValue );
 
   /**
    * @brief Creates an orientation property value.
@@ -270,7 +270,7 @@ public:
    * @return @c true if the value is successfully retrieved, @c false if the type is not convertible
    * @pre GetType() is a type convertible to int.
    */
-  bool Get( int& integerValue ) const;
+  bool Get( int32_t& integerValue ) const;
 
   /**
    * @brief Retrieves an integer rectangle.
@@ -280,7 +280,7 @@ public:
    * @return @c true if the value is successfully retrieved, @c false if the type is not convertible
    * @pre GetType() is a type convertible to Rect<int>.
    */
-  bool Get( Rect<int>& rect ) const;
+  bool Get( Rect<int32_t>& rect ) const;
 
   /**
    * @brief Retrieves a vector value.
index ba6cf7d..1ac8453 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -24,9 +24,9 @@
 namespace Dali
 {
 
-const int Property::INVALID_INDEX           = -1;
-const int Property::INVALID_KEY             = -1;
-const int Property::INVALID_COMPONENT_INDEX = -1;
+const int32_t Property::INVALID_INDEX           = -1;
+const int32_t Property::INVALID_KEY             = -1;
+const int32_t Property::INVALID_COMPONENT_INDEX = -1;
 
 Property::Property(Handle& obj, Property::Index propIndex)
 : object(obj),
@@ -35,7 +35,7 @@ Property::Property(Handle& obj, Property::Index propIndex)
 {
 }
 
-Property::Property(Handle& obj, Property::Index propIndex, int compIndex)
+Property::Property(Handle& obj, Property::Index propIndex, int32_t compIndex)
 : object(obj),
   propertyIndex(propIndex),
   componentIndex(compIndex)
@@ -50,7 +50,7 @@ Property::Property(Handle& obj, const std::string& propertyName)
   propertyIndex = object.GetPropertyIndex( propertyName );
 }
 
-Property::Property(Handle& obj, const std::string& propertyName, int compIndex)
+Property::Property(Handle& obj, const std::string& propertyName, int32_t compIndex)
 : object(obj),
   propertyIndex(Property::INVALID_INDEX),
   componentIndex(compIndex)
index 54bf2ec..60236e9 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <string>
 #include <utility>
+#include <cstdint> // int32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
@@ -45,11 +46,11 @@ struct DALI_CORE_API Property
    * @brief A valid property index is zero or greater.
    * @SINCE_1_0.0
    */
-  typedef int Index;
+  typedef int32_t Index;
 
-  static const int INVALID_INDEX; ///< -1 is not a valid property index
-  static const int INVALID_KEY;   ///< -1 is not a valid property key
-  static const int INVALID_COMPONENT_INDEX; ///< -1 is not a valid property index
+  static const int32_t INVALID_INDEX; ///< -1 is not a valid property index
+  static const int32_t INVALID_KEY;   ///< -1 is not a valid property key
+  static const int32_t INVALID_COMPONENT_INDEX; ///< -1 is not a valid property index
 
   typedef Dali::Vector< Index > IndexContainer; ///< A vector of property indices @SINCE_1_0.0
 
@@ -128,7 +129,7 @@ struct DALI_CORE_API Property
    * @param[in] propertyIndex The index of a property.
    * @param[in] componentIndex Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for main property (default is -1)
    */
-  Property( Handle& object, Property::Index propertyIndex, int componentIndex );
+  Property( Handle& object, Property::Index propertyIndex, int32_t componentIndex );
 
   /**
    * @brief Creates a Property instance.
@@ -151,7 +152,7 @@ struct DALI_CORE_API Property
    * @note This performs a property index query and is therefore slower than
    * constructing a Property directly with the index.
    */
-  Property( Handle& object, const std::string& propertyName, int componentIndex );
+  Property( Handle& object, const std::string& propertyName, int32_t componentIndex );
 
   /**
    * @brief Non-virtual destructor; Property is not intended as a base class.
@@ -163,7 +164,7 @@ struct DALI_CORE_API Property
 
   Index propertyIndex; ///< The index of a property provided by object.
 
-  int componentIndex; ///< Index of a property sub component, for use with Vector2, Vector3 and Vector4, -1 if using main property
+  int32_t componentIndex; ///< Index of a property sub component, for use with Vector2, Vector3 and Vector4, -1 if using main property
 };
 
 /**
index 3060f4b..cdd3546 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -161,7 +161,7 @@ void RefObject::Unreference()
   }
 }
 
-int RefObject::ReferenceCount()
+uint32_t RefObject::ReferenceCount()
 {
   return mCount;
 }
index 3ead400..553a1fe 100644 (file)
@@ -19,6 +19,9 @@
  */
 
 // EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
+// INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/common/intrusive-ptr.h>
 
@@ -62,7 +65,7 @@ public:
    * @SINCE_1_0.0
    * @return The reference count
    */
-  int ReferenceCount();
+  uint32_t ReferenceCount();
 
 protected:
 
@@ -101,7 +104,7 @@ protected:
 
 private:
 
-  volatile int mCount; ///< Reference count
+  volatile uint32_t mCount; ///< Reference count
 };
 
 /**
index ed1bb70..40686c9 100644 (file)
@@ -149,7 +149,7 @@ AnimatablePropertyRegistration::AnimatablePropertyRegistration( TypeRegistration
   Internal::TypeRegistry::Get()->RegisterAnimatableProperty( registered, name, index, value );
 }
 
-AnimatablePropertyComponentRegistration::AnimatablePropertyComponentRegistration( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Index baseIndex, unsigned int componentIndex)
+AnimatablePropertyComponentRegistration::AnimatablePropertyComponentRegistration( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Index baseIndex, uint32_t componentIndex)
 {
   DALI_ASSERT_ALWAYS( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) );
 
index 89d28bd..7f5715d 100644 (file)
@@ -21,6 +21,7 @@
 
 // EXTERNAL INCLUDES
 #include <typeinfo>
+#include <cstdint> // uint32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/object/base-handle.h>
@@ -378,7 +379,7 @@ public:
    * @param[in] componentIndex The index of the component (e.g. 0 for the x component of a Vector2 property and 1 for the y component of a Vector2 property)
    * @pre "registered" must be registered with the TypeRegistry.
    */
-  AnimatablePropertyComponentRegistration( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Index baseIndex, unsigned int componentIndex );
+  AnimatablePropertyComponentRegistration( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Index baseIndex, uint32_t componentIndex );
 };
 
 /**
index 7bd754b..8f8359c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -58,12 +58,12 @@ void RenderTaskList::RemoveTask( RenderTask task )
   GetImplementation(*this).RemoveTask( task );
 }
 
-unsigned int RenderTaskList::GetTaskCount() const
+uint32_t RenderTaskList::GetTaskCount() const
 {
   return GetImplementation(*this).GetTaskCount();
 }
 
-RenderTask RenderTaskList::GetTask( unsigned int index ) const
+RenderTask RenderTaskList::GetTask( uint32_t index ) const
 {
   return GetImplementation(*this).GetTask( index );
 }
index 7f4b557..47bcb7a 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/object/base-handle.h>
 
@@ -113,7 +116,7 @@ public:
    * @SINCE_1_0.0
    * @return The number of render-tasks
    */
-  unsigned int GetTaskCount() const;
+  uint32_t GetTaskCount() const;
 
   /**
    * @brief Retrieves a render-task.
@@ -123,7 +126,7 @@ public:
    * @return A handle to the render-task
    * @pre index should be in range i.e. less than GetTaskCount().
    */
-  RenderTask GetTask( unsigned int index ) const;
+  RenderTask GetTask( uint32_t index ) const;
 
 public: // Not intended for application developers
 
index b9545ab..099a0ad 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * 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.
@@ -43,12 +43,12 @@ static bool FullScreenFrameBufferFunction( Vector2& coordinates )
 RenderTask::ConstScreenToFrameBufferFunction RenderTask::DEFAULT_SCREEN_TO_FRAMEBUFFER_FUNCTION = DefaultScreenToFrameBufferFunction;
 RenderTask::ConstScreenToFrameBufferFunction RenderTask::FULLSCREEN_FRAMEBUFFER_FUNCTION        = FullScreenFrameBufferFunction;
 
-const bool         RenderTask::DEFAULT_EXCLUSIVE     = false;
-const bool         RenderTask::DEFAULT_INPUT_ENABLED = true;
-const Vector4      RenderTask::DEFAULT_CLEAR_COLOR   = Vector4( 0.0f, 0.0f, 0.0f, 1.0f ); // cannot use Color::Black because it may or may not be initialized yet
-const bool         RenderTask::DEFAULT_CLEAR_ENABLED = false;
-const bool         RenderTask::DEFAULT_CULL_MODE     = true;
-const unsigned int RenderTask::DEFAULT_REFRESH_RATE  = REFRESH_ALWAYS;
+const bool     RenderTask::DEFAULT_EXCLUSIVE     = false;
+const bool     RenderTask::DEFAULT_INPUT_ENABLED = true;
+const Vector4  RenderTask::DEFAULT_CLEAR_COLOR   = Vector4( 0.0f, 0.0f, 0.0f, 1.0f ); // cannot use Color::Black because it may or may not be initialized yet
+const bool     RenderTask::DEFAULT_CLEAR_ENABLED = false;
+const bool     RenderTask::DEFAULT_CULL_MODE     = true;
+const uint32_t RenderTask::DEFAULT_REFRESH_RATE  = REFRESH_ALWAYS;
 
 RenderTask::RenderTask()
 {
@@ -241,12 +241,12 @@ bool RenderTask::GetCullMode() const
   return GetImplementation(*this).GetCullMode();
 }
 
-void RenderTask::SetRefreshRate( unsigned int refreshRate )
+void RenderTask::SetRefreshRate( uint32_t refreshRate )
 {
   GetImplementation(*this).SetRefreshRate( refreshRate );
 }
 
-unsigned int RenderTask::GetRefreshRate() const
+uint32_t RenderTask::GetRefreshRate() const
 {
   return GetImplementation(*this).GetRefreshRate();
 }
index 6ca2b06..064f535 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/math/viewport.h>
 #include <dali/public-api/object/handle.h>
@@ -171,12 +174,12 @@ public:
     REFRESH_ALWAYS = 1  ///< Process every frame. @SINCE_1_0.0
   };
 
-  static const bool         DEFAULT_EXCLUSIVE;     ///< false
-  static const bool         DEFAULT_INPUT_ENABLED; ///< true
-  static const Vector4      DEFAULT_CLEAR_COLOR;   ///< Color::BLACK
-  static const bool         DEFAULT_CLEAR_ENABLED; ///< false
-  static const bool         DEFAULT_CULL_MODE;     ///< true
-  static const unsigned int DEFAULT_REFRESH_RATE;  ///< REFRESH_ALWAYS
+  static const bool     DEFAULT_EXCLUSIVE;     ///< false
+  static const bool     DEFAULT_INPUT_ENABLED; ///< true
+  static const Vector4  DEFAULT_CLEAR_COLOR;   ///< Color::BLACK
+  static const bool     DEFAULT_CLEAR_ENABLED; ///< false
+  static const bool     DEFAULT_CULL_MODE;     ///< true
+  static const uint32_t DEFAULT_REFRESH_RATE;  ///< REFRESH_ALWAYS
 
   /**
    * @brief Creates an empty RenderTask handle.
@@ -473,14 +476,14 @@ public:
    * @SINCE_1_0.0
    * @param[in] refreshRate The new refresh rate
    */
-  void SetRefreshRate( unsigned int refreshRate );
+  void SetRefreshRate( uint32_t refreshRate );
 
   /**
    * @brief Queries the refresh-rate of the RenderTask.
    * @SINCE_1_0.0
    * @return The refresh-rate
    */
-  unsigned int GetRefreshRate() const;
+  uint32_t GetRefreshRate() const;
 
   /**
    * @brief Gets viewport coordinates for given world position.
index af6b8e1..607a79b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * 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.
@@ -25,7 +25,7 @@
 namespace Dali
 {
 
-FrameBuffer FrameBuffer::New( unsigned int width, unsigned int height, unsigned int attachments )
+FrameBuffer FrameBuffer::New( uint32_t width, uint32_t height, uint32_t attachments )
 {
   Internal::FrameBufferPtr frameBuffer = Internal::FrameBuffer::New( width, height, attachments );
   return FrameBuffer( frameBuffer.Get() );
@@ -65,7 +65,7 @@ void FrameBuffer::AttachColorTexture( Texture& texture )
   AttachColorTexture( texture, 0u, 0u );
 }
 
-void FrameBuffer::AttachColorTexture( Texture& texture, unsigned int mipmapLevel, unsigned int layer )
+void FrameBuffer::AttachColorTexture( Texture& texture, uint32_t mipmapLevel, uint32_t layer )
 {
   if( texture )
   {
index 9663d55..30c5e6d 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/rendering/texture.h>
@@ -72,7 +75,7 @@ public:
    * @param[in] attachments The attachments comprising the format of the FrameBuffer (the type is int to allow multiple bitmasks to be ORd)
    * @return A handle to a newly allocated FrameBuffer
    */
-  static FrameBuffer New( unsigned int width, unsigned int height, unsigned int attachments );
+  static FrameBuffer New( uint32_t width, uint32_t height, uint32_t attachments );
 
   /**
    * @brief Default constructor, creates an empty handle.
@@ -133,7 +136,7 @@ public:
    * @note The specified texture mipmap has to have the same size than the FrameBuffer
    * otherwise it won't be attached.
    */
-  void AttachColorTexture( Texture& texture, unsigned int mipmapLevel, unsigned int layer );
+  void AttachColorTexture( Texture& texture, uint32_t mipmapLevel, uint32_t layer );
 
   /**
    * @brief Gets the color texture used as output in the FrameBuffer.
index 43dfb0d..81b9e8e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * 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.
@@ -70,7 +70,7 @@ void Geometry::RemoveVertexBuffer( std::size_t index )
   GetImplementation(*this).RemoveVertexBuffer( index );
 }
 
-void Geometry::SetIndexBuffer( const unsigned short* indices, size_t count )
+void Geometry::SetIndexBuffer( const uint16_t* indices, size_t count )
 {
   GetImplementation(*this).SetIndexBuffer( indices, count );
 }
index 1c1732e..70c94c9 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <cstddef> // std::size_t
+#include <cstdint> // uint16_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/object/handle.h> // Dali::Handle
@@ -144,7 +145,7 @@ public:
    * @param[in] indices Array of indices
    * @param[in] count Number of indices in the array
    */
-  void SetIndexBuffer( const unsigned short* indices, size_t count );
+  void SetIndexBuffer( const uint16_t* indices, size_t count );
 
   /**
    * @brief Sets the type of primitives this geometry contains.
index b62e5e6..75e2b0c 100644 (file)
@@ -58,7 +58,7 @@ PropertyBuffer& PropertyBuffer::operator=( const PropertyBuffer& handle )
 
 void PropertyBuffer::SetData( const void* data, std::size_t size )
 {
-  GetImplementation(*this).SetData( data, size );
+  GetImplementation(*this).SetData( data, static_cast<uint32_t>( size ) ); // only support 4,294,967,295 bytes
 }
 
 std::size_t PropertyBuffer::GetSize() const
index ca8b913..fb51a13 100644 (file)
@@ -56,7 +56,7 @@ class PropertyBuffer;
  *  texturedQuadVertices.SetData( texturedQuadVertexData, 4 );
  *
  *  // Create indices
- *  unsigned int indexData[6] = { 0, 3, 1, 0, 2, 3 };
+ *  uint32_t indexData[6] = { 0, 3, 1, 0, 2, 3 };
  *
  *  // Create the geometry object
  *  Geometry texturedQuadGeometry = Geometry::New();
index 261e597..cc48b11 100644 (file)
@@ -61,17 +61,17 @@ void TextureSet::SetTexture( size_t index, Texture texture )
   if( texture )
   {
     Internal::TexturePtr texturePtr( &GetImplementation( texture ) );
-    GetImplementation(*this).SetTexture( index, texturePtr );
+    GetImplementation(*this).SetTexture( static_cast<uint32_t>( index ), texturePtr ); // only support 4,294,967,295 textures
   }
   else
   {
-    GetImplementation(*this).SetTexture( index, NULL );
+    GetImplementation(*this).SetTexture( static_cast<uint32_t>( index ), NULL ); // only support 4,294,967,295 textures
   }
 }
 
 Texture TextureSet::GetTexture( size_t index ) const
 {
-  Internal::Texture* texturePtr = GetImplementation(*this).GetTexture( index );
+  Internal::Texture* texturePtr = GetImplementation(*this).GetTexture( static_cast<uint32_t>( index ) ); // only support 4,294,967,295 textures
   return Dali::Texture( texturePtr );
 }
 
@@ -80,17 +80,17 @@ void TextureSet::SetSampler( size_t index, Sampler sampler )
   if( sampler )
   {
     Internal::SamplerPtr samplerPtr( &GetImplementation( sampler ) );
-    GetImplementation(*this).SetSampler( index, samplerPtr );
+    GetImplementation(*this).SetSampler( static_cast<uint32_t>( index ), samplerPtr ); // only support 4,294,967,295 samplers
   }
   else
   {
-    GetImplementation(*this).SetSampler( index, NULL );
+    GetImplementation(*this).SetSampler( static_cast<uint32_t>( index ), NULL ); // only support 4,294,967,295 samplers
   }
 }
 
 Sampler TextureSet::GetSampler( size_t index ) const
 {
-  Internal::Sampler* samplerPtr = GetImplementation(*this).GetSampler( index );
+  Internal::Sampler* samplerPtr = GetImplementation(*this).GetSampler( static_cast<uint32_t>( index ) ); // only support 4,294,967,295 samplers
   return Dali::Sampler( samplerPtr );
 }
 
index 79720cf..f23a3f2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * 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.
@@ -26,7 +26,7 @@
 namespace Dali
 {
 
-Texture Texture::New( TextureType::Type type, Pixel::Format format, unsigned int width, unsigned int height )
+Texture Texture::New( TextureType::Type type, Pixel::Format format, uint32_t width, uint32_t height )
 {
   Internal::TexturePtr texture = Internal::Texture::New(type, format, width, height );
   return Texture( texture.Get() );
@@ -69,9 +69,9 @@ bool Texture::Upload( PixelData pixelData )
 }
 
 bool Texture::Upload( PixelData pixelData,
-               unsigned int layer, unsigned int mipmap,
-               unsigned int xOffset, unsigned int yOffset,
-               unsigned int width, unsigned int height )
+               uint32_t layer, uint32_t mipmap,
+               uint32_t xOffset, uint32_t yOffset,
+               uint32_t width, uint32_t height )
 {
   Internal::PixelData& internalPixelData = GetImplementation( pixelData );
   return GetImplementation(*this).Upload( &internalPixelData, layer, mipmap, xOffset, yOffset, width, height );
@@ -82,12 +82,12 @@ void Texture::GenerateMipmaps()
   return GetImplementation(*this).GenerateMipmaps();
 }
 
-unsigned int Texture::GetWidth() const
+uint32_t Texture::GetWidth() const
 {
   return GetImplementation(*this).GetWidth();
 }
 
-unsigned int Texture::GetHeight() const
+uint32_t Texture::GetHeight() const
 {
   return GetImplementation(*this).GetHeight();
 }
index bbf2e67..3569904 100644 (file)
@@ -55,12 +55,12 @@ namespace CubeMapLayer
    * These constants should be used as the "layer" parameter when uploading a cube-map with Texture::Upload.
    * @SINCE_1_1.43
    */
-  const unsigned int POSITIVE_X = 0u; ///< CubeMap image for +x @SINCE_1_1.43
-  const unsigned int NEGATIVE_X = 1u; ///< CubeMap image for -x @SINCE_1_1.43
-  const unsigned int POSITIVE_Y = 2u; ///< CubeMap image for +y @SINCE_1_1.43
-  const unsigned int NEGATIVE_Y = 3u; ///< CubeMap image for -y @SINCE_1_1.43
-  const unsigned int POSITIVE_Z = 4u; ///< CubeMap image for +z @SINCE_1_1.43
-  const unsigned int NEGATIVE_Z = 5u; ///< CubeMap image for -z @SINCE_1_1.43
+  const uint32_t POSITIVE_X = 0u; ///< CubeMap image for +x @SINCE_1_1.43
+  const uint32_t NEGATIVE_X = 1u; ///< CubeMap image for -x @SINCE_1_1.43
+  const uint32_t POSITIVE_Y = 2u; ///< CubeMap image for +y @SINCE_1_1.43
+  const uint32_t NEGATIVE_Y = 3u; ///< CubeMap image for -y @SINCE_1_1.43
+  const uint32_t POSITIVE_Z = 4u; ///< CubeMap image for +z @SINCE_1_1.43
+  const uint32_t NEGATIVE_Z = 5u; ///< CubeMap image for -z @SINCE_1_1.43
 
 } // namespace CubeMapLayer
 
@@ -83,7 +83,7 @@ public:
    * @param[in] height The height of the texture
    * @return A handle to a newly allocated Texture
    */
-  static Texture New( TextureType::Type type, Pixel::Format format, unsigned int width, unsigned int height );
+  static Texture New( TextureType::Type type, Pixel::Format format, uint32_t width, uint32_t height );
 
   /**
    * @brief Creates a new Texture object from a native image.
@@ -161,9 +161,9 @@ public:
    * @return True if the PixelData object has compatible pixel format and fits in the rectangle specified, false otherwise
    */
   bool Upload( PixelData pixelData,
-               unsigned int layer, unsigned int mipmap,
-               unsigned int xOffset, unsigned int yOffset,
-               unsigned int width, unsigned int height );
+               uint32_t layer, uint32_t mipmap,
+               uint32_t xOffset, uint32_t yOffset,
+               uint32_t width, uint32_t height );
 
   /**
    * @brief Generates mipmaps for the texture.
@@ -179,7 +179,7 @@ public:
    * @SINCE_1_1.43
    * @return The width, in pixels, of the texture
    */
-  unsigned int GetWidth() const;
+  uint32_t GetWidth() const;
 
   /**
    * @brief Returns the height of the texture.
@@ -187,7 +187,7 @@ public:
    * @SINCE_1_1.43
    * @return The height, in pixels, of the texture
    */
-  unsigned int GetHeight() const;
+  uint32_t GetHeight() const;
 
 public:
 
index c84393a..b03f9d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -27,7 +27,7 @@
 namespace
 {
 
-const int INVALID_CALLBACK_INDEX = -1;
+const int32_t INVALID_CALLBACK_INDEX = -1;
 
 } // unnamed namespace
 
@@ -120,7 +120,7 @@ void BaseSignal::OnConnect( CallbackBase* callback )
 {
   DALI_ASSERT_ALWAYS( NULL != callback && "Invalid member function pointer passed to Connect()" );
 
-  int index = FindCallback( callback );
+  int32_t index = FindCallback( callback );
 
   // Don't double-connect the same callback
   if( INVALID_CALLBACK_INDEX == index )
@@ -141,7 +141,7 @@ void BaseSignal::OnDisconnect( CallbackBase* callback )
 {
   DALI_ASSERT_ALWAYS( NULL != callback && "Invalid member function pointer passed to Disconnect()" );
 
-  int index = FindCallback( callback );
+  int32_t index = FindCallback( callback );
 
   if( index > INVALID_CALLBACK_INDEX )
   {
@@ -157,7 +157,7 @@ void BaseSignal::OnConnect( ConnectionTrackerInterface* tracker, CallbackBase* c
   DALI_ASSERT_ALWAYS( NULL != tracker  && "Invalid ConnectionTrackerInterface pointer passed to Connect()" );
   DALI_ASSERT_ALWAYS( NULL != callback && "Invalid member function pointer passed to Connect()" );
 
-  int index = FindCallback( callback );
+  int32_t index = FindCallback( callback );
 
   // Don't double-connect the same callback
   if( INVALID_CALLBACK_INDEX == index )
@@ -182,7 +182,7 @@ void BaseSignal::OnDisconnect( ConnectionTrackerInterface* tracker, CallbackBase
   DALI_ASSERT_ALWAYS( NULL != tracker  && "Invalid ConnectionTrackerInterface pointer passed to Disconnect()" );
   DALI_ASSERT_ALWAYS( NULL != callback && "Invalid member function pointer passed to Disconnect()" );
 
-  int index = FindCallback( callback );
+  int32_t index = FindCallback( callback );
 
   if( index > INVALID_CALLBACK_INDEX )
   {
@@ -239,23 +239,22 @@ CallbackBase* BaseSignal::GetCallback( std::size_t connectionIndex ) const
   return callback;
 }
 
-int BaseSignal::FindCallback( CallbackBase* callback )
+int32_t BaseSignal::FindCallback( CallbackBase* callback )
 {
-  int index( INVALID_CALLBACK_INDEX );
+  int32_t index( INVALID_CALLBACK_INDEX );
 
   // A signal can have multiple slots connected to it.
   // We need to search for the slot which has the same call back function (if it's static)
   // Or the same object / member function (for non-static)
-  const std::size_t count( mSignalConnections.Count() );
-  for( std::size_t i=0; i < count; ++i )
+  const std::size_t count = mSignalConnections.Count();
+  for( std::size_t i = 0; i < count; ++i )
   {
     const CallbackBase* connectionCallback = GetCallback( i );
 
     // Note that values are set to NULL in DeleteConnection
-    if( connectionCallback &&
-        ( *connectionCallback == *callback ) )
+    if( connectionCallback && ( *connectionCallback == *callback ) )
     {
-      index = i;
+      index = static_cast<int>( i ); // only 2,147,483,647 connections supported, no error check
       break;
     }
   }
index 159cc6e..5de0137 100755 (executable)
@@ -494,7 +494,7 @@ private:
    * @param[in] callback The call back object
    * @return A valid index if the callback is connected
    */
-  int FindCallback( CallbackBase* callback );
+  int32_t FindCallback( CallbackBase* callback );
 
   /**
    * @brief Deletes a connection object from the list of connections.
index 1497d54..ea40508 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali
 Summary:    DALi 3D Engine
-Version:    1.3.45
+Version:    1.3.46
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT