VertexBuffer can now be created from Property::Map by initializer list 53/290953/4
authorDavid Steele <david.steele@samsung.com>
Wed, 5 Apr 2023 11:00:21 +0000 (12:00 +0100)
committerDavid Steele <david.steele@samsung.com>
Mon, 17 Apr 2023 12:15:19 +0000 (13:15 +0100)
commit41da2a3a30b5f805876d50fae170e07592c33e86
tree0eddfbf05f0b0c2eca3ab5f10c3ee03b6a1daa5c
parentc2508340a6e4163f3a7d3e34af78df94560a18be
VertexBuffer can now be created from Property::Map by initializer list

VertexBuffer constructor takes a vertex format as it's argument, which
is a PropertyMap of key value pairs. Previously, it assumes that the
value is a property type enumeration cast to an INTEGER type.

However, if the Property::Map is instantiated using initializer lists,
e.g.

  Property::Map format { {"aPosition", Property::VECTOR2},
                         {"aColor", Property::VECTOR4}};
  VertexBuffer vertexBuffer(format);

then the enum is promoted to a Property::Value of that type, so the
vertex buffer doesn't see INTEGER type and asserts.

Modified the VertexBuffer constructor to utilize the value type
if it's not an INTEGER.

Change-Id: I85bc1d08603c31726eb06d786f44f0ca27a62ce9
Signed-off-by: David Steele <david.steele@samsung.com>
automated-tests/src/dali/utc-Dali-VertexBuffer.cpp
dali/internal/event/rendering/vertex-buffer-impl.cpp