From 2ca10dd42088d05eb40c585991136948b27e7b80 Mon Sep 17 00:00:00 2001 From: Jarkko Koivikko Date: Tue, 18 Aug 2015 12:00:10 +0300 Subject: Run lipi HWR task in parallel with the recognition timer This change improves the user experience by reducing the time spent waiting the HWR task to complete. Previously the recognition was started after the recognition timer expired. This caused the total overhead of the recognition to be summed on top of the recognition timer, reducing the user experience in low performance devices. Now the idle time (during the recognition timer) is used for the benefit of HWR task, so that in optimal case, the recognition result is available immediately after the recognition timer expires. If the HWR task takes longer to process than the recognition timer, the results will be provided as soon as the HWR task is done. Ongoing recognition task is cancelled if the user continues drawing while the recognition timer is running. If the recognition task is already completed, the current result is ignored and the result from the next recognition task is used instead. Change-Id: I9ba797223d8a9b8daf423e500fcf9d5250caaa5a Reviewed-by: Mitch Curtis --- src/virtualkeyboard/lipisharedrecognizer.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/virtualkeyboard/lipisharedrecognizer.h') diff --git a/src/virtualkeyboard/lipisharedrecognizer.h b/src/virtualkeyboard/lipisharedrecognizer.h index a53ac2d8..2ce7a69f 100644 --- a/src/virtualkeyboard/lipisharedrecognizer.h +++ b/src/virtualkeyboard/lipisharedrecognizer.h @@ -45,6 +45,7 @@ public: int numChoices); QSharedPointer startRecognition(QSharedPointer &recognitionTask); bool cancelRecognition(); + bool cancelRecognitionTask(QSharedPointer &recognitionTask); private: static int loadLipiInterface(); @@ -69,6 +70,7 @@ private: static QMap s_unicodeMap; static QString s_activeModel; static stringStringMap s_lipiEngineConfigEntries; + static int s_recognitionCount; }; #endif // LIPISHAREDRECOGNIZER_H -- cgit v1.2.3