diff --git a/build/tizen/CMakeLists.txt b/build/tizen/CMakeLists.txt index f9234d4..2c4f052 100644 --- a/build/tizen/CMakeLists.txt +++ b/build/tizen/CMakeLists.txt @@ -51,8 +51,9 @@ FILE(GLOB LOCAL_IMAGES_ICO RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/ FILE(GLOB LOCAL_IMAGES_WBMP RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.wbmp") FILE(GLOB LOCAL_IMAGES_KTX RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.ktx") FILE(GLOB LOCAL_IMAGES_ASTC RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.astc") +FILE(GLOB LOCAL_IMAGES_SVG RELATIVE "${LOCAL_IMAGES_DIR}" "${LOCAL_IMAGES_DIR}/*.svg") -SET(LOCAL_IMAGES_LIST ${LOCAL_IMAGES_PNG};${LOCAL_IMAGES_JPG};${LOCAL_IMAGES_GIF};${LOCAL_IMAGES_BMP};${LOCAL_IMAGES_ICO};${LOCAL_IMAGES_WBMP};${LOCAL_IMAGES_KTX};${LOCAL_IMAGES_ASTC}) +SET(LOCAL_IMAGES_LIST ${LOCAL_IMAGES_PNG};${LOCAL_IMAGES_JPG};${LOCAL_IMAGES_GIF};${LOCAL_IMAGES_BMP};${LOCAL_IMAGES_ICO};${LOCAL_IMAGES_WBMP};${LOCAL_IMAGES_KTX};${LOCAL_IMAGES_ASTC};${LOCAL_IMAGES_SVG}) FOREACH(flag ${LOCAL_IMAGES_LIST}) INSTALL(FILES ${LOCAL_IMAGES_DIR}/${flag} DESTINATION ${IMAGES_DIR}) ENDFOREACH(flag) diff --git a/com.samsung.dali-demo.xml b/com.samsung.dali-demo.xml index e388766..419c188 100644 --- a/com.samsung.dali-demo.xml +++ b/com.samsung.dali-demo.xml @@ -133,6 +133,9 @@ + + + diff --git a/demo/dali-demo.cpp b/demo/dali-demo.cpp index d8faaa2..5f89db7 100644 --- a/demo/dali-demo.cpp +++ b/demo/dali-demo.cpp @@ -71,6 +71,7 @@ int main(int argc, char **argv) demo.AddExample(Example("image-view.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW)); demo.AddExample(Example("image-view-pixel-area.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_PIXEL_AREA)); demo.AddExample(Example("image-view-alpha-blending.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_ALPHA_BLENDING)); + demo.AddExample(Example("image-view-svg.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW_SVG)); demo.AddExample(Example("super-blur-bloom.example", DALI_DEMO_STR_TITLE_SUPER_BLUR_BLOOM)); demo.AddExample(Example("tilt.example", DALI_DEMO_STR_TITLE_TILT_SENSOR)); diff --git a/demo/file.list b/demo/file.list index fe1e6d8..c64143a 100644 --- a/demo/file.list +++ b/demo/file.list @@ -15,7 +15,8 @@ demo_image_files = \ $(demo_src_dir)/images/*.gif \ $(demo_src_dir)/images/*.bmp \ $(demo_src_dir)/images/*.ico \ - $(demo_src_dir)/images/*.wbmp + $(demo_src_dir)/images/*.wbmp \ + $(demo_src_dir)/images/*.svg demo_model_files = \ $(demo_src_dir)/models/* diff --git a/examples/benchmark/benchmark.cpp b/examples/benchmark/benchmark.cpp index 687f84b..c4e9b83 100644 --- a/examples/benchmark/benchmark.cpp +++ b/examples/benchmark/benchmark.cpp @@ -195,8 +195,8 @@ Geometry& QuadMesh() vertexFormat["aTexCoord"] = Property::VECTOR2; //Create a vertex buffer for vertex positions and texture coordinates - vertexBuffer = PropertyBuffer::New( vertexFormat, 4u ); - vertexBuffer.SetData( gQuadWithTexture ); + vertexBuffer = PropertyBuffer::New( vertexFormat ); + vertexBuffer.SetData( gQuadWithTexture, 4u ); //Create the geometry mesh = Geometry::New(); diff --git a/examples/image-view-svg/image-view-svg-example.cpp b/examples/image-view-svg/image-view-svg-example.cpp new file mode 100644 index 0000000..da06f87 --- /dev/null +++ b/examples/image-view-svg/image-view-svg-example.cpp @@ -0,0 +1,244 @@ +/* + * 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. + * + */ + +#include +#include +#include +#include + +using namespace Dali; + +namespace +{ +const float MAX_SCALE = 6.f; + +const char* SVG_IMAGES[] = +{ + DEMO_IMAGE_DIR "Camera.svg", + DEMO_IMAGE_DIR "Contacts.svg", + DEMO_IMAGE_DIR "Mail.svg", + DEMO_IMAGE_DIR "Message.svg", + DEMO_IMAGE_DIR "Phone.svg", + DEMO_IMAGE_DIR "Settings.svg", + DEMO_IMAGE_DIR "World.svg", + DEMO_IMAGE_DIR "Kid1.svg" +}; +const unsigned int NUM_SVG_IMAGES( sizeof( SVG_IMAGES ) / sizeof( SVG_IMAGES[0] ) ); +} + +// This example shows how to display svg images with ImageView +// +class ImageSvgController : public ConnectionTracker +{ +public: + + ImageSvgController( Application& application ) + : mApplication( application ), + mScale( 1.f ), + mIndex( 0 ) + { + // Connect to the Application's Init signal + mApplication.InitSignal().Connect( this, &ImageSvgController::Create ); + } + + ~ImageSvgController() + { + } + + // The Init signal is received once (only) during the Application lifetime + void Create( Application& application ) + { + // Get a handle to the stage + Stage stage = Stage::GetCurrent(); + stage.SetBackgroundColor( Color::WHITE ); + Vector2 stageSize = stage.GetSize(); + mActorSize = stageSize/2.f; + + stage.KeyEventSignal().Connect(this, &ImageSvgController::OnKeyEvent); + + // Background, for receiving gestures + mStageBackground = Actor::New(); + mStageBackground.SetAnchorPoint( AnchorPoint::TOP_CENTER ); + mStageBackground.SetParentOrigin( ParentOrigin::TOP_CENTER ); + mStageBackground.SetSize( stageSize.x, stageSize.y ); + stage.Add(mStageBackground); + + // Push button, for changing the image set for displaying + Toolkit::PushButton changeButton = Toolkit::PushButton::New(); + changeButton.SetLabelText( "Next" ); + changeButton.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); + changeButton.SetParentOrigin( ParentOrigin::TOP_RIGHT ); + stage.Add( changeButton ); + changeButton.ClickedSignal().Connect( this, &ImageSvgController::OnChangeButtonClicked ); + + // Push button, for resetting the actor size and position + Toolkit::PushButton resetButton = Toolkit::PushButton::New(); + resetButton.SetLabelText( "Reset" ); + resetButton.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + resetButton.SetParentOrigin( ParentOrigin::TOP_LEFT ); + stage.Add( resetButton ); + resetButton.ClickedSignal().Connect( this, &ImageSvgController::OnResetButtonClicked ); + + // Create and put imageViews to stage + for( unsigned int i=0; i<4u; i++) + { + mSvgActor[i] = Toolkit::ImageView::New(SVG_IMAGES[mIndex+i]); + mSvgActor[i].SetSize( mActorSize ); + stage.Add( mSvgActor[i] ); + } + mSvgActor[0].SetParentOrigin( ParentOrigin::CENTER ); + mSvgActor[0].SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); + mSvgActor[1].SetParentOrigin( ParentOrigin::CENTER ); + mSvgActor[1].SetAnchorPoint( AnchorPoint::BOTTOM_LEFT ); + mSvgActor[2].SetParentOrigin( ParentOrigin::CENTER ); + mSvgActor[2].SetAnchorPoint( AnchorPoint::TOP_RIGHT ); + mSvgActor[3].SetParentOrigin( ParentOrigin::CENTER ); + mSvgActor[3].SetAnchorPoint( AnchorPoint::TOP_LEFT ); + + // Connect pan gesture for moving the actors + mPanGestureDetector = PanGestureDetector::New(); + mPanGestureDetector.DetectedSignal().Connect( this, &ImageSvgController::OnPanGesture ); + mPanGestureDetector.Attach( mStageBackground ); + + // Connect pinch gesture for resizing the actors + mPinchGestureDetector = PinchGestureDetector::New(); + mPinchGestureDetector.Attach( mStageBackground); + mPinchGestureDetector.DetectedSignal().Connect(this, &ImageSvgController::OnPinch); + } + + // Callback of push button, for changing image set + bool OnChangeButtonClicked( Toolkit::Button button ) + { + mIndex = (mIndex+4) % NUM_SVG_IMAGES; + for( unsigned int i=0; i<4u; i++) + { + mSvgActor[i].SetImage(SVG_IMAGES[mIndex+i]); + } + + return true; + } + + // Callback of push button, for resetting image size and position + bool OnResetButtonClicked( Toolkit::Button button ) + { + for( unsigned int i=0; i<4u; i++) + { + mSvgActor[i].SetSize(mActorSize); + mSvgActor[i].SetPosition( Vector3::ZERO ); + mScale = 1.f; + } + + return true; + } + + // Callback of pan gesture, for moving the actors + void OnPanGesture( Actor actor, const PanGesture& gesture ) + { + if( gesture.state == Gesture::Continuing ) + { + for( unsigned int i=0; i<4u; i++) + { + mSvgActor[i].TranslateBy(Vector3(gesture.displacement)); + } + } + } + + // Callback of pinch gesture, for resizing the actors + void OnPinch(Actor actor, const PinchGesture& gesture) + { + if (gesture.state == Gesture::Started) + { + mScaleAtPinchStart = mScale; + } + if( gesture.state == Gesture::Finished ) + { + mScale = mScaleAtPinchStart * gesture.scale; + mScale = mScale > MAX_SCALE ? MAX_SCALE : mScale; + for( unsigned int i=0; i<4u; i++) + { + mSvgActor[i].SetSize( mActorSize * mScale); + } + } + } + + /** + * Main key event handler + */ + void OnKeyEvent(const KeyEvent& event) + { + if(event.state == KeyEvent::Down) + { + if( IsKey( event, Dali::DALI_KEY_ESCAPE) || IsKey( event, Dali::DALI_KEY_BACK) ) + { + mApplication.Quit(); + } + else + { + const char* keyName = event.keyPressedName.c_str(); + if( strcmp(keyName, "Left") == 0 ) + { + mScale /= 1.1f; + for( unsigned int i=0; i<4u; i++) + { + mSvgActor[i].SetSize( mActorSize * mScale); + } + } + else if( strcmp(keyName, "Right") == 0 ) + { + if( mScale < MAX_SCALE ) + { + mScale *= 1.1f; + } + for( unsigned int i=0; i<4u; i++) + { + mSvgActor[i].SetSize( mActorSize * mScale); + } + } + } + } + } + +private: + Application& mApplication; + Actor mStageBackground; + PanGestureDetector mPanGestureDetector; + PinchGestureDetector mPinchGestureDetector; + + Toolkit::ImageView mSvgActor[4]; + Vector2 mActorSize; + float mScale; + float mScaleAtPinchStart; + unsigned int mIndex; +}; + +void RunTest( Application& application ) +{ + ImageSvgController test( application ); + + application.MainLoop(); +} + +// Entry point for Linux & Tizen applications +// +int main( int argc, char **argv ) +{ + Application application = Application::New( &argc, &argv ); + + RunTest( application ); + + return 0; +} diff --git a/examples/line-mesh/line-mesh-example.cpp b/examples/line-mesh/line-mesh-example.cpp index e8de9ab..a8282d7 100644 --- a/examples/line-mesh/line-mesh-example.cpp +++ b/examples/line-mesh/line-mesh-example.cpp @@ -82,20 +82,20 @@ Geometry CreateGeometry() Property::Map pentagonVertexFormat; pentagonVertexFormat["aPosition1"] = Property::VECTOR2; - PropertyBuffer pentagonVertices = PropertyBuffer::New( pentagonVertexFormat, 5 ); - pentagonVertices.SetData(pentagonVertexData); + PropertyBuffer pentagonVertices = PropertyBuffer::New( pentagonVertexFormat ); + pentagonVertices.SetData(pentagonVertexData, 5); Property::Map pentacleVertexFormat; pentacleVertexFormat["aPosition2"] = Property::VECTOR2; - PropertyBuffer pentacleVertices = PropertyBuffer::New( pentacleVertexFormat, 5 ); - pentacleVertices.SetData(pentacleVertexData); + PropertyBuffer pentacleVertices = PropertyBuffer::New( pentacleVertexFormat ); + pentacleVertices.SetData( pentacleVertexData, 5 ); // Create indices unsigned int indexData[10] = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 0 }; Property::Map indexFormat; indexFormat["indices"] = Property::INTEGER; - PropertyBuffer indices = PropertyBuffer::New( indexFormat, sizeof(indexData)/sizeof(indexData[0]) ); - indices.SetData(indexData); + PropertyBuffer indices = PropertyBuffer::New( indexFormat ); + indices.SetData( indexData, sizeof(indexData)/sizeof(indexData[0]) ); // Create the geometry object Geometry pentagonGeometry = Geometry::New(); diff --git a/examples/mesh-morph/mesh-morph-example.cpp b/examples/mesh-morph/mesh-morph-example.cpp index ce5f61e..10b7f2e 100644 --- a/examples/mesh-morph/mesh-morph-example.cpp +++ b/examples/mesh-morph/mesh-morph-example.cpp @@ -218,18 +218,18 @@ Geometry CreateGeometry() Property::Map initialPositionVertexFormat; initialPositionVertexFormat["aInitPos"] = Property::VECTOR2; - PropertyBuffer initialPositionVertices = PropertyBuffer::New( initialPositionVertexFormat, numberOfVertices ); - initialPositionVertices.SetData(quad); + PropertyBuffer initialPositionVertices = PropertyBuffer::New( initialPositionVertexFormat ); + initialPositionVertices.SetData( quad, numberOfVertices ); Property::Map finalPositionVertexFormat; finalPositionVertexFormat["aFinalPos"] = Property::VECTOR2; - PropertyBuffer finalPositionVertices = PropertyBuffer::New( finalPositionVertexFormat, numberOfVertices ); - finalPositionVertices.SetData(cat); + PropertyBuffer finalPositionVertices = PropertyBuffer::New( finalPositionVertexFormat ); + finalPositionVertices.SetData( cat, numberOfVertices ); Property::Map colorVertexFormat; colorVertexFormat["aColor"] = Property::VECTOR3; - PropertyBuffer colorVertices = PropertyBuffer::New( colorVertexFormat, numberOfVertices ); - colorVertices.SetData(colors); + PropertyBuffer colorVertices = PropertyBuffer::New( colorVertexFormat ); + colorVertices.SetData( colors, numberOfVertices ); // Create the geometry object Geometry texturedQuadGeometry = Geometry::New(); diff --git a/examples/mesh-sorting/mesh-sorting-example.cpp b/examples/mesh-sorting/mesh-sorting-example.cpp index 4dc7237..4b51c37 100644 --- a/examples/mesh-sorting/mesh-sorting-example.cpp +++ b/examples/mesh-sorting/mesh-sorting-example.cpp @@ -98,15 +98,15 @@ Geometry CreateGeometry() Property::Map texturedQuadVertexFormat; texturedQuadVertexFormat["aPosition"] = Property::VECTOR2; texturedQuadVertexFormat["aTexCoord"] = Property::VECTOR2; - PropertyBuffer texturedQuadVertices = PropertyBuffer::New( texturedQuadVertexFormat, 4 ); - texturedQuadVertices.SetData(texturedQuadVertexData); + PropertyBuffer texturedQuadVertices = PropertyBuffer::New( texturedQuadVertexFormat ); + texturedQuadVertices.SetData( texturedQuadVertexData, 4 ); // Create indices unsigned int indexData[6] = { 0, 3, 1, 0, 2, 3 }; Property::Map indexFormat; indexFormat["indices"] = Property::INTEGER; - PropertyBuffer indices = PropertyBuffer::New( indexFormat, 6 ); - indices.SetData(indexData); + PropertyBuffer indices = PropertyBuffer::New( indexFormat ); + indices.SetData( indexData, 6 ); // Create the geometry object Geometry texturedQuadGeometry = Geometry::New(); diff --git a/examples/metaball-explosion/metaball-explosion-example.cpp b/examples/metaball-explosion/metaball-explosion-example.cpp index ac46a68..6362aee 100644 --- a/examples/metaball-explosion/metaball-explosion-example.cpp +++ b/examples/metaball-explosion/metaball-explosion-example.cpp @@ -380,20 +380,20 @@ Geometry MetaballExplosionController::CreateGeometry() //Vertices Property::Map positionVertexFormat; positionVertexFormat["aPosition"] = Property::VECTOR2; - PropertyBuffer positionVertices = PropertyBuffer::New( positionVertexFormat, numberOfVertices ); - positionVertices.SetData(vertices); + PropertyBuffer positionVertices = PropertyBuffer::New( positionVertexFormat ); + positionVertices.SetData( vertices, numberOfVertices ); //Textures Property::Map textureVertexFormat; textureVertexFormat["aTexture"] = Property::VECTOR2; - PropertyBuffer textureVertices = PropertyBuffer::New( textureVertexFormat, numberOfVertices ); - textureVertices.SetData(textures); + PropertyBuffer textureVertices = PropertyBuffer::New( textureVertexFormat ); + textureVertices.SetData( textures, numberOfVertices ); //Indices Property::Map indicesVertexFormat; indicesVertexFormat["aIndices"] = Property::INTEGER; - PropertyBuffer indicesToVertices = PropertyBuffer::New( indicesVertexFormat, 6 ); - indicesToVertices.SetData(indices); + PropertyBuffer indicesToVertices = PropertyBuffer::New( indicesVertexFormat ); + indicesToVertices.SetData( indices, 6 ); // Create the geometry object Geometry texturedQuadGeometry = Geometry::New(); @@ -438,20 +438,20 @@ Geometry MetaballExplosionController::CreateGeometryComposition() //Vertices Property::Map positionVertexFormat; positionVertexFormat["aPosition"] = Property::VECTOR2; - PropertyBuffer positionVertices = PropertyBuffer::New( positionVertexFormat, numberOfVertices ); - positionVertices.SetData(vertices); + PropertyBuffer positionVertices = PropertyBuffer::New( positionVertexFormat ); + positionVertices.SetData( vertices, numberOfVertices ); //Textures Property::Map textureVertexFormat; textureVertexFormat["aTexture"] = Property::VECTOR2; - PropertyBuffer textureVertices = PropertyBuffer::New( textureVertexFormat, numberOfVertices ); - textureVertices.SetData(textures); + PropertyBuffer textureVertices = PropertyBuffer::New( textureVertexFormat ); + textureVertices.SetData( textures, numberOfVertices ); //Indices Property::Map indicesVertexFormat; indicesVertexFormat["aIndices"] = Property::INTEGER; - PropertyBuffer indicesToVertices = PropertyBuffer::New( indicesVertexFormat, 6 ); - indicesToVertices.SetData(indices); + PropertyBuffer indicesToVertices = PropertyBuffer::New( indicesVertexFormat ); + indicesToVertices.SetData( indices, 6 ); // Create the geometry object Geometry texturedQuadGeometry = Geometry::New(); diff --git a/examples/metaball-refrac/metaball-refrac-example.cpp b/examples/metaball-refrac/metaball-refrac-example.cpp index ada6a8e..e472593 100644 --- a/examples/metaball-refrac/metaball-refrac-example.cpp +++ b/examples/metaball-refrac/metaball-refrac-example.cpp @@ -327,26 +327,26 @@ Geometry MetaballRefracController::CreateGeometry() //Vertices Property::Map positionVertexFormat; positionVertexFormat["aPosition"] = Property::VECTOR2; - PropertyBuffer positionVertices = PropertyBuffer::New( positionVertexFormat, numberOfVertices ); - positionVertices.SetData(vertices); + PropertyBuffer positionVertices = PropertyBuffer::New( positionVertexFormat ); + positionVertices.SetData( vertices, numberOfVertices ); //Textures Property::Map textureVertexFormat; textureVertexFormat["aTexture"] = Property::VECTOR2; - PropertyBuffer textureVertices = PropertyBuffer::New( textureVertexFormat, numberOfVertices ); - textureVertices.SetData(textures); + PropertyBuffer textureVertices = PropertyBuffer::New( textureVertexFormat ); + textureVertices.SetData( textures, numberOfVertices ); //Normals Property::Map normalVertexFormat; normalVertexFormat["aNormal"] = Property::VECTOR3; - PropertyBuffer normalVertices = PropertyBuffer::New( normalVertexFormat, numberOfVertices ); - normalVertices.SetData(normals); + PropertyBuffer normalVertices = PropertyBuffer::New( normalVertexFormat ); + normalVertices.SetData( normals, numberOfVertices ); //Indices Property::Map indicesVertexFormat; indicesVertexFormat["aIndices"] = Property::INTEGER; - PropertyBuffer indicesToVertices = PropertyBuffer::New( indicesVertexFormat, 6 ); - indicesToVertices.SetData(indices); + PropertyBuffer indicesToVertices = PropertyBuffer::New( indicesVertexFormat ); + indicesToVertices.SetData( indices, 6 ); // Create the geometry object @@ -403,27 +403,26 @@ Geometry MetaballRefracController::CreateGeometryComposition() //Vertices Property::Map positionVertexFormat; positionVertexFormat["aPosition"] = Property::VECTOR2; - PropertyBuffer positionVertices = PropertyBuffer::New( positionVertexFormat, numberOfVertices ); - positionVertices.SetData(vertices); + PropertyBuffer positionVertices = PropertyBuffer::New( positionVertexFormat ); + positionVertices.SetData( vertices, numberOfVertices ); //Textures Property::Map textureVertexFormat; textureVertexFormat["aTexture"] = Property::VECTOR2; - PropertyBuffer textureVertices = PropertyBuffer::New( textureVertexFormat, numberOfVertices ); - textureVertices.SetData(textures); + PropertyBuffer textureVertices = PropertyBuffer::New( textureVertexFormat ); + textureVertices.SetData( textures, numberOfVertices ); //Normals Property::Map normalVertexFormat; normalVertexFormat["aNormal"] = Property::VECTOR3; - PropertyBuffer normalVertices = PropertyBuffer::New( normalVertexFormat, numberOfVertices ); - normalVertices.SetData(normals); + PropertyBuffer normalVertices = PropertyBuffer::New( normalVertexFormat ); + normalVertices.SetData( normals, numberOfVertices ); //Indices Property::Map indicesVertexFormat; indicesVertexFormat["aIndices"] = Property::INTEGER; - PropertyBuffer indicesToVertices = PropertyBuffer::New( indicesVertexFormat, 6 ); - indicesToVertices.SetData(indices); - + PropertyBuffer indicesToVertices = PropertyBuffer::New( indicesVertexFormat ); + indicesToVertices.SetData( indices, 6 ); // Create the geometry object Geometry texturedQuadGeometry = Geometry::New(); diff --git a/examples/new-window/new-window-example.cpp b/examples/new-window/new-window-example.cpp index 8dff27d..14d02d4 100644 --- a/examples/new-window/new-window-example.cpp +++ b/examples/new-window/new-window-example.cpp @@ -446,15 +446,15 @@ Geometry NewWindowController::CreateMeshGeometry() vertexFormat["aPosition"] = Property::VECTOR3; vertexFormat["aTexCoord"] = Property::VECTOR2; vertexFormat["aColor"] = Property::VECTOR3; - PropertyBuffer vertices = PropertyBuffer::New( vertexFormat, 5 ); - vertices.SetData( vertexData ); + PropertyBuffer vertices = PropertyBuffer::New( vertexFormat ); + vertices.SetData( vertexData, 5 ); // Specify all the faces unsigned int indexData[12] = { 0,1,3,0,2,4,0,3,4,0,2,1 }; Property::Map indexFormat; indexFormat["indices"] = Property::INTEGER; - PropertyBuffer indices = PropertyBuffer::New( indexFormat, 12 ); - indices.SetData( indexData ); + PropertyBuffer indices = PropertyBuffer::New( indexFormat ); + indices.SetData( indexData, 12 ); // Create the geometry object Geometry geometry = Geometry::New(); diff --git a/examples/point-mesh/point-mesh-example.cpp b/examples/point-mesh/point-mesh-example.cpp index ce7a080..6f7c032 100644 --- a/examples/point-mesh/point-mesh-example.cpp +++ b/examples/point-mesh/point-mesh-example.cpp @@ -98,8 +98,8 @@ Geometry CreateGeometry() Property::Map polyhedraVertexFormat; polyhedraVertexFormat["aPosition"] = Property::VECTOR2; polyhedraVertexFormat["aHue"] = Property::FLOAT; - PropertyBuffer polyhedraVertices = PropertyBuffer::New( polyhedraVertexFormat, numSides ); - polyhedraVertices.SetData(polyhedraVertexData); + PropertyBuffer polyhedraVertices = PropertyBuffer::New( polyhedraVertexFormat ); + polyhedraVertices.SetData( polyhedraVertexData, numSides ); // Create the geometry object Geometry polyhedraGeometry = Geometry::New(); diff --git a/examples/radial-menu/radial-sweep-view-impl.cpp b/examples/radial-menu/radial-sweep-view-impl.cpp index b83e9f3..ea98aa6 100644 --- a/examples/radial-menu/radial-sweep-view-impl.cpp +++ b/examples/radial-menu/radial-sweep-view-impl.cpp @@ -331,14 +331,14 @@ void RadialSweepViewImpl::CreateStencil( Radian initialSector ) vertexFormat["aAngleIndex"] = Property::FLOAT; vertexFormat["aPosition1"] = Property::VECTOR2; vertexFormat["aPosition2"] = Property::VECTOR2; - PropertyBuffer vertices = PropertyBuffer::New( vertexFormat, 7u ); - vertices.SetData( vertexData ); + PropertyBuffer vertices = PropertyBuffer::New( vertexFormat ); + vertices.SetData( vertexData, 7u ); unsigned int indexData[15] = { 0,1,2,0,2,3,0,3,4,0,4,5,0,5,6 }; Property::Map indexFormat; indexFormat["indices"] = Property::INTEGER; - PropertyBuffer indices = PropertyBuffer::New( indexFormat, 15u ); - indices.SetData( indexData ); + PropertyBuffer indices = PropertyBuffer::New( indexFormat ); + indices.SetData( indexData, 15u ); Geometry meshGeometry = Geometry::New(); meshGeometry.AddVertexBuffer( vertices ); diff --git a/examples/refraction-effect/refraction-effect-example.cpp b/examples/refraction-effect/refraction-effect-example.cpp index b1983d2..3f7d2c2 100644 --- a/examples/refraction-effect/refraction-effect-example.cpp +++ b/examples/refraction-effect/refraction-effect-example.cpp @@ -456,8 +456,8 @@ private: vertexFormat["aPosition"] = Property::VECTOR3; vertexFormat["aNormal"] = Property::VECTOR3; vertexFormat["aTexCoord"] = Property::VECTOR2; - PropertyBuffer surfaceVertices = PropertyBuffer::New( vertexFormat, vertices.size() ); - surfaceVertices.SetData( &vertices[0] ); + PropertyBuffer surfaceVertices = PropertyBuffer::New( vertexFormat ); + surfaceVertices.SetData( &vertices[0], vertices.size() ); Geometry surface = Geometry::New(); surface.AddVertexBuffer( surfaceVertices ); diff --git a/examples/textured-mesh/textured-mesh-example.cpp b/examples/textured-mesh/textured-mesh-example.cpp index a586a07..cea2c98 100644 --- a/examples/textured-mesh/textured-mesh-example.cpp +++ b/examples/textured-mesh/textured-mesh-example.cpp @@ -75,15 +75,15 @@ Geometry CreateGeometry() Property::Map texturedQuadVertexFormat; texturedQuadVertexFormat["aPosition"] = Property::VECTOR2; texturedQuadVertexFormat["aTexCoord"] = Property::VECTOR2; - PropertyBuffer texturedQuadVertices = PropertyBuffer::New( texturedQuadVertexFormat, 4 ); - texturedQuadVertices.SetData(texturedQuadVertexData); + PropertyBuffer texturedQuadVertices = PropertyBuffer::New( texturedQuadVertexFormat ); + texturedQuadVertices.SetData( texturedQuadVertexData, 4 ); // Create indices unsigned int indexData[6] = { 0, 3, 1, 0, 2, 3 }; Property::Map indexFormat; indexFormat["indices"] = Property::INTEGER; - PropertyBuffer indices = PropertyBuffer::New( indexFormat, sizeof(indexData)/sizeof(indexData[0]) ); - indices.SetData(indexData); + PropertyBuffer indices = PropertyBuffer::New( indexFormat ); + indices.SetData( indexData, sizeof(indexData)/sizeof(indexData[0]) ); // Create the geometry object Geometry texturedQuadGeometry = Geometry::New(); diff --git a/packaging/com.samsung.dali-demo.spec b/packaging/com.samsung.dali-demo.spec index fe61171..e439e04 100755 --- a/packaging/com.samsung.dali-demo.spec +++ b/packaging/com.samsung.dali-demo.spec @@ -2,7 +2,7 @@ Name: com.samsung.dali-demo Summary: The OpenGLES Canvas Core Demo -Version: 1.1.26 +Version: 1.1.27 Release: 1 Group: System/Libraries License: Apache-2.0 diff --git a/resources/images/Camera.svg b/resources/images/Camera.svg new file mode 100755 index 0000000..a820260 --- /dev/null +++ b/resources/images/Camera.svg @@ -0,0 +1,247 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/resources/images/Contacts.svg b/resources/images/Contacts.svg new file mode 100755 index 0000000..ced240f --- /dev/null +++ b/resources/images/Contacts.svg @@ -0,0 +1,152 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/resources/images/Kid1.svg b/resources/images/Kid1.svg new file mode 100755 index 0000000..b7d5476 --- /dev/null +++ b/resources/images/Kid1.svg @@ -0,0 +1,491 @@ + + + +image/svg+xml diff --git a/resources/images/Mail.svg b/resources/images/Mail.svg new file mode 100755 index 0000000..63fdd1f --- /dev/null +++ b/resources/images/Mail.svg @@ -0,0 +1,170 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/resources/images/Message.svg b/resources/images/Message.svg new file mode 100755 index 0000000..623ea41 --- /dev/null +++ b/resources/images/Message.svg @@ -0,0 +1,224 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/resources/images/Phone.svg b/resources/images/Phone.svg new file mode 100755 index 0000000..33bb355 --- /dev/null +++ b/resources/images/Phone.svg @@ -0,0 +1,447 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/resources/images/Settings.svg b/resources/images/Settings.svg new file mode 100755 index 0000000..68156cd --- /dev/null +++ b/resources/images/Settings.svg @@ -0,0 +1,452 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/resources/images/World.svg b/resources/images/World.svg new file mode 100755 index 0000000..91aef13 --- /dev/null +++ b/resources/images/World.svg @@ -0,0 +1,284 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/shared/dali-demo-strings.h b/shared/dali-demo-strings.h index 65ac91c..8fadcf9 100644 --- a/shared/dali-demo-strings.h +++ b/shared/dali-demo-strings.h @@ -100,6 +100,7 @@ extern "C" #define DALI_DEMO_STR_TITLE_IMAGE_VIEW "Image View" #define DALI_DEMO_STR_TITLE_IMAGE_VIEW_PIXEL_AREA "Image View Pixel Area" #define DALI_DEMO_STR_TITLE_IMAGE_VIEW_ALPHA_BLENDING "Image View Alpha Blending" +#define DALI_DEMO_STR_TITLE_IMAGE_VIEW_SVG "Image View SVG" #define DALI_DEMO_STR_TITLE_SUPER_BLUR_BLOOM "Super Blur and Bloom" #endif