Add shouldBeSeamless to setFrameRate
This CL adds a new parameter shouldBeSeamless to the existing
setFrameRate APIs. This parameter indicates whether the desired
refresh rate should be achieved only seamlessly or also switches
with visual interruptions for the user are allowed. The default
value of the new parameter is "true".
Test: atest RefreshRateConfigsTest
Test: atest SetFrameRateTest
Test: atest libsurfaceflinger_unittest
Test: atest libgui_test
Bug: 161776961
Change-Id: I0df16e09f77c8c198fd3733fb581a2aaadfed685
diff --git a/services/surfaceflinger/tests/SetFrameRate_test.cpp b/services/surfaceflinger/tests/SetFrameRate_test.cpp
index 02ba9e2..d1bed0c 100644
--- a/services/surfaceflinger/tests/SetFrameRate_test.cpp
+++ b/services/surfaceflinger/tests/SetFrameRate_test.cpp
@@ -14,10 +14,6 @@
* limitations under the License.
*/
-// TODO(b/129481165): remove the #pragma below and fix conversion issues
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wconversion"
-
#include <system/window.h>
#include <thread>
@@ -50,8 +46,8 @@
}
}
- const int mLayerWidth = 32;
- const int mLayerHeight = 32;
+ const uint32_t mLayerWidth = 32;
+ const uint32_t mLayerHeight = 32;
sp<SurfaceControl> mLayer;
uint32_t mLayerType;
};
@@ -59,26 +55,27 @@
TEST_F(SetFrameRateTest, BufferQueueLayerSetFrameRate) {
CreateLayer(ISurfaceComposerClient::eFXSurfaceBufferQueue);
native_window_set_frame_rate(mLayer->getSurface().get(), 100.f,
- ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT);
+ ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT,
+ /* shouldBeSeamless */ true);
ASSERT_NO_FATAL_FAILURE(PostBuffers(Color::RED));
Transaction()
- .setFrameRate(mLayer, 200.f, ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT)
+ .setFrameRate(mLayer, 200.f, ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT,
+ /* shouldBeSeamless */ true)
.apply();
ASSERT_NO_FATAL_FAILURE(PostBuffers(Color::RED));
native_window_set_frame_rate(mLayer->getSurface().get(), 300.f,
- ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT);
+ ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT,
+ /* shouldBeSeamless */ true);
ASSERT_NO_FATAL_FAILURE(PostBuffers(Color::RED));
}
TEST_F(SetFrameRateTest, BufferStateLayerSetFrameRate) {
CreateLayer(ISurfaceComposerClient::eFXSurfaceBufferState);
Transaction()
- .setFrameRate(mLayer, 400.f, ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT)
+ .setFrameRate(mLayer, 400.f, ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT,
+ /* shouldBeSeamless */ true)
.apply();
ASSERT_NO_FATAL_FAILURE(PostBuffers(Color::GREEN));
}
} // namespace android
-
-// TODO(b/129481165): remove the #pragma below and fix conversion issues
-#pragma clang diagnostic pop // ignored "-Wconversion"
\ No newline at end of file