Increase how far pan gestures try to predict position 1.0f is 1 frame further ahead. Can use decimals like 0.6 or 1.3.
Change-Id: Ib4cb8dbbd3367374e8c26f586be8b3e387e71e79
Signed-off-by: Julien Heanley <j.heanley@partner.samsung.com>
mPerformanceLoggingLevel(0),
mPanGestureLoggingLevel(0),
mPanGesturePredictionMode(-1),
+ mPanGesturePredictionAmount(-1.0f), ///< only sets value in pan gesture if greater than 0
mLogFunction( NULL )
{
}
return mPanGesturePredictionMode;
}
+float EnvironmentOptions::GetPanGesturePredictionAmount() const
+{
+ return mPanGesturePredictionAmount;
+}
+
+void EnvironmentOptions::SetPanGesturePredictionMode(unsigned int mode)
+{
+ mPanGesturePredictionMode = mode;
+}
+
+void EnvironmentOptions::SetPanGesturePredictionAmount(float amount)
+{
+ mPanGesturePredictionAmount = amount;
+}
+
} // Adaptor
} // Internal
unsigned int GetPanGestureSmoothingMode() const;
/**
+ * @return pan-gesture prediction amount
+ */
+ float GetPanGesturePredictionAmount() const;
+
+ /**
* @brief Sets the mode used to smooth pan gesture movement properties calculated on the Update thread
*
* @param[in] mode The smoothing mode to use
*/
- void SetPanGesturePredictionMode(unsigned int mode) { mPanGesturePredictionMode = mode; }
+ void SetPanGesturePredictionMode(unsigned int mode);
+
+ /**
+ * @brief Sets the prediction amount of the pan gesture
+ *
+ * @param[in] amount The prediction amount, 0.0f being next vsync and each 1.0f on top is another vsync ahead, can be divisions of (0.5f)
+ */
+ void SetPanGesturePredictionAmount(float amount);
private:
unsigned int mPerformanceLoggingLevel; ///< performance log level
unsigned int mPanGestureLoggingLevel; ///< pan-gesture log level
int mPanGesturePredictionMode; ///< prediction mode for pan gestures
+ float mPanGesturePredictionAmount; ///< prediction amount for pan gestures
Dali::Integration::Log::LogFunction mLogFunction;
#define DALI_ENV_PAN_PREDICTION_MODE "DALI_PAN_PREDICTION_MODE"
+#define DALI_ENV_PAN_PREDICTION_AMOUNT "DALI_PAN_PREDICTION_AMOUNT"
+
} // namespace Adaptor
} // namespace Internal
{
mEnvironmentOptions.SetPanGesturePredictionMode(predictionMode);
}
+ float predictionAmount = -1.0f;
+ if( GetFloatEnvironmentVariable(DALI_ENV_PAN_PREDICTION_AMOUNT, predictionAmount) )
+ {
+ mEnvironmentOptions.SetPanGesturePredictionAmount(predictionAmount);
+ }
mEnvironmentOptions.InstallLogFunction();
}
{
Integration::SetPanGesturePredictionMode(mEnvironmentOptions.GetPanGestureSmoothingMode());
}
+ if( mEnvironmentOptions.GetPanGesturePredictionAmount() >= 0.0f )
+ {
+ Integration::SetPanGesturePredictionAmount(mEnvironmentOptions.GetPanGesturePredictionAmount());
+ }
}
Adaptor::~Adaptor()