Make MeasureCallback signature .NET friendly 65/242665/4
authorWander Lairson Costa <wander.lairson@gmail.com>
Tue, 4 Aug 2020 15:11:03 +0000 (12:11 -0300)
committerWander Lairson Costa <wander.lairson@gmail.com>
Tue, 22 Sep 2020 12:18:06 +0000 (09:18 -0300)
commitcabf76b631c0365a1e8f396b91ee54faa4994880
tree581c209bb2e1d8108f743db3969c716aec43da5c
parente74563220e35ea81a5b932186221623eed0fc62e
Make MeasureCallback signature .NET friendly

Currently, MeasureCallback signature has a return type of a POD 16 bytes
structure. Returning the structure by value is messing up when passing a
delegate from C# on Windows 10. The net effect is that arguments arrive
with random values. This happens because the C++ compiler may apply
optimization like RVO that the .NET runtime is not aware of.

This link [1] provides more details.

We fix the problem by making SizeTuple an out parameter and returning
void.

[1] https://www.tutorialsteacher.com/csharp/csharp-delegates

Change-Id: I71feef35908d139f60e6941b447a78b38053b89d
automated-tests/src/dali-toolkit/utc-Dali-FlexNode.cpp
dali-toolkit/devel-api/layouting/flex-node.cpp
dali-toolkit/devel-api/layouting/flex-node.h