Skip to content

Commit 91574af

Browse files
author
Melody Hsu
committed
Update MultiDisplay_test for duplicate layerstacks
Duplicate layerstacks are no longer permitted, but existing MultiDisplay tests do not catch these cases since the tests do not go through the SF composite path where the duplicates are rejected. Mirroring logic between physical and virtual displays is no longer applicable, and an exisiting test already captures this mirroring logic without duplicate layerstacks. Bug: b/370358572 Test: atest MultiDisplayTest Flag: EXEMPT, update test Change-Id: I301c049740597865e72ea7450b692e5278dca24d
1 parent 2dc2afe commit 91574af

File tree

1 file changed

+3
-28
lines changed

1 file changed

+3
-28
lines changed

services/surfaceflinger/tests/MultiDisplay_test.cpp

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -125,39 +125,14 @@ TEST_F(MultiDisplayTest, RenderLayerInVirtualDisplay) {
125125
}
126126

127127
TEST_F(MultiDisplayTest, RenderLayerInMirroredVirtualDisplay) {
128-
// Create a display and set its layer stack to the main display's layer stack so
129-
// the contents of the main display are mirrored on to the virtual display.
130-
131-
// Assumption here is that the new mirrored display has the same layer stack rect as the
132-
// primary display that it is mirroring.
133-
createDisplay(mMainDisplayState.layerStackSpaceRect, ui::DEFAULT_LAYER_STACK);
134-
createColorLayer(ui::DEFAULT_LAYER_STACK);
135-
136-
sp<SurfaceControl> mirrorSc =
137-
SurfaceComposerClient::getDefault()->mirrorDisplay(mMainDisplayId);
138-
139-
asTransaction([&](Transaction& t) { t.setPosition(mColorLayer, 10, 10); });
140-
141-
// Verify color layer renders correctly on main display and it is mirrored on the
142-
// virtual display.
143-
std::unique_ptr<ScreenCapture> sc;
144-
ScreenCapture::captureScreen(&sc, mMainDisplay);
145-
sc->expectColor(Rect(10, 10, 40, 50), mExpectedColor);
146-
sc->expectColor(Rect(0, 0, 9, 9), {0, 0, 0, 255});
147-
148-
ScreenCapture::captureScreen(&sc, mVirtualDisplay);
149-
sc->expectColor(Rect(10, 10, 40, 50), mExpectedColor);
150-
sc->expectColor(Rect(0, 0, 9, 9), {0, 0, 0, 255});
151-
}
152-
153-
TEST_F(MultiDisplayTest, RenderLayerWithPromisedFenceInMirroredVirtualDisplay) {
154128
// Create a display and use a unique layerstack ID for mirrorDisplay() so
155129
// the contents of the main display are mirrored on to the virtual display.
156130

157131
// A unique layerstack ID must be used because sharing the same layerFE
158132
// with more than one display is unsupported. A unique layerstack ensures
159-
// that a different layerFE is used between displays.
160-
constexpr ui::LayerStack layerStack{77687666}; // ASCII for MDLB (MultiDisplayLayerBounds)
133+
// that a different layerFE is used between displays. Each layerFE has a
134+
// promised fence that is each fulfilled.
135+
constexpr ui::LayerStack layerStack{776884}; // ASCII for MDT (MultiDisplayTest)
161136
createDisplay(mMainDisplayState.layerStackSpaceRect, layerStack);
162137
createColorLayer(ui::DEFAULT_LAYER_STACK);
163138

0 commit comments

Comments
 (0)