diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2019-07-22 02:05:12 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-07-22 02:05:12 +0000 |
commit | 02a6e829744d5250ca2cf628c5bf8ed2afa5ebaa (patch) | |
tree | 7abd27724294ba738a635a89dbe33334e80838f2 | |
parent | c6806dbd337f7ff5461442e7ce95366cff6c9740 (diff) | |
parent | 37d4f127c9acf8918e91547b109794bba57908ce (diff) | |
download | platform_hardware_interfaces-02a6e829744d5250ca2cf628c5bf8ed2afa5ebaa.tar.gz platform_hardware_interfaces-02a6e829744d5250ca2cf628c5bf8ed2afa5ebaa.tar.bz2 platform_hardware_interfaces-02a6e829744d5250ca2cf628c5bf8ed2afa5ebaa.zip |
Merge cherrypicks of [8701731, 8702515, 8702516, 8702438, 8702439, 8702517, 8702440] into qt-release
Change-Id: I5a887f3f5f7041eaddf2c3a1812f20215c0d648e
-rw-r--r-- | graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp | 2 | ||||
-rw-r--r-- | graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp | 86 |
2 files changed, 54 insertions, 34 deletions
diff --git a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp index 30b96949dc..fa5ace65b1 100644 --- a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp +++ b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp @@ -790,7 +790,7 @@ TEST_F(GraphicsComposerHidlCommandTest, PRESENT_DISPLAY) { TEST_F(GraphicsComposerHidlCommandTest, PRESENT_DISPLAY_NO_LAYER_STATE_CHANGES) { mWriter->selectDisplay(mPrimaryDisplay); mComposerClient->setPowerMode(mPrimaryDisplay, IComposerClient::PowerMode::ON); - mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::SRGB); + mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::NATIVE); auto handle = allocate(); ASSERT_NE(nullptr, handle); diff --git a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp index 0648b3456a..02c4c9cec9 100644 --- a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp +++ b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp @@ -182,6 +182,14 @@ class GraphicsComposerReadbackTest : public ::testing::VtsHalHidlTargetTestBase mReader = std::make_unique<TestCommandReader>(); mGralloc = std::make_shared<Gralloc>(); + std::vector<ColorMode> colorModes = mComposerClient->getColorModes(mPrimaryDisplay); + if (std::find(colorModes.begin(), colorModes.end(), ColorMode::SRGB) == colorModes.end()) { + mHasReadbackBuffer = false; + return; + } + mWriter->selectDisplay(mPrimaryDisplay); + ASSERT_NO_FATAL_FAILURE(mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::SRGB, + RenderIntent::COLORIMETRIC)); mComposerClient->getRaw()->getReadbackBufferAttributes( mPrimaryDisplay, [&](const auto& tmpError, const auto& tmpPixelFormat, const auto& tmpDataspace) { @@ -471,12 +479,12 @@ class TestBufferLayer : public TestLayer { TEST_F(GraphicsComposerReadbackTest, SingleSolidColorLayer) { if (!mHasReadbackBuffer) { + std::cout << "Readback not supported or unsuppported pixelFormat/dataspace or SRGB not a " + "valid color mode" + << std::endl; GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - mWriter->selectDisplay(mPrimaryDisplay); - ASSERT_NO_FATAL_FAILURE(mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::SRGB, - RenderIntent::COLORIMETRIC)); auto layer = std::make_shared<TestColorLayer>(mComposerClient, mPrimaryDisplay); IComposerClient::Rect coloredSquare({0, 0, mDisplayWidth, mDisplayHeight}); @@ -515,12 +523,13 @@ TEST_F(GraphicsComposerReadbackTest, SingleSolidColorLayer) { TEST_F(GraphicsComposerReadbackTest, SetLayerBuffer) { if (!mHasReadbackBuffer) { + std::cout << "Readback not supported or unsuppported pixelFormat/dataspace or SRGB not a " + "valid color mode" + << std::endl; GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - mWriter->selectDisplay(mPrimaryDisplay); - ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace); ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer()); @@ -562,13 +571,13 @@ TEST_F(GraphicsComposerReadbackTest, SetLayerBuffer) { TEST_F(GraphicsComposerReadbackTest, SetLayerBufferNoEffect) { if (!mHasReadbackBuffer) { + std::cout << "Readback not supported or unsuppported pixelFormat/dataspace or SRGB not a " + "valid color mode" + << std::endl; GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - mWriter->selectDisplay(mPrimaryDisplay); - ASSERT_NO_FATAL_FAILURE(mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::SRGB, - RenderIntent::COLORIMETRIC)); auto layer = std::make_shared<TestColorLayer>(mComposerClient, mPrimaryDisplay); IComposerClient::Rect coloredSquare({0, 0, mDisplayWidth, mDisplayHeight}); @@ -611,12 +620,13 @@ TEST_F(GraphicsComposerReadbackTest, SetLayerBufferNoEffect) { TEST_F(GraphicsComposerReadbackTest, ClientComposition) { if (!mHasReadbackBuffer) { + std::cout << "Readback not supported or unsuppported pixelFormat/dataspace or SRGB not a " + "valid color mode" + << std::endl; GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - mWriter->selectDisplay(mPrimaryDisplay); - std::vector<IComposerClient::Color> expectedColors(mDisplayWidth * mDisplayHeight); fillColorsArea(expectedColors, mDisplayWidth, {0, 0, mDisplayWidth, mDisplayHeight / 4}, RED); fillColorsArea(expectedColors, mDisplayWidth, @@ -690,11 +700,13 @@ TEST_F(GraphicsComposerReadbackTest, ClientComposition) { TEST_F(GraphicsComposerReadbackTest, DeviceAndClientComposition) { if (!mHasReadbackBuffer) { + std::cout << "Readback not supported or unsuppported pixelFormat/dataspace or SRGB not a " + "valid color mode" + << std::endl; GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - mWriter->selectDisplay(mPrimaryDisplay); ASSERT_NO_FATAL_FAILURE( mComposerClient->setClientTargetSlotCount(mPrimaryDisplay, kClientTargetSlotCount)); @@ -776,12 +788,13 @@ TEST_F(GraphicsComposerReadbackTest, DeviceAndClientComposition) { TEST_F(GraphicsComposerReadbackTest, SetLayerDamage) { if (!mHasReadbackBuffer) { + std::cout << "Readback not supported or unsuppported pixelFormat/dataspace or SRGB not a " + "valid color mode" + << std::endl; GTEST_SUCCEED() << "Readback not supported or unsupported pixelformat/dataspace"; return; } - mWriter->selectDisplay(mPrimaryDisplay); - IComposerClient::Rect redRect = {0, 0, mDisplayWidth / 4, mDisplayHeight / 4}; std::vector<IComposerClient::Color> expectedColors(mDisplayWidth * mDisplayHeight); @@ -842,14 +855,13 @@ TEST_F(GraphicsComposerReadbackTest, SetLayerDamage) { TEST_F(GraphicsComposerReadbackTest, SetLayerPlaneAlpha) { if (!mHasReadbackBuffer) { + std::cout << "Readback not supported or unsuppported pixelFormat/dataspace or SRGB not a " + "valid color mode" + << std::endl; GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - mWriter->selectDisplay(mPrimaryDisplay); - ASSERT_NO_FATAL_FAILURE(mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::SRGB, - RenderIntent::COLORIMETRIC)); - auto layer = std::make_shared<TestColorLayer>(mComposerClient, mPrimaryDisplay); layer->setColor(RED); layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); @@ -886,12 +898,13 @@ TEST_F(GraphicsComposerReadbackTest, SetLayerPlaneAlpha) { TEST_F(GraphicsComposerReadbackTest, SetLayerSourceCrop) { if (!mHasReadbackBuffer) { + std::cout << "Readback not supported or unsuppported pixelFormat/dataspace or SRGB not a " + "valid color mode" + << std::endl; GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - mWriter->selectDisplay(mPrimaryDisplay); - std::vector<IComposerClient::Color> expectedColors(mDisplayWidth * mDisplayHeight); fillColorsArea(expectedColors, mDisplayWidth, {0, 0, mDisplayWidth, mDisplayHeight / 4}, RED); fillColorsArea(expectedColors, mDisplayWidth, @@ -931,14 +944,13 @@ TEST_F(GraphicsComposerReadbackTest, SetLayerSourceCrop) { TEST_F(GraphicsComposerReadbackTest, SetLayerZOrder) { if (!mHasReadbackBuffer) { + std::cout << "Readback not supported or unsuppported pixelFormat/dataspace or SRGB not a " + "valid color mode" + << std::endl; GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - mWriter->selectDisplay(mPrimaryDisplay); - ASSERT_NO_FATAL_FAILURE(mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::SRGB, - RenderIntent::COLORIMETRIC)); - IComposerClient::Rect redRect = {0, 0, mDisplayWidth, mDisplayHeight / 2}; IComposerClient::Rect blueRect = {0, mDisplayHeight / 4, mDisplayWidth, mDisplayHeight}; auto redLayer = std::make_shared<TestColorLayer>(mComposerClient, mPrimaryDisplay); @@ -1081,12 +1093,13 @@ class GraphicsComposerBlendModeReadbackTest : public GraphicsComposerReadbackTes TEST_P(GraphicsComposerBlendModeReadbackTest, None) { if (!mHasReadbackBuffer) { + std::cout << "Readback not supported or unsuppported pixelFormat/dataspace or SRGB not a " + "valid color mode" + << std::endl; GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - mWriter->selectDisplay(mPrimaryDisplay); - std::vector<IComposerClient::Color> expectedColors(mDisplayWidth * mDisplayHeight); setBackgroundColor(BLACK); @@ -1118,12 +1131,13 @@ TEST_P(GraphicsComposerBlendModeReadbackTest, None) { // alpha of .2, expected 10.2 TEST_P(GraphicsComposerBlendModeReadbackTest, DISABLED_Coverage) { if (!mHasReadbackBuffer) { + std::cout << "Readback not supported or unsuppported pixelFormat/dataspace or SRGB not a " + "valid color mode" + << std::endl; GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - mWriter->selectDisplay(mPrimaryDisplay); - std::vector<IComposerClient::Color> expectedColors(mDisplayWidth * mDisplayHeight); setBackgroundColor(BLACK); @@ -1153,12 +1167,13 @@ TEST_P(GraphicsComposerBlendModeReadbackTest, DISABLED_Coverage) { TEST_P(GraphicsComposerBlendModeReadbackTest, Premultiplied) { if (!mHasReadbackBuffer) { + std::cout << "Readback not supported or unsuppported pixelFormat/dataspace or SRGB not a " + "valid color mode" + << std::endl; GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } - mWriter->selectDisplay(mPrimaryDisplay); - std::vector<IComposerClient::Color> expectedColors(mDisplayWidth * mDisplayHeight); setBackgroundColor(BLACK); @@ -1193,10 +1208,6 @@ class GraphicsComposerTransformReadbackTest : public GraphicsComposerReadbackTes void SetUp() override { GraphicsComposerReadbackTest::SetUp(); - mWriter->selectDisplay(mPrimaryDisplay); - ASSERT_NO_FATAL_FAILURE(mComposerClient->setColorMode(mPrimaryDisplay, ColorMode::SRGB, - RenderIntent::COLORIMETRIC)); - auto backgroundLayer = std::make_shared<TestColorLayer>(mComposerClient, mPrimaryDisplay); backgroundLayer->setColor({0, 0, 0, 0}); backgroundLayer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight}); @@ -1230,6 +1241,9 @@ class GraphicsComposerTransformReadbackTest : public GraphicsComposerReadbackTes TEST_F(GraphicsComposerTransformReadbackTest, FLIP_H) { if (!mHasReadbackBuffer) { + std::cout << "Readback not supported or unsuppported pixelFormat/dataspace or SRGB not a " + "valid color mode" + << std::endl; GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } @@ -1262,6 +1276,9 @@ TEST_F(GraphicsComposerTransformReadbackTest, FLIP_H) { TEST_F(GraphicsComposerTransformReadbackTest, FLIP_V) { if (!mHasReadbackBuffer) { + std::cout << "Readback not supported or unsuppported pixelFormat/dataspace or SRGB not a " + "valid color mode" + << std::endl; GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } @@ -1295,6 +1312,9 @@ TEST_F(GraphicsComposerTransformReadbackTest, FLIP_V) { TEST_F(GraphicsComposerTransformReadbackTest, ROT_180) { if (!mHasReadbackBuffer) { + std::cout << "Readback not supported or unsuppported pixelFormat/dataspace or SRGB not a " + "valid color mode" + << std::endl; GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace"; return; } |