setFrameRate: Make shouldBeSeamless an enum
Change the shouldBeSeamless parameter to an enum
in order to make the API easier to understand.
This changes
- SurfaceControl.setFrameRate
- Surface.setFrameRate
- ANativeWindow_setFrameRateWithChangeStrategy
- ASurfaceTransaction_setFrameRateWithChangeStrategy
Bug: 179116474
Test: atest SetFrameRateTest
Change-Id: I28a8863ea77101f90b878fbda5f00d98e075b7cc
diff --git a/libs/gui/include/gui/ISurfaceComposer.h b/libs/gui/include/gui/ISurfaceComposer.h
index 88cfe4b..3cf9a73 100644
--- a/libs/gui/include/gui/ISurfaceComposer.h
+++ b/libs/gui/include/gui/ISurfaceComposer.h
@@ -461,7 +461,7 @@
* Sets the intended frame rate for a surface. See ANativeWindow_setFrameRate() for more info.
*/
virtual status_t setFrameRate(const sp<IGraphicBufferProducer>& surface, float frameRate,
- int8_t compatibility, bool shouldBeSeamless) = 0;
+ int8_t compatibility, int8_t changeFrameRateStrategy) = 0;
/*
* Acquire a frame rate flexibility token from SurfaceFlinger. While this token is acquired,
diff --git a/libs/gui/include/gui/LayerState.h b/libs/gui/include/gui/LayerState.h
index f7a6698..cc8cc0d 100644
--- a/libs/gui/include/gui/LayerState.h
+++ b/libs/gui/include/gui/LayerState.h
@@ -208,7 +208,7 @@
// Layer frame rate and compatibility. See ANativeWindow_setFrameRate().
float frameRate;
int8_t frameRateCompatibility;
- bool shouldBeSeamless;
+ int8_t changeFrameRateStrategy;
// Set by window manager indicating the layer and all its children are
// in a different orientation than the display. The hint suggests that
@@ -305,10 +305,11 @@
//
// @param frameRate the frame rate in Hz
// @param compatibility a ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_*
+// @param changeFrameRateStrategy a ANATIVEWINDOW_CHANGE_FRAME_RATE_*
// @param functionName calling function or nullptr. Used for logging
// @param privileged whether caller has unscoped surfaceflinger access
-bool ValidateFrameRate(float frameRate, int8_t compatibility, const char* functionName,
- bool privileged = false);
+bool ValidateFrameRate(float frameRate, int8_t compatibility, int8_t changeFrameRateStrategy,
+ const char* functionName, bool privileged = false);
struct CaptureArgs {
const static int32_t UNSET_UID = -1;
diff --git a/libs/gui/include/gui/Surface.h b/libs/gui/include/gui/Surface.h
index 5881221..d22bdaa 100644
--- a/libs/gui/include/gui/Surface.h
+++ b/libs/gui/include/gui/Surface.h
@@ -187,7 +187,8 @@
status_t getUniqueId(uint64_t* outId) const;
status_t getConsumerUsage(uint64_t* outUsage) const;
- virtual status_t setFrameRate(float frameRate, int8_t compatibility, bool shouldBeSeamless);
+ virtual status_t setFrameRate(float frameRate, int8_t compatibility,
+ int8_t changeFrameRateStrategy);
virtual status_t setFrameTimelineInfo(const FrameTimelineInfo& info);
virtual status_t getExtraBufferCount(int* extraBuffers) const;
diff --git a/libs/gui/include/gui/SurfaceComposerClient.h b/libs/gui/include/gui/SurfaceComposerClient.h
index 40c4135..4997e36 100644
--- a/libs/gui/include/gui/SurfaceComposerClient.h
+++ b/libs/gui/include/gui/SurfaceComposerClient.h
@@ -509,7 +509,7 @@
Transaction& setShadowRadius(const sp<SurfaceControl>& sc, float cornerRadius);
Transaction& setFrameRate(const sp<SurfaceControl>& sc, float frameRate,
- int8_t compatibility, bool shouldBeSeamless);
+ int8_t compatibility, int8_t changeFrameRateStrategy);
// Set by window manager indicating the layer and all its children are
// in a different orientation than the display. The hint suggests that