Skip to content

Commit 87d7532

Browse files
cairno-googleAndroid (Google) Code Review
authored andcommitted
Merge "Fix virtual display screenshot test on tangor" into main
2 parents 1e9f87e + 28b5bb1 commit 87d7532

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

services/surfaceflinger/tests/TransactionTestHarnesses.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ class LayerRenderPathTestHarness {
4848

4949
ui::DisplayMode displayMode;
5050
SurfaceComposerClient::getActiveDisplayMode(displayToken, &displayMode);
51-
const ui::Size& resolution = displayMode.resolution;
51+
ui::Size resolution = displayMode.resolution;
52+
if (displayState.orientation == ui::Rotation::Rotation90 ||
53+
displayState.orientation == ui::Rotation::Rotation270) {
54+
std::swap(resolution.width, resolution.height);
55+
}
5256

5357
sp<IBinder> vDisplay;
5458

@@ -93,8 +97,8 @@ class LayerRenderPathTestHarness {
9397
#else
9498
t.setDisplaySurface(vDisplay, producer);
9599
#endif // COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_CONSUMER_BASE_OWNS_BQ)
96-
t.setDisplayProjection(vDisplay, displayState.orientation,
97-
Rect(displayState.layerStackSpaceRect), Rect(resolution));
100+
t.setDisplayProjection(vDisplay, ui::Rotation::Rotation0, Rect(resolution),
101+
Rect(resolution));
98102
t.setDisplayLayerStack(vDisplay, layerStack);
99103
t.setLayerStack(mirrorSc, layerStack);
100104
t.apply();

0 commit comments

Comments
 (0)