Canvas text async: add async layout functionality

This adds the 'async_layout' method.
The 'async layout' method is similar to 'size_formatted_get', but done
outside of the mainloop. When a call is made to this method, a thread
is created (after some preparation like updating the logical text
items), and the visual layout is offloaded to that thread. The result
is returned as Eina.Future.

The mainloop is blocked for operations that manipulate the object, if a
thread has already been created but hasn't complete its work.
Consecutive calls for async layout for the same object are not handled
simultaneously. Each time the threads has complete its work, the next
(if exists) layout will be dispatched.

@feature
This commit is contained in:
Daniel Hirt 2017-09-04 19:16:27 +03:00
parent b1d831c552
commit b63c3620df
2 changed files with 443 additions and 174 deletions

View File

@ -252,6 +252,16 @@ Efl.Text.Font, Efl.Text.Style, Efl.Text.Format, Efl.Text.Cursor, Efl.Text.Annota
@since 1.18
]]
}
async_layout {
[[Requests to layout the text off the mainloop.
Once layout is complete, the result is returned as @Eina.Rect,
with w, h fields set.
@since 1.21
]]
return: ptr(Eina.Future) @owned; [[Future for layout result]]
}
}
implements {
Efl.Object.constructor;

File diff suppressed because it is too large Load Diff