Revert "Remove setFrame from BufferStateLayer"
Revert "Update tests to reflect the new behavior for setGeometry"
Revert submission 13843937-sc_remove_set_frame
Reason for revert: Candidate CL for b/184807094
Reverted Changes:
Iffbd955a3:Remove setFrame
I27f17bc61:Update tests to reflect the new behavior for setGe...
I5720276c1:Remove setFrame from surface_control setGeometry
I32ee0e3e4:Remove setFrame from BufferStateLayer
Bug: 184807094
Change-Id: I8330f374c50c76d8c2e70b79815bc2bc32b89480
diff --git a/libs/gui/tests/BLASTBufferQueue_test.cpp b/libs/gui/tests/BLASTBufferQueue_test.cpp
index 9b1f0db..fe48d88 100644
--- a/libs/gui/tests/BLASTBufferQueue_test.cpp
+++ b/libs/gui/tests/BLASTBufferQueue_test.cpp
@@ -140,6 +140,7 @@
/*parent*/ nullptr);
t.setLayerStack(mSurfaceControl, 0)
.setLayer(mSurfaceControl, std::numeric_limits<int32_t>::max())
+ .setFrame(mSurfaceControl, Rect(resolution))
.show(mSurfaceControl)
.setDataspace(mSurfaceControl, ui::Dataspace::V0_SRGB)
.apply();
@@ -217,13 +218,13 @@
col >= region.left - border && col < region.right + border;
}
if (!outsideRegion && inRegion) {
- ASSERT_GE(epsilon, abs(r - *(pixel)));
- ASSERT_GE(epsilon, abs(g - *(pixel + 1)));
- ASSERT_GE(epsilon, abs(b - *(pixel + 2)));
+ EXPECT_GE(epsilon, abs(r - *(pixel)));
+ EXPECT_GE(epsilon, abs(g - *(pixel + 1)));
+ EXPECT_GE(epsilon, abs(b - *(pixel + 2)));
} else if (outsideRegion && !inRegion) {
- ASSERT_GE(epsilon, abs(r - *(pixel)));
- ASSERT_GE(epsilon, abs(g - *(pixel + 1)));
- ASSERT_GE(epsilon, abs(b - *(pixel + 2)));
+ EXPECT_GE(epsilon, abs(r - *(pixel)));
+ EXPECT_GE(epsilon, abs(g - *(pixel + 1)));
+ EXPECT_GE(epsilon, abs(b - *(pixel + 2)));
}
ASSERT_EQ(false, ::testing::Test::HasFailure());
}
@@ -465,8 +466,7 @@
ASSERT_EQ(NO_ERROR, captureDisplay(mCaptureArgs, mCaptureResults));
ASSERT_NO_FATAL_FAILURE(
- checkScreenCapture(r, g, b,
- {0, 0, (int32_t)mDisplayWidth, (int32_t)mDisplayHeight / 2}));
+ checkScreenCapture(r, g, b, {0, 0, (int32_t)mDisplayWidth, (int32_t)mDisplayHeight}));
}
TEST_F(BLASTBufferQueueTest, SetCrop_ScalingModeScaleCrop) {
@@ -523,15 +523,13 @@
// capture screen and verify that it is red
ASSERT_EQ(NO_ERROR, captureDisplay(mCaptureArgs, mCaptureResults));
- Rect bounds;
- bounds.left = finalCropSideLength / 2;
- bounds.top = 0;
- bounds.right = bounds.left + finalCropSideLength;
- bounds.bottom = finalCropSideLength;
-
- ASSERT_NO_FATAL_FAILURE(checkScreenCapture(r, g, b, bounds));
ASSERT_NO_FATAL_FAILURE(
- checkScreenCapture(0, 0, 0, bounds, /*border*/ 0, /*outsideRegion*/ true));
+ checkScreenCapture(r, g, b,
+ {0, 0, (int32_t)bufferSideLength, (int32_t)bufferSideLength}));
+ ASSERT_NO_FATAL_FAILURE(
+ checkScreenCapture(0, 0, 0,
+ {0, 0, (int32_t)bufferSideLength, (int32_t)bufferSideLength},
+ /*border*/ 0, /*outsideRegion*/ true));
}
class TestProducerListener : public BnProducerListener {
@@ -598,6 +596,7 @@
t.setLayerStack(bgSurface, 0)
.show(bgSurface)
.setDataspace(bgSurface, ui::Dataspace::V0_SRGB)
+ .setFrame(bgSurface, Rect(0, 0, mDisplayWidth, mDisplayHeight))
.setLayer(bgSurface, std::numeric_limits<int32_t>::max() - 1)
.apply();
@@ -620,8 +619,7 @@
ASSERT_EQ(NO_ERROR, captureDisplay(mCaptureArgs, mCaptureResults));
ASSERT_NO_FATAL_FAILURE(
- checkScreenCapture(r, g, b,
- {0, 0, (int32_t)mDisplayWidth, (int32_t)mDisplayHeight / 2}));
+ checkScreenCapture(r, g, b, {0, 0, (int32_t)mDisplayWidth, (int32_t)mDisplayHeight}));
}
class BLASTBufferQueueTransformTest : public BLASTBufferQueueTest {