X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fscrollable%2Fbouncing-effect-actor.cpp;h=be6377230664175517f568e68ec3f356a4846ec8;hb=67c2962f7cb1a545a6ad10b8147c8558cc6f45ca;hp=c06e40055e49d2cee29c57e35e20533b602496bd;hpb=941eb8eab76fca967bb8e21456179fc9b4eafea6;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp index c06e400..be63772 100644 --- a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp +++ b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * 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. @@ -21,11 +21,13 @@ // EXTERNAL INCLUDES #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include + +// INTERNAL INCLUDES +#include namespace Dali { @@ -48,31 +50,6 @@ const float LAYER_HEIGHTS[5] = 26.f / 130.f }; -#define MAKE_SHADER(A)#A - -// Modify the vertex position according to the bounce coefficient; -const char* MESH_VERTEX_SHADER = MAKE_SHADER( -attribute mediump vec3 aPosition1;\n -attribute mediump vec3 aPosition2;\n -uniform mediump mat4 uMvpMatrix;\n -uniform mediump vec3 uSize; -uniform mediump float uBounceCoefficient;\n -\n -void main()\n -{\n - gl_Position = uMvpMatrix * vec4(mix( aPosition1, aPosition2, abs(uBounceCoefficient) )*uSize, 1.0);\n -} -); - -// use the actor color to paint every layer -const char* MESH_FRAGMENT_SHADER = MAKE_SHADER( -uniform lowp vec4 uColor;\n -void main()\n -{\n - gl_FragColor = uColor;\n -}\n -); - } // namespace Anon Actor CreateBouncingEffectActor( Property::Index& bouncePropertyIndex ) @@ -114,7 +91,7 @@ Actor CreateBouncingEffectActor( Property::Index& bouncePropertyIndex ) Property::Map vertexFormat; vertexFormat["aPosition1"] = Property::VECTOR3; vertexFormat["aPosition2"] = Property::VECTOR3; - PropertyBuffer vertices = PropertyBuffer::New( vertexFormat ); + VertexBuffer vertices = VertexBuffer::New( vertexFormat ); vertices.SetData( vertexData, 20u ); unsigned short indexData[30] = { 0,3,1,0,2,3,4,7,5,4,6,7,8,11,9,8,10,11,12,15,13,12,14,15,16,19,17,16,18,19}; @@ -124,7 +101,7 @@ Actor CreateBouncingEffectActor( Property::Index& bouncePropertyIndex ) meshGeometry.SetIndexBuffer( indexData, sizeof(indexData)/sizeof(indexData[0]) ); // Create the shader - Shader shader = Shader::New( MESH_VERTEX_SHADER, MESH_FRAGMENT_SHADER ); + Shader shader = Shader::New( SHADER_BOUNCING_EFFECT_MESH_SHADER_VERT, SHADER_BOUNCING_EFFECT_MESH_SHADER_FRAG ); // Create renderer Renderer renderer = Renderer::New( meshGeometry, shader );