Loading services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -362,6 +362,7 @@ LayerSnapshot LayerSnapshotBuilder::getRootSnapshot() { snapshot.gameMode = gui::GameMode::Unsupported; snapshot.frameRate = {}; snapshot.fixedTransformHint = ui::Transform::ROT_INVALID; snapshot.ignoreLocalTransform = false; return snapshot; } Loading services/surfaceflinger/tests/MirrorLayer_test.cpp +20 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #pragma clang diagnostic ignored "-Wconversion" #include <android-base/properties.h> #include <common/FlagManager.h> #include <private/android_filesystem_config.h> #include "LayerTransactionTest.h" #include "utils/TransactionUtils.h" Loading Loading @@ -78,6 +79,10 @@ TEST_F(MirrorLayerTest, MirrorColorLayer) { .show(mirrorLayer) .apply(); if (FlagManager::getInstance().detached_mirror()) { Transaction().setPosition(mirrorLayer, 550, 550).apply(); } { SCOPED_TRACE("Initial Mirror"); auto shot = screenshot(); Loading Loading @@ -172,6 +177,9 @@ TEST_F(MirrorLayerTest, MirrorBufferLayer) { .show(mirrorLayer) .apply(); if (FlagManager::getInstance().detached_mirror()) { Transaction().setPosition(mirrorLayer, 550, 550).apply(); } { SCOPED_TRACE("Initial Mirror BufferQueueLayer"); auto shot = screenshot(); Loading Loading @@ -263,6 +271,9 @@ TEST_F(MirrorLayerTest, InitialMirrorState) { .setLayer(mirrorLayer, INT32_MAX - 1) .apply(); if (FlagManager::getInstance().detached_mirror()) { Transaction().setPosition(mirrorLayer, 550, 550).apply(); } { SCOPED_TRACE("Offscreen Mirror"); auto shot = screenshot(); Loading Loading @@ -313,8 +324,15 @@ TEST_F(MirrorLayerTest, OffscreenMirrorScreenshot) { ASSERT_NE(mirrorLayer, nullptr); } sp<SurfaceControl> mirrorParent = createLayer("Grandchild layer", 50, 50, ISurfaceComposerClient::eFXSurfaceBufferState); // Show the mirror layer, but don't reparent to a layer on screen. Transaction().show(mirrorLayer).apply(); Transaction().reparent(mirrorLayer, mirrorParent).show(mirrorLayer).apply(); if (FlagManager::getInstance().detached_mirror()) { Transaction().setPosition(mirrorLayer, 50, 50).apply(); } { SCOPED_TRACE("Offscreen Mirror"); Loading @@ -331,7 +349,7 @@ TEST_F(MirrorLayerTest, OffscreenMirrorScreenshot) { SCOPED_TRACE("Capture Mirror"); // Capture just the mirror layer and child. LayerCaptureArgs captureArgs; captureArgs.layerHandle = mirrorLayer->getHandle(); captureArgs.layerHandle = mirrorParent->getHandle(); captureArgs.sourceCrop = childBounds; std::unique_ptr<ScreenCapture> shot; ScreenCapture::captureLayers(&shot, captureArgs); Loading Loading
services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -362,6 +362,7 @@ LayerSnapshot LayerSnapshotBuilder::getRootSnapshot() { snapshot.gameMode = gui::GameMode::Unsupported; snapshot.frameRate = {}; snapshot.fixedTransformHint = ui::Transform::ROT_INVALID; snapshot.ignoreLocalTransform = false; return snapshot; } Loading
services/surfaceflinger/tests/MirrorLayer_test.cpp +20 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #pragma clang diagnostic ignored "-Wconversion" #include <android-base/properties.h> #include <common/FlagManager.h> #include <private/android_filesystem_config.h> #include "LayerTransactionTest.h" #include "utils/TransactionUtils.h" Loading Loading @@ -78,6 +79,10 @@ TEST_F(MirrorLayerTest, MirrorColorLayer) { .show(mirrorLayer) .apply(); if (FlagManager::getInstance().detached_mirror()) { Transaction().setPosition(mirrorLayer, 550, 550).apply(); } { SCOPED_TRACE("Initial Mirror"); auto shot = screenshot(); Loading Loading @@ -172,6 +177,9 @@ TEST_F(MirrorLayerTest, MirrorBufferLayer) { .show(mirrorLayer) .apply(); if (FlagManager::getInstance().detached_mirror()) { Transaction().setPosition(mirrorLayer, 550, 550).apply(); } { SCOPED_TRACE("Initial Mirror BufferQueueLayer"); auto shot = screenshot(); Loading Loading @@ -263,6 +271,9 @@ TEST_F(MirrorLayerTest, InitialMirrorState) { .setLayer(mirrorLayer, INT32_MAX - 1) .apply(); if (FlagManager::getInstance().detached_mirror()) { Transaction().setPosition(mirrorLayer, 550, 550).apply(); } { SCOPED_TRACE("Offscreen Mirror"); auto shot = screenshot(); Loading Loading @@ -313,8 +324,15 @@ TEST_F(MirrorLayerTest, OffscreenMirrorScreenshot) { ASSERT_NE(mirrorLayer, nullptr); } sp<SurfaceControl> mirrorParent = createLayer("Grandchild layer", 50, 50, ISurfaceComposerClient::eFXSurfaceBufferState); // Show the mirror layer, but don't reparent to a layer on screen. Transaction().show(mirrorLayer).apply(); Transaction().reparent(mirrorLayer, mirrorParent).show(mirrorLayer).apply(); if (FlagManager::getInstance().detached_mirror()) { Transaction().setPosition(mirrorLayer, 50, 50).apply(); } { SCOPED_TRACE("Offscreen Mirror"); Loading @@ -331,7 +349,7 @@ TEST_F(MirrorLayerTest, OffscreenMirrorScreenshot) { SCOPED_TRACE("Capture Mirror"); // Capture just the mirror layer and child. LayerCaptureArgs captureArgs; captureArgs.layerHandle = mirrorLayer->getHandle(); captureArgs.layerHandle = mirrorParent->getHandle(); captureArgs.sourceCrop = childBounds; std::unique_ptr<ScreenCapture> shot; ScreenCapture::captureLayers(&shot, captureArgs); Loading