Add trace log for touch, wheel and gesture
[platform/core/uifw/dali-core.git] / dali / internal / event / events / tap-gesture / tap-gesture-processor.cpp
index 085f627..0c43d8f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
+#include <dali/integration-api/trace.h>
 #include <dali/internal/event/actors/actor-impl.h>
 #include <dali/internal/event/common/scene-impl.h>
 #include <dali/internal/event/events/gesture-requests.h>
@@ -41,6 +42,7 @@ namespace Internal
 {
 namespace
 {
+DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_PERFORMANCE_MARKER, false);
 constexpr uint32_t DEFAULT_MAXIMUM_ALLOWED_TIME = 500u;
 
 /**
@@ -62,7 +64,8 @@ void EmitTapSignal(
   tap->SetNumberOfTouches(tapEvent.numberOfTouches);
   tap->SetScreenPoint(tapEvent.point);
   tap->SetLocalPoint(localPoint);
-  tap->SetGestureSourceType(tapEvent.gestureSourceType);
+  tap->SetSourceType(tapEvent.sourceType);
+  tap->SetSourceData(tapEvent.sourceData);
 
   Dali::Actor                                    actorHandle(actor);
   const GestureDetectorContainer::const_iterator endIter = gestureDetectors.end();
@@ -91,6 +94,7 @@ TapGestureProcessor::~TapGestureProcessor() = default;
 
 void TapGestureProcessor::Process(Scene& scene, const TapGestureEvent& tapEvent)
 {
+  DALI_TRACE_SCOPE(gTraceFilter, "DALI_PROCESS_TAP_GESTURE");
   switch(tapEvent.state)
   {
     case GestureState::POSSIBLE:
@@ -312,8 +316,7 @@ bool TapGestureProcessor::CheckGestureDetector(GestureDetector* detector, Actor*
 
   TapGestureDetector* tapDetector(static_cast<TapGestureDetector*>(detector));
 
-  return ((tapDetector->GetMinimumTapsRequired() <= mCurrentTapEvent->numberOfTaps) && (tapDetector->GetMaximumTapsRequired() >= mCurrentTapEvent->numberOfTaps)) &&
-         (tapDetector->GetTouchesRequired() == mCurrentTapEvent->numberOfTouches);
+  return (tapDetector->GetMinimumTapsRequired() <= mCurrentTapEvent->numberOfTaps) && (tapDetector->GetTouchesRequired() == mCurrentTapEvent->numberOfTouches);
 }
 
 void TapGestureProcessor::EmitGestureSignal(Actor* actor, const GestureDetectorContainer& gestureDetectors, Vector2 actorCoordinates)