Merge "setFrameRate: Make shouldBeSeamless an enum" into sc-dev

This commit is contained in:
Marin Shalamanov
2021-03-31 14:30:23 +00:00
committed by Android (Google) Code Review
7 changed files with 61 additions and 47 deletions

View File

@@ -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

View File

@@ -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);
}