Merge "Flexbox UI control implementation" into devel/master
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Tue, 19 Apr 2016 16:01:21 +0000 (09:01 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Tue, 19 Apr 2016 16:01:21 +0000 (09:01 -0700)
25 files changed:
automated-tests/src/dali-toolkit-internal/CMakeLists.txt
automated-tests/src/dali-toolkit/CMakeLists.txt
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/mesh-builder.cpp [new file with mode: 0644]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/mesh-builder.h [new file with mode: 0644]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.cpp [new file with mode: 0644]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.h [new file with mode: 0644]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-intrusive-ptr.h [new file with mode: 0644]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.h
automated-tests/src/dali-toolkit/utc-Dali-Builder.cpp
automated-tests/src/dali-toolkit/utc-Dali-DefaultControls.cpp [deleted file]
automated-tests/src/dali-toolkit/utc-Dali-ItemLayout.cpp
automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp
automated-tests/src/dali-toolkit/utc-Dali-KeyInputFocusManager.cpp
automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp
dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp
dali-toolkit/public-api/controls/scrollable/scrollable.h

index 7696421..f1ca98f 100644 (file)
@@ -20,27 +20,35 @@ SET(TC_SOURCES
 
 # Append list of test harness files (Won't get parsed for test cases)
 LIST(APPEND TC_SOURCES
-   ../dali-toolkit/dali-toolkit-test-utils/test-harness.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-accessibility-adaptor.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-application.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/toolkit-event-thread-callback.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-imf-manager.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-orientation.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-physical-keyboard.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-singleton-service.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-timer.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-text-model.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/toolkit-timer.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/toolkit-tts-player.cpp
    ../dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/mesh-builder.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/test-actor-utils.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/test-animation-data.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-application.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/test-button.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/test-harness.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-gesture-manager.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-gl-sync-abstraction.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-render-controller.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp
 )
 
 
@@ -65,6 +73,7 @@ INCLUDE_DIRECTORIES(
 ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
 TARGET_LINK_LIBRARIES(${EXEC_NAME}
     ${${CAPI_LIB}_LIBRARIES}
+    -lpthread
 )
 
 INSTALL(PROGRAMS ${EXEC_NAME}
index ca2aaee..27d7fec 100644 (file)
@@ -36,7 +36,6 @@ SET(TC_SOURCES
    utc-Dali-Button.cpp
    utc-Dali-Control.cpp
    utc-Dali-ControlImpl.cpp
-   utc-Dali-DefaultControls.cpp
    utc-Dali-AccessibilityManager.cpp
    utc-Dali-ItemLayout.cpp
    utc-Dali-ItemView.cpp
@@ -58,28 +57,32 @@ SET(TC_SOURCES
 
 # Append list of test harness files (Won't get parsed for test cases)
 LIST(APPEND TC_SOURCES
-   dali-toolkit-test-utils/test-harness.cpp
    dali-toolkit-test-utils/toolkit-accessibility-adaptor.cpp
    dali-toolkit-test-utils/toolkit-application.cpp
    dali-toolkit-test-utils/toolkit-clipboard.cpp
+   dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp
    dali-toolkit-test-utils/toolkit-event-thread-callback.cpp
    dali-toolkit-test-utils/toolkit-environment-variable.cpp
    dali-toolkit-test-utils/toolkit-imf-manager.cpp
+   dali-toolkit-test-utils/toolkit-orientation.cpp
    dali-toolkit-test-utils/toolkit-physical-keyboard.cpp
    dali-toolkit-test-utils/toolkit-style-monitor.cpp
    dali-toolkit-test-utils/toolkit-singleton-service.cpp
+   dali-toolkit-test-utils/toolkit-text-model.cpp
    dali-toolkit-test-utils/toolkit-timer.cpp
-   dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp
    dali-toolkit-test-utils/toolkit-tts-player.cpp
-   dali-toolkit-test-utils/dummy-control.cpp
    dali-toolkit-test-utils/dali-test-suite-utils.cpp
+   dali-toolkit-test-utils/dummy-control.cpp
+   dali-toolkit-test-utils/mesh-builder.cpp
+   dali-toolkit-test-utils/test-actor-utils.cpp
    dali-toolkit-test-utils/test-animation-data.cpp
-   dali-toolkit-test-utils/test-button.cpp
    dali-toolkit-test-utils/test-application.cpp
-   dali-toolkit-test-utils/test-platform-abstraction.cpp
+   dali-toolkit-test-utils/test-button.cpp
+   dali-toolkit-test-utils/test-harness.cpp
    dali-toolkit-test-utils/test-gesture-manager.cpp
    dali-toolkit-test-utils/test-gl-abstraction.cpp
    dali-toolkit-test-utils/test-gl-sync-abstraction.cpp
+   dali-toolkit-test-utils/test-platform-abstraction.cpp
    dali-toolkit-test-utils/test-render-controller.cpp
    dali-toolkit-test-utils/test-trace-call-stack.cpp
    dali-toolkit-test-utils/test-native-image.cpp
index c521fbf..baeaa6a 100644 (file)
@@ -29,6 +29,7 @@ void tet_infoline(const char*str);
 void tet_printf(const char *format, ...);
 
 #include "test-application.h"
+#include "test-actor-utils.h"
 
 using namespace Dali;
 
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/mesh-builder.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/mesh-builder.cpp
new file mode 100644 (file)
index 0000000..304e567
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2015 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 "mesh-builder.h"
+
+namespace Dali
+{
+
+Shader CreateShader()
+{
+  return Shader::New( "vertexSrc", "fragmentSrc" );
+}
+
+TextureSet CreateTextureSet()
+{
+  return TextureSet::New();
+}
+TextureSet CreateTextureSet( Image image )
+{
+  TextureSet textureSet = TextureSet::New();
+  textureSet.SetImage( 0u, image );
+  return textureSet;
+}
+
+PropertyBuffer CreatePropertyBuffer()
+{
+  Property::Map texturedQuadVertexFormat;
+  texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
+  texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
+
+  PropertyBuffer vertexData = PropertyBuffer::New( texturedQuadVertexFormat );
+  return vertexData;
+}
+
+Geometry CreateQuadGeometry(void)
+{
+  PropertyBuffer vertexData = CreatePropertyBuffer();
+  return CreateQuadGeometryFromBuffer( vertexData );
+}
+
+Geometry CreateQuadGeometryFromBuffer( PropertyBuffer vertexData )
+{
+  const float halfQuadSize = .5f;
+  struct TexturedQuadVertex { Vector2 position; Vector2 textureCoordinates; };
+  TexturedQuadVertex texturedQuadVertexData[4] = {
+    { Vector2(-halfQuadSize, -halfQuadSize), Vector2(0.f, 0.f) },
+    { Vector2( halfQuadSize, -halfQuadSize), Vector2(1.f, 0.f) },
+    { Vector2(-halfQuadSize,  halfQuadSize), Vector2(0.f, 1.f) },
+    { Vector2( halfQuadSize,  halfQuadSize), Vector2(1.f, 1.f) } };
+  vertexData.SetData(texturedQuadVertexData, 4);
+
+  unsigned int indexData[6] = { 0, 3, 1, 0, 2, 3 };
+  Property::Map indexFormat;
+  indexFormat["indices"] = Property::INTEGER;
+  PropertyBuffer indices = PropertyBuffer::New( indexFormat );
+  indices.SetData( indexData, sizeof(indexData)/sizeof(indexData[0]) );
+
+  Geometry geometry = Geometry::New();
+  geometry.AddVertexBuffer( vertexData );
+  geometry.SetIndexBuffer( indices );
+
+  return geometry;
+}
+
+
+
+} // namespace Dali
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/mesh-builder.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/mesh-builder.h
new file mode 100644 (file)
index 0000000..bf5f6a6
--- /dev/null
@@ -0,0 +1,39 @@
+#ifndef MESH_BUILDER_H
+#define MESH_BUILDER_H
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/public-api/dali-core.h>
+#include <dali/devel-api/object/property-buffer.h>
+#include <dali/devel-api/rendering/geometry.h>
+#include <dali/devel-api/rendering/texture-set.h>
+#include <dali/devel-api/rendering/sampler.h>
+#include <dali/devel-api/rendering/renderer.h>
+
+namespace Dali
+{
+
+Shader CreateShader();
+TextureSet CreateTextureSet();
+TextureSet CreateTextureSet( Image image );
+Geometry CreateQuadGeometry();
+Geometry CreateQuadGeometryFromBuffer( PropertyBuffer vertexData );
+PropertyBuffer CreatePropertyBuffer();
+
+}
+
+#endif // MESH_BUILDER_H
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.cpp
new file mode 100644 (file)
index 0000000..2f833c6
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2016 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.
+ *
+ */
+
+// HEADER
+#include "test-actor-utils.h"
+#include "mesh-builder.h"
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/dali-core.h>
+#include <dali/devel-api/rendering/renderer.h>
+
+namespace Dali
+{
+
+namespace
+{
+const char * const TEXTURE_UNIFORM_NAME( "sTexture" );
+
+const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
+  attribute mediump vec2 aPosition;\n
+  uniform mediump mat4 uMvpMatrix;\n
+  uniform mediump vec3 uSize;\n
+  \n
+  void main()\n
+  {\n
+    mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n
+    vertexPosition.xyz *= uSize;\n
+    gl_Position = uMvpMatrix * vertexPosition;\n
+  }\n
+);
+
+const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
+  uniform lowp vec4 uColor;\n
+  \n
+  void main()\n
+  {\n
+    gl_FragColor = uColor;\n
+  }\n
+);
+
+} // unnamed namespace
+
+Actor CreateRenderableActor()
+{
+  return CreateRenderableActor( Image(), VERTEX_SHADER, FRAGMENT_SHADER );
+}
+
+Actor CreateRenderableActor( Image texture )
+{
+  return CreateRenderableActor( texture, VERTEX_SHADER, FRAGMENT_SHADER );
+}
+
+Actor CreateRenderableActor( Image texture, const std::string& vertexShader, const std::string& fragmentShader )
+{
+  // Create the geometry
+  Geometry geometry = CreateQuadGeometry();
+
+  // Create Shader
+  Shader shader = Shader::New( vertexShader, fragmentShader );
+
+  // Create renderer from geometry and material
+  Renderer renderer = Renderer::New( geometry, shader );
+
+  // Create actor and set renderer
+  Actor actor = Actor::New();
+  actor.AddRenderer( renderer );
+
+  // If we a texture, then create a texture-set and add to renderer
+  if( texture )
+  {
+    TextureSet textureSet = TextureSet::New();
+    textureSet.SetImage( 0u, texture );
+    renderer.SetTextures( textureSet );
+
+    // Set actor to the size of the texture if set
+    actor.SetSize( texture.GetWidth(), texture.GetHeight() );
+  }
+
+  return actor;
+}
+
+Image GetTexture( Actor actor )
+{
+  Image image;
+  if( actor && actor.GetRendererCount() )
+  {
+    Renderer renderer = actor.GetRendererAt( 0u );
+    if( renderer )
+    {
+      TextureSet textureSet = renderer.GetTextures();
+      if( textureSet && textureSet.GetTextureCount() )
+      {
+        image = textureSet.GetImage( 0u );
+      }
+    }
+  }
+
+  return image;
+}
+
+} // namespace Dali
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.h
new file mode 100644 (file)
index 0000000..c5c5d0a
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef __DALI_TEST_ACTOR_UTILS_H__
+#define __DALI_TEST_ACTOR_UTILS_H__
+
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <string>
+
+namespace Dali
+{
+
+class Actor;
+class Image;
+
+/**
+ * @brief Creates a simple renderable-actor with solid colored quad.
+ * @return An actor with a renderer.
+ */
+Actor CreateRenderableActor();
+
+/**
+ * @brief Creates a renderable-actor with a texture.
+ * @param[in] texture Texture to set.
+ * @return An actor with a renderer.
+ */
+Actor CreateRenderableActor( Image texture );
+
+/**
+ * @brief Creates a renderable-actor with a texture and custom shaders.
+ * @param[in] texture Texture to set.
+ * @param[in] vertexShader The vertex-shader.
+ * @param[in] fragmentShader The fragment-shader.
+ * @return An actor with a renderer.
+ */
+Actor CreateRenderableActor( Image texture, const std::string& vertexShader, const std::string& fragmentShader );
+
+/**
+ * @brief Retrieves the texture used in a renderable actor (if available).
+ * @return The texture used by the actor.
+ * @note Assumes the actor only has one renderer, and that renderer only has one texture.
+ */
+Image GetTexture( Actor actor );
+
+} // namespace Dali
+
+#endif // __DALI_TEST_ACTOR_UTILS_H__
index 5fb6e11..3f7318a 100644 (file)
@@ -154,13 +154,13 @@ void TestApplication::SetSurfaceWidth( unsigned int width, unsigned height )
   mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight );
 }
 
-void TestApplication::DoUpdate( unsigned int intervalMilliseconds )
+void TestApplication::DoUpdate( unsigned int intervalMilliseconds, const char* location )
 {
   if( GetUpdateStatus() == 0 &&
       mRenderStatus.NeedsUpdate() == false &&
       ! GetRenderController().WasCalled(TestRenderController::RequestUpdateFunc) )
   {
-    fprintf(stderr, "WARNING - Update not required\n");
+    fprintf(stderr, "WARNING - Update not required :%s\n", location==NULL?"NULL":location);
   }
 
   unsigned int nextVSyncTime = mLastVSyncTime + intervalMilliseconds;
@@ -173,9 +173,9 @@ void TestApplication::DoUpdate( unsigned int intervalMilliseconds )
   mLastVSyncTime = nextVSyncTime;
 }
 
-bool TestApplication::Render( unsigned int intervalMilliseconds  )
+bool TestApplication::Render( unsigned int intervalMilliseconds, const char* location )
 {
-  DoUpdate( intervalMilliseconds );
+  DoUpdate( intervalMilliseconds, location );
   mCore->Render( mRenderStatus );
 
   mFrame++;
@@ -216,6 +216,7 @@ bool TestApplication::RenderOnly( )
 void TestApplication::ResetContext()
 {
   mCore->ContextDestroyed();
+  mGlAbstraction.Initialize();
   mCore->ContextCreated();
 }
 
index cb5a92c..1f1161a 100644 (file)
@@ -73,7 +73,7 @@ public:
   void ProcessEvent(const Integration::Event& event);
   void SendNotification();
   void SetSurfaceWidth( unsigned int width, unsigned height );
-  bool Render( unsigned int intervalMilliseconds = DEFAULT_RENDER_INTERVAL );
+  bool Render( unsigned int intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL );
   unsigned int GetUpdateStatus();
   bool UpdateOnly( unsigned int intervalMilliseconds = DEFAULT_RENDER_INTERVAL );
   bool RenderOnly( );
@@ -82,7 +82,7 @@ public:
   bool GetRenderHasRendered();
 
 private:
-  void DoUpdate( unsigned int intervalMilliseconds );
+  void DoUpdate( unsigned int intervalMilliseconds, const char* location=NULL );
 
 protected:
   TestPlatformAbstraction   mPlatformAbstraction;
index 4a12bdb..d42a548 100644 (file)
@@ -32,7 +32,7 @@ void TestGlAbstraction::Initialize()
   mCurrentProgram = 0;
   mCompileStatus = GL_TRUE;
   mLinkStatus = GL_TRUE;
-
+  mNumberOfActiveUniforms = 0;
   mGetAttribLocationResult = 0;
   mGetErrorResult = 0;
   mGetStringResult = NULL;
@@ -78,6 +78,13 @@ void TestGlAbstraction::Initialize()
   mProgramUniforms3f.clear();
   mProgramUniforms4f.clear();
 
+  mCullFaceTrace.Reset();
+  mEnableDisableTrace.Reset();
+  mShaderTrace.Reset();
+  mTextureTrace.Reset();
+  mTexParamaterTrace.Reset();
+  mDrawTrace.Reset();
+
   for( unsigned int i=0; i<MAX_ATTRIBUTE_CACHE_SIZE; ++i )
   {
     mVertexAttribArrayState[i] = false;
index 3d35394..1fe97c1 100644 (file)
@@ -556,6 +556,21 @@ public:
 
   inline void GetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
   {
+    switch(index)
+    {
+      case 0:
+        *length = snprintf(name, bufsize, "sTexture");
+        *type = GL_SAMPLER_2D;
+        *size = 1;
+        break;
+      case 1:
+        *length = snprintf(name, bufsize, "sEffect");
+        *type = GL_SAMPLER_2D;
+        *size = 1;
+        break;
+      default:
+        break;
+    }
   }
 
   inline void GetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
@@ -620,13 +635,20 @@ public:
 
   inline void GetProgramiv(GLuint program, GLenum pname, GLint* params)
   {
-    switch( pname ) {
+    switch( pname )
+    {
       case GL_LINK_STATUS:
         *params = mLinkStatus;
         break;
       case GL_PROGRAM_BINARY_LENGTH_OES:
         *params = mProgramBinaryLength;
         break;
+      case GL_ACTIVE_UNIFORMS:
+        *params = mNumberOfActiveUniforms;
+        break;
+      case GL_ACTIVE_UNIFORM_MAX_LENGTH:
+        *params = 100;
+        break;
     }
   }
 
@@ -634,7 +656,6 @@ public:
   {
   }
 
-
   inline void GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
   {
   }
@@ -759,6 +780,10 @@ public:
     std::stringstream out;
     out << program;
     mShaderTrace.PushCall("LinkProgram", out.str());
+
+    mNumberOfActiveUniforms=2;
+    GetUniformLocation(program, "sTexture");
+    GetUniformLocation(program, "sEffect");
   }
 
   inline void PixelStorei(GLenum pname, GLint param)
@@ -1769,6 +1794,7 @@ private:
   BufferDataCalls mBufferDataCalls;
   BufferSubDataCalls mBufferSubDataCalls;
   GLuint     mLinkStatus;
+  GLint      mNumberOfActiveUniforms;
   GLint      mGetAttribLocationResult;
   GLenum     mGetErrorResult;
   GLubyte*   mGetStringResult;
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-intrusive-ptr.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-intrusive-ptr.h
new file mode 100644 (file)
index 0000000..03aafe3
--- /dev/null
@@ -0,0 +1,60 @@
+#ifndef __TEST_INTRUSIVE_PTR_H__
+#define __TEST_INTRUSIVE_PTR_H__
+
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <iostream>
+#include <stdlib.h>
+#include <dali/public-api/dali-core.h>
+#include <dali-test-suite-utils.h>
+
+namespace Dali
+{
+
+template <typename T>
+struct UtcCoverageIntrusivePtr
+{
+  typedef IntrusivePtr<T> (*Creator)();
+
+  void Check( Creator creator)
+  {
+    IntrusivePtr<T> a = creator();
+    IntrusivePtr<T> b = creator();
+
+    DALI_TEST_CHECK( a.Get() );
+
+    a.Reset();
+
+    T* pB = b.Detach();
+
+    a.Reset(pB);
+
+    DALI_TEST_CHECK(a);
+
+    a.Reset();
+
+  };
+
+};
+
+} // Dali
+
+#endif
+
+
index d8ad2ba..135476e 100644 (file)
@@ -29,7 +29,7 @@ TestNativeImagePointer TestNativeImage::New(int width, int height)
 }
 
 TestNativeImage::TestNativeImage(int width, int height)
-: mWidth(width), mHeight(height), mExtensionCreateCalls(0), mExtensionDestroyCalls(0), mTargetTextureCalls(0)
+: mWidth(width), mHeight(height), mExtensionCreateCalls(0), mExtensionDestroyCalls(0), mTargetTextureCalls(0),createResult(true)
 {
   mExtension = new TestNativeImageExtension();
 }
index 8dc6431..f361280 100644 (file)
@@ -40,7 +40,8 @@ class DALI_IMPORT_API TestNativeImage : public Dali::NativeImageInterface
 public:
   static TestNativeImagePointer New(int width, int height);
 
-  inline virtual bool GlExtensionCreate() { ++mExtensionCreateCalls; return true;};
+  inline void SetGlExtensionCreateResult(bool result){ createResult = result;}
+  inline virtual bool GlExtensionCreate() { ++mExtensionCreateCalls; return createResult;};
   inline virtual void GlExtensionDestroy() { ++mExtensionDestroyCalls; };
   inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return 1;};
   inline virtual void PrepareTexture() {};
@@ -59,6 +60,8 @@ public:
   int mExtensionCreateCalls;
   int mExtensionDestroyCalls;
   int mTargetTextureCalls;
+
+  bool createResult;
   TestNativeImageExtension* mExtension;
 };
 
index 973f24a..2f62474 100644 (file)
@@ -188,7 +188,8 @@ bool TestPlatformAbstraction::WasCalled(TestFuncEnum func)
   {
     case SuspendFunc:                         return mTrace.FindMethod("Suspend");
     case ResumeFunc:                          return mTrace.FindMethod("Resume");
-    case LoadResourceFunc:                    return mTrace.FindMethod("LoadResource") || mTrace.FindMethod("LoadResourceSynchronously");
+    case LoadResourceFunc:                    return mTrace.FindMethod("LoadResource");
+    case LoadResourceSynchronouslyFunc:       return mTrace.FindMethod("LoadResourceSynchronously");
     case LoadFileFunc:                        return mTrace.FindMethod("LoadFile");
     case LoadShaderBinaryFileFunc:            return mTrace.FindMethod("LoadShaderBinaryFile");
     case SaveShaderBinaryFileFunc:            return mTrace.FindMethod("SaveShaderBinaryFile");
index a728ac2..d7e0563 100644 (file)
@@ -171,6 +171,7 @@ public: // TEST FUNCTIONS
     SuspendFunc,
     ResumeFunc,
     LoadResourceFunc,
+    LoadResourceSynchronouslyFunc,
     SaveFileFunc,
     LoadFileFunc,
     LoadShaderBinaryFileFunc,
index 3c83f7e..40280a0 100644 (file)
@@ -68,13 +68,4 @@ private:
 
 } // namespace Dali
 
-inline ImageActor CreateSolidColorImageActor(ToolkitTestApplication& application, const Vector4& color, int width, int height)
-{
-  ImageActor actor = ImageActor::New(CreateBufferImage(width, height, color));
-  application.SendNotification();
-  application.Render();
-  return actor;
-}
-
-
 #endif // __DALI_TOOLKIT_TEST_APPLICATION_H__
index 8b06fd1..2fb0f0c 100644 (file)
@@ -426,13 +426,13 @@ int UtcDaliBuilderConstantsP(void)
       "},"
       "\"stage\":"
       "[{"
-      "  \"type\": \"ImageActor\","
+      "  \"type\": \"ImageView\","
       "  \"name\": \"{NAME}\","
       "  \"size\": [100,100,1],"
       "  \"parentOrigin\": \"TOP_LEFT\","
       "  \"anchorPoint\": \"{ANCHOR}\","
       "  \"padding\": \"{PADDING}\","
-      "  \"image\": { \"filename\": \"dir/{IMAGE_PATH}\" },"
+      "  \"image\": { \"imageUrl\": \"dir/{IMAGE_PATH}\" },"
       "  \"sizeWidth\": \"{WIDTH}\","
       "  \"signals\": [{"
       "    \"name\": \"touched\","
@@ -496,7 +496,7 @@ int UtcDaliBuilderTemplatesAndStylesP(void)
       "\"templates\":\n"
       "{\n"
       "  \"imageTree\": { \n"
-      "    \"type\": \"ImageActor\",\n"
+      "    \"type\": \"ImageView\",\n"
       "    \"styles\": [\"imageStyle\"],\n"
       "    \"name\": \"image\",\n"
       "    \"size\": \"{SIZE}\",\n"
@@ -506,7 +506,7 @@ int UtcDaliBuilderTemplatesAndStylesP(void)
       "    }],\n"
       "    \"actors\": [\n"
       "      {\n"
-      "        \"type\":\"ImageActor\",\n"
+      "        \"type\":\"ImageView\",\n"
       "        \"name\":\"childImage\" \n"
       "      }\n"
       "    ]\n"
@@ -533,7 +533,7 @@ int UtcDaliBuilderTemplatesAndStylesP(void)
 
   std::string templatejson(
     "{ \n"
-    "  \"type\": \"ImageActor\",\n"
+    "  \"type\": \"ImageView\",\n"
     "  \"styles\": [\"imageStyle\"],\n"
     "  \"name\": \"image\",\n"
     "  \"size\": \"{SIZE}\",\n"
@@ -543,7 +543,7 @@ int UtcDaliBuilderTemplatesAndStylesP(void)
     "  }],\n"
     "  \"actors\": [\n"
     "    {\n"
-    "      \"type\":\"ImageActor\",\n"
+    "      \"type\":\"ImageView\",\n"
     "      \"name\":\"childImage\" \n"
     "    }\n"
     "  ]\n"
@@ -553,16 +553,16 @@ int UtcDaliBuilderTemplatesAndStylesP(void)
   Builder builder = Builder::New();
   builder.LoadFromString( json );
 
-  ImageActor actor = ImageActor::DownCast( builder.Create( "imageTree" ) );
+  ImageView actor = ImageView::DownCast( builder.Create( "imageTree" ) );
   DALI_TEST_CHECK( actor );
 
   Dali::Property::Map map;
   map["SIZE"] = Vector3(100,100,1);
-  actor = ImageActor::DownCast( builder.Create( "imageTree",  map ) );
+  actor = ImageView::DownCast( builder.Create( "imageTree",  map ) );
   DALI_TEST_CHECK( actor );
 
   // create from json snippet
-  actor = ImageActor::DownCast( builder.CreateFromJson( templatejson ) );
+  actor = ImageView::DownCast( builder.CreateFromJson( templatejson ) );
   DALI_TEST_CHECK( actor );
 
 
@@ -596,7 +596,7 @@ int UtcDaliBuilderRenderTasksP(void)
       "    \"name\": \"image\"\n"
       "  }, \n"
       "  { \n"
-      "    \"type\": \"ImageActor\",\n"
+      "    \"type\": \"ImageView\",\n"
       "    \"name\": \"image\",\n"
       "    \"size\": [100,100,1],\n"
       "    \"signals\": [{\n"
@@ -605,7 +605,7 @@ int UtcDaliBuilderRenderTasksP(void)
       "    }],\n"
       "    \"actors\": [\n"
       "      {\n"
-      "        \"type\":\"ImageActor\",\n"
+      "        \"type\":\"ImageView\",\n"
       "        \"name\":\"childImage\" \n"
       "      }\n"
       "    ]\n"
@@ -856,7 +856,7 @@ int UtcDaliBuilderCustomPropertyP(void)
       "\"templates\":\n"
       "{\n"
       "  \"imageTree\": { \n"
-      "    \"type\": \"ImageActor\",\n"
+      "    \"type\": \"ImageView\",\n"
       "    \"name\": \"image\",\n"
       "    \"size\": [100,100,1],\n"
       "    \"signals\": [{\n"
@@ -868,7 +868,7 @@ int UtcDaliBuilderCustomPropertyP(void)
       "    },\n"
       "    \"actors\": [\n"
       "      {\n"
-      "        \"type\":\"ImageActor\",\n"
+      "        \"type\":\"ImageView\",\n"
       "        \"name\":\"childImage\" \n"
       "      }\n"
       "    ]\n"
@@ -880,7 +880,7 @@ int UtcDaliBuilderCustomPropertyP(void)
   Builder builder = Builder::New();
   builder.LoadFromString( json );
 
-  ImageActor actor = ImageActor::DownCast( builder.Create( "imageTree" ) );
+  ImageView actor = ImageView::DownCast( builder.Create( "imageTree" ) );
   DALI_TEST_CHECK( actor );
 
   // NB: already applied in create
@@ -901,7 +901,7 @@ int UtcDaliBuilderShaderEffectP(void)
     "{\n"
     "  \"stage\": [\n"
     "    {\n"
-    "      \"type\": \"ImageActor\",\n"
+    "      \"type\": \"ImageView\",\n"
     "      \"name\": \"Image1\",\n"
     "      \"position\": [\n"
     "        0.40461349487305,\n"
@@ -1028,7 +1028,7 @@ int UtcDaliBuilderShaderEffect2P(void)
     "\"templates\":\n"
     "{\n"
     "  \"imageTree\": { \n"
-    "    \"type\": \"ImageActor\",\n"
+    "    \"type\": \"ImageView\",\n"
     "    \"size\": [100,100,1],\n"
     "    \"parentOrigin\": [0.5, 0.5, 0.5],\n"
     "    \"position\": [\n"
@@ -1042,7 +1042,7 @@ int UtcDaliBuilderShaderEffect2P(void)
     "    }],\n"
     "    \"actors\": [\n"
     "      {\n"
-    "        \"type\":\"ImageActor\",\n"
+    "        \"type\":\"ImageView\",\n"
     "        \"name\":\"childImage\" \n"
     "      }\n"
     "    ]\n"
@@ -1154,7 +1154,7 @@ int UtcDaliBuilderFrameBufferP(void)
     "  },\n"
     "  \"stage\": [\n"
     "    {\n"
-    "      \"type\": \"ImageActor\",\n"
+    "      \"type\": \"ImageView\",\n"
     "      \"name\": \"fbOnStage\",\n"
     "      \"position\": [\n"
     "        0.40461349487305,\n"
@@ -1167,17 +1167,13 @@ int UtcDaliBuilderFrameBufferP(void)
     "      \"clearColor\": [1,0,0,1]\n"
     "    },\n"
     "    {\n"
-    "      \"type\": \"ImageActor\",\n"
+    "      \"type\": \"ImageView\",\n"
     "      \"name\": \"Image1\",\n"
     "      \"size\": [200, 200, 0],\n"
     "      \"parentOrigin\": [0.5, 0.5, 0.5],\n"
     "      \"effect\": \"Ripple2D\",\n"
     "      \"image\": {\n"
-    "        \"filename\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\",\n"
-    "        \"width\": 200,\n"
-    "        \"height\": 80,\n"
-    "        \"loadPolicy\": \"IMMEDIATE\",\n"
-    "        \"releasePolicy\": \"NEVER\"\n"
+    "        \"imageUrl\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\"\n"
     "      },\n"
     "      \"signals\": [\n"
     "        {\n"
@@ -1294,17 +1290,13 @@ int UtcDaliBuilderPathConstraintsP(void)
     "  },\n"
     "  \"stage\": [\n"
     "    {\n"
-    "      \"type\": \"ImageActor\",\n"
+    "      \"type\": \"ImageView\",\n"
     "      \"name\": \"Image1\",\n"
     "      \"size\": [200, 200, 0],\n"
     "      \"parentOrigin\": [0.5, 0.5, 0.5],\n"
     "      \"effect\": \"Ripple2D\",\n"
     "      \"image\": {\n"
-    "        \"filename\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\",\n"
-    "        \"width\": 200,\n"
-    "        \"height\": 80,\n"
-    "        \"loadPolicy\": \"IMMEDIATE\",\n"
-    "        \"releasePolicy\": \"NEVER\"\n"
+    "        \"imageUrl\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\"\n"
     "      },\n"
     "      \"signals\": [\n"
     "        {\n"
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-DefaultControls.cpp b/automated-tests/src/dali-toolkit/utc-Dali-DefaultControls.cpp
deleted file mode 100644 (file)
index b65fc34..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <iostream>
-#include <stdlib.h>
-
-// Need to override adaptor classes for toolkit test harness, so include
-// test harness headers before dali headers.
-#include <dali-toolkit-test-suite-utils.h>
-
-#include <dali.h>
-#include <dali-toolkit/dali-toolkit.h>
-
-using namespace Dali;
-using namespace Toolkit;
-
-void utc_dali_toolkit_default_controls_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void utc_dali_toolkit_default_controls_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-int UtcDaliDefaultControlsCreateSolidColorActor(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline(" UtcDaliDefaultControlsCreateSolidColorActor");
-
-  ImageActor image1 = CreateSolidColorActor( Color::RED );
-  ImageActor image2 = CreateSolidColorActor( Color::RED, true, Color::BLUE, 2 );
-  ImageActor image3 = CreateSolidColorActor( Color::RED, true, Color::BLUE, 12 );
-
-  DALI_TEST_CHECK(image1);
-  DALI_TEST_CHECK(image2);
-  DALI_TEST_CHECK(!image3);
-  END_TEST;
-}
index c85bffd..4ee76fb 100644 (file)
@@ -74,7 +74,7 @@ public: // From ItemFactory
   {
     // Create an image actor for this item
     Image image = ResourceImage::New( TEST_IMAGE_FILE_NAME );
-    Actor actor = ImageActor::New(image);
+    Actor actor = CreateRenderableActor(image);
 
     return actor;
   }
index 2cbd51b..1f96f1b 100644 (file)
@@ -115,7 +115,7 @@ public: // From ItemFactory
   {
     // Create an image actor for this item
     Image image = ResourceImage::New( TEST_IMAGE_FILE_NAME );
-    Actor actor = ImageActor::New(image);
+    Actor actor = CreateRenderableActor(image);
 
     return actor;
   }
index eb86be2..395b409 100644 (file)
@@ -545,14 +545,14 @@ int UtcDaliKeyInputFocusManagerDestroyObject02(void)
 
   {
     BufferImage image = CreateBufferImage();
-    ImageActor imageActor = ImageActor::New( image );
-    stage.Add( imageActor );
-    imageActor.SetSize(100, 100);
+    Actor actor = CreateRenderableActor( image );
+    stage.Add( actor );
+    actor.SetSize(100, 100);
 
     application.SendNotification();
     application.Render();
 
-    stage.Remove( imageActor );
+    stage.Remove( actor );
   }
 
   DALI_TEST_CHECK( dummy2 == manager.GetCurrentFocusControl());
index 45550c2..6e22042 100644 (file)
@@ -205,7 +205,8 @@ void TestControlRendererRender( ToolkitTestApplication& application,
 
   if( resourcePtr )
   {
-    DALI_TEST_CHECK(application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc));
+    DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) ||
+                     application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceSynchronouslyFunc ));
   }
 
   DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
index e1f79ca..3a4ad99 100644 (file)
@@ -49,8 +49,7 @@ DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Scrollable, Toolkit::Control, Create );
 DALI_PROPERTY_REGISTRATION( Toolkit, Scrollable, "overshootEffectColor",      VECTOR4, OVERSHOOT_EFFECT_COLOR    )
 DALI_PROPERTY_REGISTRATION( Toolkit, Scrollable, "overshootAnimationSpeed",   FLOAT,   OVERSHOOT_ANIMATION_SPEED )
 DALI_PROPERTY_REGISTRATION( Toolkit, Scrollable, "overshootEnabled",          BOOLEAN, OVERSHOOT_ENABLED )
-const int OVERSHOOT_SIZE = Dali::Toolkit::Scrollable::Property::OVERSHOOT_ENABLED + 1; // OVERSHOOT_SIZE is not public yet
-Dali::PropertyRegistration p1( typeRegistration, "overshootSize",  OVERSHOOT_SIZE, Property::VECTOR2, Dali::Toolkit::Internal::Scrollable::SetProperty, Dali::Toolkit::Internal::Scrollable::GetProperty );
+DALI_PROPERTY_REGISTRATION( Toolkit, Scrollable, "overshootSize",             VECTOR2, OVERSHOOT_SIZE )
 
 DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, Scrollable, "scrollRelativePosition",   VECTOR2, SCROLL_RELATIVE_POSITION)
 DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, Scrollable, "scrollPositionMin",        VECTOR2, SCROLL_POSITION_MIN)
@@ -200,7 +199,7 @@ void Scrollable::SetProperty( BaseObject* object, Property::Index index, const P
         scrollableImpl.SetOvershootEnabled( value.Get<bool>() );
         break;
       }
-      case OVERSHOOT_SIZE: // OVERSHOOT_SIZE is not public yet
+      case Toolkit::Scrollable::Property::OVERSHOOT_SIZE:
       {
         Vector2 input;
         if( value.Get( input ) )
@@ -240,7 +239,7 @@ Property::Value Scrollable::GetProperty( BaseObject* object, Property::Index ind
         value = scrollableImpl.IsOvershootEnabled();
         break;
       }
-      case OVERSHOOT_SIZE: // OVERSHOOT_SIZE is not public yet
+      case Toolkit::Scrollable::Property::OVERSHOOT_SIZE:
       {
         value = scrollableImpl.mOvershootSize;
         break;
index cd04e07..e8af489 100644 (file)
@@ -79,6 +79,7 @@ public:
       OVERSHOOT_EFFECT_COLOR = PROPERTY_START_INDEX, ///< Property, name "overshootEffectColor",      @see SetOvershootEffectColor(),    type Vector4 @SINCE_1_0.0
       OVERSHOOT_ANIMATION_SPEED,                     ///< Property, name "overshootAnimationSpeed",   @see SetOvershootAnimationSpeed(), type float @SINCE_1_0.0
       OVERSHOOT_ENABLED,                             ///< Property, name "overshootEnabled",          @see SetOvershootEnabled(),        type bool,    @SINCE_1_1.18
+      OVERSHOOT_SIZE,                                ///< Property, name "overshootSize",                                                type Vector2, @SINCE_1_1.31
 
       // Animatable properties
       SCROLL_RELATIVE_POSITION = ANIMATABLE_PROPERTY_START_INDEX, ///< Property, name "scrollRelativePosition",   type Vector2 @SINCE_1_0.0