# 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
)
ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
TARGET_LINK_LIBRARIES(${EXEC_NAME}
${${CAPI_LIB}_LIBRARIES}
+ -lpthread
)
INSTALL(PROGRAMS ${EXEC_NAME}
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
# 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
void tet_printf(const char *format, ...);
#include "test-application.h"
+#include "test-actor-utils.h"
using namespace Dali;
--- /dev/null
+/*
+ * 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
--- /dev/null
+#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
--- /dev/null
+/*
+ * 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
--- /dev/null
+#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__
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;
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++;
void TestApplication::ResetContext()
{
mCore->ContextDestroyed();
+ mGlAbstraction.Initialize();
mCore->ContextCreated();
}
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( );
bool GetRenderHasRendered();
private:
- void DoUpdate( unsigned int intervalMilliseconds );
+ void DoUpdate( unsigned int intervalMilliseconds, const char* location=NULL );
protected:
TestPlatformAbstraction mPlatformAbstraction;
mCurrentProgram = 0;
mCompileStatus = GL_TRUE;
mLinkStatus = GL_TRUE;
-
+ mNumberOfActiveUniforms = 0;
mGetAttribLocationResult = 0;
mGetErrorResult = 0;
mGetStringResult = NULL;
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;
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)
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;
}
}
{
}
-
inline void GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
{
}
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)
BufferDataCalls mBufferDataCalls;
BufferSubDataCalls mBufferSubDataCalls;
GLuint mLinkStatus;
+ GLint mNumberOfActiveUniforms;
GLint mGetAttribLocationResult;
GLenum mGetErrorResult;
GLubyte* mGetStringResult;
--- /dev/null
+#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
+
+
}
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();
}
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() {};
int mExtensionCreateCalls;
int mExtensionDestroyCalls;
int mTargetTextureCalls;
+
+ bool createResult;
TestNativeImageExtension* mExtension;
};
{
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");
SuspendFunc,
ResumeFunc,
LoadResourceFunc,
+ LoadResourceSynchronouslyFunc,
SaveFileFunc,
LoadFileFunc,
LoadShaderBinaryFileFunc,
} // 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__
"},"
"\"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\","
"\"templates\":\n"
"{\n"
" \"imageTree\": { \n"
- " \"type\": \"ImageActor\",\n"
+ " \"type\": \"ImageView\",\n"
" \"styles\": [\"imageStyle\"],\n"
" \"name\": \"image\",\n"
" \"size\": \"{SIZE}\",\n"
" }],\n"
" \"actors\": [\n"
" {\n"
- " \"type\":\"ImageActor\",\n"
+ " \"type\":\"ImageView\",\n"
" \"name\":\"childImage\" \n"
" }\n"
" ]\n"
std::string templatejson(
"{ \n"
- " \"type\": \"ImageActor\",\n"
+ " \"type\": \"ImageView\",\n"
" \"styles\": [\"imageStyle\"],\n"
" \"name\": \"image\",\n"
" \"size\": \"{SIZE}\",\n"
" }],\n"
" \"actors\": [\n"
" {\n"
- " \"type\":\"ImageActor\",\n"
+ " \"type\":\"ImageView\",\n"
" \"name\":\"childImage\" \n"
" }\n"
" ]\n"
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 );
" \"name\": \"image\"\n"
" }, \n"
" { \n"
- " \"type\": \"ImageActor\",\n"
+ " \"type\": \"ImageView\",\n"
" \"name\": \"image\",\n"
" \"size\": [100,100,1],\n"
" \"signals\": [{\n"
" }],\n"
" \"actors\": [\n"
" {\n"
- " \"type\":\"ImageActor\",\n"
+ " \"type\":\"ImageView\",\n"
" \"name\":\"childImage\" \n"
" }\n"
" ]\n"
"\"templates\":\n"
"{\n"
" \"imageTree\": { \n"
- " \"type\": \"ImageActor\",\n"
+ " \"type\": \"ImageView\",\n"
" \"name\": \"image\",\n"
" \"size\": [100,100,1],\n"
" \"signals\": [{\n"
" },\n"
" \"actors\": [\n"
" {\n"
- " \"type\":\"ImageActor\",\n"
+ " \"type\":\"ImageView\",\n"
" \"name\":\"childImage\" \n"
" }\n"
" ]\n"
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
"{\n"
" \"stage\": [\n"
" {\n"
- " \"type\": \"ImageActor\",\n"
+ " \"type\": \"ImageView\",\n"
" \"name\": \"Image1\",\n"
" \"position\": [\n"
" 0.40461349487305,\n"
"\"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"
" }],\n"
" \"actors\": [\n"
" {\n"
- " \"type\":\"ImageActor\",\n"
+ " \"type\":\"ImageView\",\n"
" \"name\":\"childImage\" \n"
" }\n"
" ]\n"
" },\n"
" \"stage\": [\n"
" {\n"
- " \"type\": \"ImageActor\",\n"
+ " \"type\": \"ImageView\",\n"
" \"name\": \"fbOnStage\",\n"
" \"position\": [\n"
" 0.40461349487305,\n"
" \"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"
" },\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"
+++ /dev/null
-/*
- * 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;
-}
{
// 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;
}
{
// 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;
}
{
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());
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 );
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)
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 ) )
value = scrollableImpl.IsOvershootEnabled();
break;
}
- case OVERSHOOT_SIZE: // OVERSHOOT_SIZE is not public yet
+ case Toolkit::Scrollable::Property::OVERSHOOT_SIZE:
{
value = scrollableImpl.mOvershootSize;
break;
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