summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorScott Lobdell <slobdell@google.com>2021-06-04 22:06:41 +0000
committerDaniel Norman <danielnorman@google.com>2021-06-14 11:36:52 -0700
commit9ee6327f2735d3ce1e3b4a8c24abb40efb140aad (patch)
treebe99ef889ca0713e425355c1a60395e0d1d002de /include
parent21424542db9bbf4236bcea0639c29720c502618e (diff)
parent580905adeb38e9ca68db5d8dbc73deb8583f7a96 (diff)
Merge SP1A.210604.001
Change-Id: I973aba6b24c5a18f50cc414db6437aaee94648d9
Diffstat (limited to 'include')
-rw-r--r--include/android/surface_control.h10
-rw-r--r--include/input/InputDevice.h2
-rw-r--r--include/input/LatencyStatistics.h59
3 files changed, 11 insertions, 60 deletions
diff --git a/include/android/surface_control.h b/include/android/surface_control.h
index 351e6faf24..059bc41f9a 100644
--- a/include/android/surface_control.h
+++ b/include/android/surface_control.h
@@ -133,6 +133,9 @@ typedef struct ASurfaceTransactionStats ASurfaceTransactionStats;
* ASurfaceTransaction_OnComplete callback can be used to be notified when a frame
* including the updates in a transaction was presented.
*
+ * Buffers which are replaced or removed from the scene in the transaction invoking
+ * this callback may be reused after this point.
+ *
* \param context Optional context provided by the client that is passed into
* the callback.
*
@@ -153,6 +156,13 @@ typedef void (*ASurfaceTransaction_OnComplete)(void* context, ASurfaceTransactio
* are ready to be presented. This callback will be invoked before the
* ASurfaceTransaction_OnComplete callback.
*
+ * This callback does not mean buffers have been released! It simply means that any new
+ * transactions applied will not overwrite the transaction for which we are receiving
+ * a callback and instead will be included in the next frame. If you are trying to avoid
+ * dropping frames (overwriting transactions), and unable to use timestamps (Which provide
+ * a more efficient solution), then this method provides a method to pace your transaction
+ * application.
+ *
* \param context Optional context provided by the client that is passed into the callback.
*
* \param stats Opaque handle that can be passed to ASurfaceTransactionStats functions to query
diff --git a/include/input/InputDevice.h b/include/input/InputDevice.h
index 712adfa57b..1fec08027f 100644
--- a/include/input/InputDevice.h
+++ b/include/input/InputDevice.h
@@ -101,7 +101,7 @@ enum class InputDeviceSensorReportingMode : int32_t {
};
enum class InputDeviceLightType : int32_t {
- SINGLE = 0,
+ MONO = 0,
PLAYER_ID = 1,
RGB = 2,
MULTI_COLOR = 3,
diff --git a/include/input/LatencyStatistics.h b/include/input/LatencyStatistics.h
deleted file mode 100644
index bd86266901..0000000000
--- a/include/input/LatencyStatistics.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _UI_INPUT_STATISTICS_H
-#define _UI_INPUT_STATISTICS_H
-
-#include <android-base/chrono_utils.h>
-
-#include <stddef.h>
-
-namespace android {
-
-class LatencyStatistics {
-private:
- /* Minimum sample recorded */
- float mMin;
- /* Maximum sample recorded */
- float mMax;
- /* Sum of all samples recorded */
- float mSum;
- /* Sum of all the squares of samples recorded */
- float mSum2;
- /* Count of all samples recorded */
- size_t mCount;
- /* The last time statistics were reported */
- std::chrono::steady_clock::time_point mLastReportTime;
- /* Statistics Report Frequency */
- const std::chrono::seconds mReportPeriod;
-
-public:
- LatencyStatistics(std::chrono::seconds period);
-
- void addValue(float);
- void reset();
- bool shouldReport();
-
- float getMean();
- float getMin();
- float getMax();
- float getStDev();
- size_t getCount();
-};
-
-} // namespace android
-
-#endif // _UI_INPUT_STATISTICS_H