PropertyBuffer SetData clean-up 28/63028/1
authorPaul Wisbey <p.wisbey@samsung.com>
Mon, 21 Mar 2016 17:29:44 +0000 (17:29 +0000)
committerPaul Wisbey <p.wisbey@samsung.com>
Mon, 21 Mar 2016 17:29:44 +0000 (17:29 +0000)
Change-Id: Ia4783fd5c18ccc97e81c239eadf00663d625d962

examples/benchmark/benchmark.cpp
examples/line-mesh/line-mesh-example.cpp
examples/mesh-morph/mesh-morph-example.cpp
examples/mesh-sorting/mesh-sorting-example.cpp
examples/metaball-explosion/metaball-explosion-example.cpp
examples/metaball-refrac/metaball-refrac-example.cpp
examples/new-window/new-window-example.cpp
examples/point-mesh/point-mesh-example.cpp
examples/radial-menu/radial-sweep-view-impl.cpp
examples/refraction-effect/refraction-effect-example.cpp
examples/textured-mesh/textured-mesh-example.cpp

index 687f84b..c4e9b83 100644 (file)
@@ -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();
index e8de9ab..a8282d7 100644 (file)
@@ -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();
index ce5f61e..10b7f2e 100644 (file)
@@ -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();
index 4dc7237..4b51c37 100644 (file)
@@ -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();
index ac46a68..6362aee 100644 (file)
@@ -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();
index ada6a8e..e472593 100644 (file)
@@ -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();
index 8dff27d..14d02d4 100644 (file)
@@ -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();
index ce7a080..6f7c032 100644 (file)
@@ -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();
index b83e9f3..ea98aa6 100644 (file)
@@ -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 );
index b1983d2..3f7d2c2 100644 (file)
@@ -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 );
index a586a07..cea2c98 100644 (file)
@@ -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();