aboutsummaryrefslogtreecommitdiffstats
path: root/src/virtualkeyboard/lipisharedrecognizer.h
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2015-08-18 12:00:10 +0300
committerJarkko Koivikko <jarkko.koivikko@code-q.fi>2015-08-27 06:57:21 +0000
commit2ca10dd42088d05eb40c585991136948b27e7b80 (patch)
treea6aad63c9030f5ba779242ec5fd1037eda03f0db /src/virtualkeyboard/lipisharedrecognizer.h
parenta0ce4dc3827df917084832f799f3d1ee025cb734 (diff)
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 <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/virtualkeyboard/lipisharedrecognizer.h')
-rw-r--r--src/virtualkeyboard/lipisharedrecognizer.h2
1 files changed, 2 insertions, 0 deletions
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<LipiRecognitionResultsTask> startRecognition(QSharedPointer<LipiRecognitionTask> &recognitionTask);
bool cancelRecognition();
+ bool cancelRecognitionTask(QSharedPointer<LipiRecognitionTask> &recognitionTask);
private:
static int loadLipiInterface();
@@ -69,6 +70,7 @@ private:
static QMap<int, QChar> s_unicodeMap;
static QString s_activeModel;
static stringStringMap s_lipiEngineConfigEntries;
+ static int s_recognitionCount;
};
#endif // LIPISHAREDRECOGNIZER_H