summaryrefslogtreecommitdiff
path: root/native/android
diff options
context:
space:
mode:
authorMarin Shalamanov <shalamanov@google.com>2021-03-31 14:30:23 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-03-31 14:30:23 +0000
commitd15b4b5473cb4135583e0399aaea9ea2fdd07e28 (patch)
treec5239128a984357137f2ab786ad60faf94e6de67 /native/android
parent0db0591fe88ffdd500b780a7eea50cd813d58404 (diff)
parent511f9145bac4c52ba444935738e5bcd2c1bd8bad (diff)
Merge "setFrameRate: Make shouldBeSeamless an enum" into sc-dev
Diffstat (limited to 'native/android')
-rw-r--r--native/android/libandroid.map.txt2
-rw-r--r--native/android/surface_control.cpp19
2 files changed, 11 insertions, 10 deletions
diff --git a/native/android/libandroid.map.txt b/native/android/libandroid.map.txt
index 35249f615e6b..a2fde4ecd3a2 100644
--- a/native/android/libandroid.map.txt
+++ b/native/android/libandroid.map.txt
@@ -253,7 +253,7 @@ LIBANDROID {
ASurfaceTransaction_setDamageRegion; # introduced=29
ASurfaceTransaction_setDesiredPresentTime; # introduced=29
ASurfaceTransaction_setFrameRate; # introduced=30
- ASurfaceTransaction_setFrameRateWithSeamlessness; # introduced=31
+ ASurfaceTransaction_setFrameRateWithChangeStrategy; # introduced=31
ASurfaceTransaction_setGeometry; # introduced=29
ASurfaceTransaction_setHdrMetadata_cta861_3; # introduced=29
ASurfaceTransaction_setHdrMetadata_smpte2086; # introduced=29
diff --git a/native/android/surface_control.cpp b/native/android/surface_control.cpp
index 195fd5e60295..80cf663978a9 100644
--- a/native/android/surface_control.cpp
+++ b/native/android/surface_control.cpp
@@ -634,24 +634,25 @@ void ASurfaceTransaction_setColor(ASurfaceTransaction* aSurfaceTransaction,
color.g = g;
color.b = b;
- transaction->setBackgroundColor(surfaceControl, color, alpha, static_cast<ui::Dataspace>(dataspace));
+ transaction->setBackgroundColor(surfaceControl, color, alpha,
+ static_cast<ui::Dataspace>(dataspace));
}
void ASurfaceTransaction_setFrameRate(ASurfaceTransaction* aSurfaceTransaction,
ASurfaceControl* aSurfaceControl, float frameRate,
int8_t compatibility) {
- ASurfaceTransaction_setFrameRateWithSeamlessness(aSurfaceTransaction, aSurfaceControl,
- frameRate, compatibility,
- /*shouldBeSeamless*/ true);
+ ASurfaceTransaction_setFrameRateWithChangeStrategy(
+ aSurfaceTransaction, aSurfaceControl, frameRate, compatibility,
+ ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS);
}
-void ASurfaceTransaction_setFrameRateWithSeamlessness(ASurfaceTransaction* aSurfaceTransaction,
- ASurfaceControl* aSurfaceControl,
- float frameRate, int8_t compatibility,
- bool shouldBeSeamless) {
+void ASurfaceTransaction_setFrameRateWithChangeStrategy(ASurfaceTransaction* aSurfaceTransaction,
+ ASurfaceControl* aSurfaceControl,
+ float frameRate, int8_t compatibility,
+ int8_t changeFrameRateStrategy) {
CHECK_NOT_NULL(aSurfaceTransaction);
CHECK_NOT_NULL(aSurfaceControl);
Transaction* transaction = ASurfaceTransaction_to_Transaction(aSurfaceTransaction);
sp<SurfaceControl> surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl);
- transaction->setFrameRate(surfaceControl, frameRate, compatibility, shouldBeSeamless);
+ transaction->setFrameRate(surfaceControl, frameRate, compatibility, changeFrameRateStrategy);
}