Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 17 | #include <cmath> |
| 18 | |
Lloyd Pique | 3d0c02e | 2018-10-19 18:38:12 -0700 | [diff] [blame] | 19 | #include <compositionengine/DisplayColorProfileCreationArgs.h> |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 20 | #include <compositionengine/DisplayCreationArgs.h> |
Lloyd Pique | 31cb294 | 2018-10-19 17:23:03 -0700 | [diff] [blame] | 21 | #include <compositionengine/DisplaySurface.h> |
| 22 | #include <compositionengine/RenderSurfaceCreationArgs.h> |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 23 | #include <compositionengine/impl/Display.h> |
Lloyd Pique | c660755 | 2019-12-02 17:57:39 -0800 | [diff] [blame] | 24 | #include <compositionengine/impl/RenderSurface.h> |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 25 | #include <compositionengine/mock/CompositionEngine.h> |
Lloyd Pique | f527548 | 2019-01-29 18:42:42 -0800 | [diff] [blame] | 26 | #include <compositionengine/mock/DisplayColorProfile.h> |
Lloyd Pique | c660755 | 2019-12-02 17:57:39 -0800 | [diff] [blame] | 27 | #include <compositionengine/mock/DisplaySurface.h> |
Lloyd Pique | df336d9 | 2019-03-07 21:38:42 -0800 | [diff] [blame] | 28 | #include <compositionengine/mock/LayerFE.h> |
chaviw | 8beb414 | 2019-04-11 13:09:05 -0700 | [diff] [blame] | 29 | #include <compositionengine/mock/NativeWindow.h> |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 30 | #include <compositionengine/mock/OutputLayer.h> |
Lloyd Pique | 31cb294 | 2018-10-19 17:23:03 -0700 | [diff] [blame] | 31 | #include <compositionengine/mock/RenderSurface.h> |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 32 | #include <gtest/gtest.h> |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 33 | #include <ui/DisplayInfo.h> |
| 34 | #include <ui/Rect.h> |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 35 | |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 36 | #include "MockHWC2.h" |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 37 | #include "MockHWComposer.h" |
Lloyd Pique | 688abd4 | 2019-02-15 15:42:24 -0800 | [diff] [blame] | 38 | #include "MockPowerAdvisor.h" |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 39 | |
| 40 | namespace android::compositionengine { |
| 41 | namespace { |
| 42 | |
Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 43 | namespace hal = android::hardware::graphics::composer::hal; |
| 44 | |
Lloyd Pique | f527548 | 2019-01-29 18:42:42 -0800 | [diff] [blame] | 45 | using testing::_; |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 46 | using testing::DoAll; |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 47 | using testing::Eq; |
Lloyd Pique | c660755 | 2019-12-02 17:57:39 -0800 | [diff] [blame] | 48 | using testing::InSequence; |
| 49 | using testing::NiceMock; |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 50 | using testing::Pointee; |
| 51 | using testing::Ref; |
Lloyd Pique | 31cb294 | 2018-10-19 17:23:03 -0700 | [diff] [blame] | 52 | using testing::Return; |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 53 | using testing::ReturnRef; |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 54 | using testing::Sequence; |
| 55 | using testing::SetArgPointee; |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 56 | using testing::StrictMock; |
| 57 | |
| 58 | constexpr DisplayId DEFAULT_DISPLAY_ID = DisplayId{42}; |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 59 | constexpr DisplayId VIRTUAL_DISPLAY_ID = DisplayId{43}; |
Lloyd Pique | c660755 | 2019-12-02 17:57:39 -0800 | [diff] [blame] | 60 | constexpr int32_t DEFAULT_DISPLAY_WIDTH = 1920; |
| 61 | constexpr int32_t DEFAULT_DISPLAY_HEIGHT = 1080; |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 62 | constexpr int32_t DEFAULT_LAYER_STACK = 123; |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 63 | |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 64 | struct Layer { |
| 65 | Layer() { |
| 66 | EXPECT_CALL(*outputLayer, getLayerFE()).WillRepeatedly(ReturnRef(*layerFE)); |
| 67 | EXPECT_CALL(*outputLayer, getHwcLayer()).WillRepeatedly(Return(&hwc2Layer)); |
| 68 | } |
| 69 | |
| 70 | sp<mock::LayerFE> layerFE = new StrictMock<mock::LayerFE>(); |
| 71 | StrictMock<mock::OutputLayer>* outputLayer = new StrictMock<mock::OutputLayer>(); |
| 72 | StrictMock<HWC2::mock::Layer> hwc2Layer; |
| 73 | }; |
| 74 | |
| 75 | struct LayerNoHWC2Layer { |
| 76 | LayerNoHWC2Layer() { |
| 77 | EXPECT_CALL(*outputLayer, getLayerFE()).WillRepeatedly(ReturnRef(*layerFE)); |
| 78 | EXPECT_CALL(*outputLayer, getHwcLayer()).WillRepeatedly(Return(nullptr)); |
| 79 | } |
| 80 | |
| 81 | sp<mock::LayerFE> layerFE = new StrictMock<mock::LayerFE>(); |
| 82 | StrictMock<mock::OutputLayer>* outputLayer = new StrictMock<mock::OutputLayer>(); |
| 83 | }; |
| 84 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 85 | struct DisplayTestCommon : public testing::Test { |
| 86 | // Uses the full implementation of a display |
| 87 | class FullImplDisplay : public impl::Display { |
Lloyd Pique | 01c77c1 | 2019-04-17 12:48:32 -0700 | [diff] [blame] | 88 | public: |
Lloyd Pique | 01c77c1 | 2019-04-17 12:48:32 -0700 | [diff] [blame] | 89 | using impl::Display::injectOutputLayerForTest; |
| 90 | virtual void injectOutputLayerForTest(std::unique_ptr<compositionengine::OutputLayer>) = 0; |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 91 | |
| 92 | using impl::Display::maybeAllocateDisplayIdForVirtualDisplay; |
Lloyd Pique | 01c77c1 | 2019-04-17 12:48:32 -0700 | [diff] [blame] | 93 | }; |
| 94 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 95 | // Uses a special implementation with key internal member functions set up |
| 96 | // as mock implementations, to allow for easier testing. |
| 97 | struct PartialMockDisplay : public impl::Display { |
| 98 | PartialMockDisplay(const compositionengine::CompositionEngine& compositionEngine) |
| 99 | : mCompositionEngine(compositionEngine) {} |
| 100 | |
| 101 | // compositionengine::Output overrides |
| 102 | const OutputCompositionState& getState() const override { return mState; } |
| 103 | OutputCompositionState& editState() override { return mState; } |
| 104 | |
| 105 | // compositionengine::impl::Output overrides |
| 106 | const CompositionEngine& getCompositionEngine() const override { |
| 107 | return mCompositionEngine; |
| 108 | }; |
| 109 | |
| 110 | // Mock implementation overrides |
| 111 | MOCK_CONST_METHOD0(getOutputLayerCount, size_t()); |
| 112 | MOCK_CONST_METHOD1(getOutputLayerOrderedByZByIndex, |
| 113 | compositionengine::OutputLayer*(size_t)); |
| 114 | MOCK_METHOD2(ensureOutputLayer, |
| 115 | compositionengine::OutputLayer*(std::optional<size_t>, const sp<LayerFE>&)); |
| 116 | MOCK_METHOD0(finalizePendingOutputLayers, void()); |
| 117 | MOCK_METHOD0(clearOutputLayers, void()); |
| 118 | MOCK_CONST_METHOD1(dumpState, void(std::string&)); |
| 119 | MOCK_METHOD1(injectOutputLayerForTest, compositionengine::OutputLayer*(const sp<LayerFE>&)); |
| 120 | MOCK_METHOD1(injectOutputLayerForTest, void(std::unique_ptr<OutputLayer>)); |
| 121 | MOCK_CONST_METHOD0(anyLayersRequireClientComposition, bool()); |
| 122 | MOCK_CONST_METHOD0(allLayersRequireClientComposition, bool()); |
| 123 | MOCK_METHOD1(applyChangedTypesToLayers, void(const impl::Display::ChangedTypes&)); |
| 124 | MOCK_METHOD1(applyDisplayRequests, void(const impl::Display::DisplayRequests&)); |
| 125 | MOCK_METHOD1(applyLayerRequestsToLayers, void(const impl::Display::LayerRequests&)); |
| 126 | |
| 127 | const compositionengine::CompositionEngine& mCompositionEngine; |
| 128 | impl::OutputCompositionState mState; |
| 129 | }; |
| 130 | |
| 131 | static std::string getDisplayNameFromCurrentTest() { |
| 132 | const ::testing::TestInfo* const test_info = |
| 133 | ::testing::UnitTest::GetInstance()->current_test_info(); |
| 134 | return std::string("display for ") + test_info->test_case_name() + "." + test_info->name(); |
| 135 | } |
| 136 | |
| 137 | template <typename Display> |
Lloyd Pique | 01c77c1 | 2019-04-17 12:48:32 -0700 | [diff] [blame] | 138 | static std::shared_ptr<Display> createDisplay( |
| 139 | const compositionengine::CompositionEngine& compositionEngine, |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 140 | compositionengine::DisplayCreationArgs args) { |
| 141 | args.name = getDisplayNameFromCurrentTest(); |
Lloyd Pique | 01c77c1 | 2019-04-17 12:48:32 -0700 | [diff] [blame] | 142 | return impl::createDisplayTemplated<Display>(compositionEngine, args); |
| 143 | } |
| 144 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 145 | template <typename Display> |
| 146 | static std::shared_ptr<StrictMock<Display>> createPartialMockDisplay( |
| 147 | const compositionengine::CompositionEngine& compositionEngine, |
| 148 | compositionengine::DisplayCreationArgs args) { |
| 149 | args.name = getDisplayNameFromCurrentTest(); |
| 150 | auto display = std::make_shared<StrictMock<Display>>(compositionEngine); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 151 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 152 | display->setConfiguration(args); |
| 153 | |
| 154 | return display; |
| 155 | } |
| 156 | |
| 157 | DisplayTestCommon() { |
| 158 | EXPECT_CALL(mCompositionEngine, getHwComposer()).WillRepeatedly(ReturnRef(mHwComposer)); |
| 159 | } |
| 160 | |
| 161 | DisplayCreationArgs getDisplayCreationArgsForPhysicalHWCDisplay() { |
| 162 | return DisplayCreationArgsBuilder() |
| 163 | .setPhysical({DEFAULT_DISPLAY_ID, DisplayConnectionType::Internal}) |
| 164 | .setPixels({DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_HEIGHT}) |
| 165 | .setPixelFormat(static_cast<ui::PixelFormat>(PIXEL_FORMAT_RGBA_8888)) |
| 166 | .setIsSecure(true) |
| 167 | .setLayerStackId(DEFAULT_LAYER_STACK) |
| 168 | .setPowerAdvisor(&mPowerAdvisor) |
| 169 | .build(); |
| 170 | } |
| 171 | |
| 172 | DisplayCreationArgs getDisplayCreationArgsForNonHWCVirtualDisplay() { |
| 173 | return DisplayCreationArgsBuilder() |
| 174 | .setUseHwcVirtualDisplays(false) |
| 175 | .setPixels({DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_HEIGHT}) |
| 176 | .setPixelFormat(static_cast<ui::PixelFormat>(PIXEL_FORMAT_RGBA_8888)) |
| 177 | .setIsSecure(false) |
| 178 | .setLayerStackId(DEFAULT_LAYER_STACK) |
| 179 | .setPowerAdvisor(&mPowerAdvisor) |
| 180 | .build(); |
| 181 | } |
| 182 | |
| 183 | StrictMock<android::mock::HWComposer> mHwComposer; |
| 184 | StrictMock<Hwc2::mock::PowerAdvisor> mPowerAdvisor; |
| 185 | StrictMock<mock::CompositionEngine> mCompositionEngine; |
| 186 | sp<mock::NativeWindow> mNativeWindow = new StrictMock<mock::NativeWindow>(); |
| 187 | }; |
| 188 | |
| 189 | struct PartialMockDisplayTestCommon : public DisplayTestCommon { |
| 190 | using Display = DisplayTestCommon::PartialMockDisplay; |
| 191 | std::shared_ptr<Display> mDisplay = |
| 192 | createPartialMockDisplay<Display>(mCompositionEngine, |
| 193 | getDisplayCreationArgsForPhysicalHWCDisplay()); |
| 194 | }; |
| 195 | |
| 196 | struct FullDisplayImplTestCommon : public DisplayTestCommon { |
| 197 | using Display = DisplayTestCommon::FullImplDisplay; |
| 198 | std::shared_ptr<Display> mDisplay = |
| 199 | createDisplay<Display>(mCompositionEngine, |
| 200 | getDisplayCreationArgsForPhysicalHWCDisplay()); |
| 201 | }; |
| 202 | |
| 203 | struct DisplayWithLayersTestCommon : public FullDisplayImplTestCommon { |
| 204 | DisplayWithLayersTestCommon() { |
Lloyd Pique | 01c77c1 | 2019-04-17 12:48:32 -0700 | [diff] [blame] | 205 | mDisplay->injectOutputLayerForTest( |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 206 | std::unique_ptr<compositionengine::OutputLayer>(mLayer1.outputLayer)); |
Lloyd Pique | 01c77c1 | 2019-04-17 12:48:32 -0700 | [diff] [blame] | 207 | mDisplay->injectOutputLayerForTest( |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 208 | std::unique_ptr<compositionengine::OutputLayer>(mLayer2.outputLayer)); |
Lloyd Pique | 01c77c1 | 2019-04-17 12:48:32 -0700 | [diff] [blame] | 209 | mDisplay->injectOutputLayerForTest( |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 210 | std::unique_ptr<compositionengine::OutputLayer>(mLayer3.outputLayer)); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 211 | } |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 212 | |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 213 | Layer mLayer1; |
| 214 | Layer mLayer2; |
| 215 | LayerNoHWC2Layer mLayer3; |
| 216 | StrictMock<HWC2::mock::Layer> hwc2LayerUnknown; |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 217 | std::shared_ptr<Display> mDisplay = |
| 218 | createDisplay<Display>(mCompositionEngine, |
| 219 | getDisplayCreationArgsForPhysicalHWCDisplay()); |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 220 | }; |
| 221 | |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 222 | /* |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 223 | * Basic construction |
| 224 | */ |
| 225 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 226 | struct DisplayCreationTest : public DisplayTestCommon { |
| 227 | using Display = DisplayTestCommon::FullImplDisplay; |
| 228 | }; |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 229 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 230 | TEST_F(DisplayCreationTest, createPhysicalInternalDisplay) { |
| 231 | auto display = |
| 232 | impl::createDisplay(mCompositionEngine, getDisplayCreationArgsForPhysicalHWCDisplay()); |
| 233 | EXPECT_TRUE(display->isSecure()); |
| 234 | EXPECT_FALSE(display->isVirtual()); |
| 235 | EXPECT_EQ(DEFAULT_DISPLAY_ID, display->getId()); |
| 236 | } |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 237 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 238 | TEST_F(DisplayCreationTest, createNonHwcVirtualDisplay) { |
| 239 | auto display = impl::createDisplay(mCompositionEngine, |
| 240 | getDisplayCreationArgsForNonHWCVirtualDisplay()); |
| 241 | EXPECT_FALSE(display->isSecure()); |
| 242 | EXPECT_TRUE(display->isVirtual()); |
| 243 | EXPECT_EQ(std::nullopt, display->getId()); |
| 244 | } |
| 245 | |
| 246 | /* |
| 247 | * Display::setConfiguration() |
| 248 | */ |
| 249 | |
| 250 | using DisplaySetConfigurationTest = PartialMockDisplayTestCommon; |
| 251 | |
| 252 | TEST_F(DisplaySetConfigurationTest, configuresInternalSecurePhysicalDisplay) { |
| 253 | mDisplay->setConfiguration( |
| 254 | DisplayCreationArgsBuilder() |
| 255 | .setUseHwcVirtualDisplays(true) |
| 256 | .setPhysical({DEFAULT_DISPLAY_ID, DisplayConnectionType::Internal}) |
| 257 | .setPixels(ui::Size(DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_WIDTH)) |
| 258 | .setPixelFormat(static_cast<ui::PixelFormat>(PIXEL_FORMAT_RGBA_8888)) |
| 259 | .setIsSecure(true) |
| 260 | .setLayerStackId(DEFAULT_LAYER_STACK) |
| 261 | .setPowerAdvisor(&mPowerAdvisor) |
| 262 | .setName(getDisplayNameFromCurrentTest()) |
| 263 | .build()); |
| 264 | |
| 265 | EXPECT_EQ(DEFAULT_DISPLAY_ID, mDisplay->getId()); |
| 266 | EXPECT_TRUE(mDisplay->isSecure()); |
| 267 | EXPECT_FALSE(mDisplay->isVirtual()); |
| 268 | EXPECT_EQ(DEFAULT_LAYER_STACK, mDisplay->getState().layerStackId); |
| 269 | EXPECT_TRUE(mDisplay->getState().layerStackInternal); |
| 270 | EXPECT_FALSE(mDisplay->isValid()); |
| 271 | } |
| 272 | |
| 273 | TEST_F(DisplaySetConfigurationTest, configuresExternalInsecurePhysicalDisplay) { |
| 274 | mDisplay->setConfiguration( |
| 275 | DisplayCreationArgsBuilder() |
| 276 | .setUseHwcVirtualDisplays(true) |
| 277 | .setPhysical({DEFAULT_DISPLAY_ID, DisplayConnectionType::External}) |
| 278 | .setPixels(ui::Size(DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_WIDTH)) |
| 279 | .setPixelFormat(static_cast<ui::PixelFormat>(PIXEL_FORMAT_RGBA_8888)) |
| 280 | .setIsSecure(false) |
| 281 | .setLayerStackId(DEFAULT_LAYER_STACK) |
| 282 | .setPowerAdvisor(&mPowerAdvisor) |
| 283 | .setName(getDisplayNameFromCurrentTest()) |
| 284 | .build()); |
| 285 | |
| 286 | EXPECT_EQ(DEFAULT_DISPLAY_ID, mDisplay->getId()); |
| 287 | EXPECT_FALSE(mDisplay->isSecure()); |
| 288 | EXPECT_FALSE(mDisplay->isVirtual()); |
| 289 | EXPECT_EQ(DEFAULT_LAYER_STACK, mDisplay->getState().layerStackId); |
| 290 | EXPECT_FALSE(mDisplay->getState().layerStackInternal); |
| 291 | EXPECT_FALSE(mDisplay->isValid()); |
| 292 | } |
| 293 | |
| 294 | TEST_F(DisplaySetConfigurationTest, configuresHwcBackedVirtualDisplay) { |
| 295 | EXPECT_CALL(mHwComposer, |
| 296 | allocateVirtualDisplay(DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_WIDTH, |
| 297 | Pointee(Eq(static_cast<ui::PixelFormat>( |
| 298 | PIXEL_FORMAT_RGBA_8888))))) |
| 299 | .WillOnce(Return(VIRTUAL_DISPLAY_ID)); |
| 300 | |
| 301 | mDisplay->setConfiguration( |
| 302 | DisplayCreationArgsBuilder() |
| 303 | .setUseHwcVirtualDisplays(true) |
| 304 | .setPixels(ui::Size(DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_WIDTH)) |
| 305 | .setPixelFormat(static_cast<ui::PixelFormat>(PIXEL_FORMAT_RGBA_8888)) |
| 306 | .setIsSecure(false) |
| 307 | .setLayerStackId(DEFAULT_LAYER_STACK) |
| 308 | .setPowerAdvisor(&mPowerAdvisor) |
| 309 | .setName(getDisplayNameFromCurrentTest()) |
| 310 | .build()); |
| 311 | |
| 312 | EXPECT_EQ(VIRTUAL_DISPLAY_ID, mDisplay->getId()); |
| 313 | EXPECT_FALSE(mDisplay->isSecure()); |
| 314 | EXPECT_TRUE(mDisplay->isVirtual()); |
| 315 | EXPECT_EQ(DEFAULT_LAYER_STACK, mDisplay->getState().layerStackId); |
| 316 | EXPECT_FALSE(mDisplay->getState().layerStackInternal); |
| 317 | EXPECT_FALSE(mDisplay->isValid()); |
| 318 | } |
| 319 | |
| 320 | TEST_F(DisplaySetConfigurationTest, configuresNonHwcBackedVirtualDisplayIfHwcAllocationFails) { |
| 321 | EXPECT_CALL(mHwComposer, |
| 322 | allocateVirtualDisplay(DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_WIDTH, |
| 323 | Pointee(Eq(static_cast<ui::PixelFormat>( |
| 324 | PIXEL_FORMAT_RGBA_8888))))) |
| 325 | .WillOnce(Return(std::nullopt)); |
| 326 | |
| 327 | mDisplay->setConfiguration( |
| 328 | DisplayCreationArgsBuilder() |
| 329 | .setUseHwcVirtualDisplays(true) |
| 330 | .setPixels(ui::Size(DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_WIDTH)) |
| 331 | .setPixelFormat(static_cast<ui::PixelFormat>(PIXEL_FORMAT_RGBA_8888)) |
| 332 | .setIsSecure(false) |
| 333 | .setLayerStackId(DEFAULT_LAYER_STACK) |
| 334 | .setPowerAdvisor(&mPowerAdvisor) |
| 335 | .setName(getDisplayNameFromCurrentTest()) |
| 336 | .build()); |
| 337 | |
| 338 | EXPECT_EQ(std::nullopt, mDisplay->getId()); |
| 339 | EXPECT_FALSE(mDisplay->isSecure()); |
| 340 | EXPECT_TRUE(mDisplay->isVirtual()); |
| 341 | EXPECT_EQ(DEFAULT_LAYER_STACK, mDisplay->getState().layerStackId); |
| 342 | EXPECT_FALSE(mDisplay->getState().layerStackInternal); |
| 343 | EXPECT_FALSE(mDisplay->isValid()); |
| 344 | } |
| 345 | |
| 346 | TEST_F(DisplaySetConfigurationTest, configuresNonHwcBackedVirtualDisplayIfShouldNotUseHwc) { |
| 347 | mDisplay->setConfiguration( |
| 348 | DisplayCreationArgsBuilder() |
| 349 | .setUseHwcVirtualDisplays(false) |
| 350 | .setPixels(ui::Size(DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_WIDTH)) |
| 351 | .setPixelFormat(static_cast<ui::PixelFormat>(PIXEL_FORMAT_RGBA_8888)) |
| 352 | .setIsSecure(false) |
| 353 | .setLayerStackId(DEFAULT_LAYER_STACK) |
| 354 | .setPowerAdvisor(&mPowerAdvisor) |
| 355 | .setName(getDisplayNameFromCurrentTest()) |
| 356 | .build()); |
| 357 | |
| 358 | EXPECT_EQ(std::nullopt, mDisplay->getId()); |
| 359 | EXPECT_FALSE(mDisplay->isSecure()); |
| 360 | EXPECT_TRUE(mDisplay->isVirtual()); |
| 361 | EXPECT_EQ(DEFAULT_LAYER_STACK, mDisplay->getState().layerStackId); |
| 362 | EXPECT_FALSE(mDisplay->getState().layerStackInternal); |
| 363 | EXPECT_FALSE(mDisplay->isValid()); |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 364 | } |
| 365 | |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 366 | /* |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 367 | * Display::disconnect() |
| 368 | */ |
| 369 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 370 | using DisplayDisconnectTest = PartialMockDisplayTestCommon; |
| 371 | |
| 372 | TEST_F(DisplayDisconnectTest, disconnectsDisplay) { |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 373 | // The first call to disconnect will disconnect the display with the HWC and |
| 374 | // set mHwcId to -1. |
| 375 | EXPECT_CALL(mHwComposer, disconnectDisplay(DEFAULT_DISPLAY_ID)).Times(1); |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 376 | mDisplay->disconnect(); |
| 377 | EXPECT_FALSE(mDisplay->getId()); |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 378 | |
| 379 | // Subsequent calls will do nothing, |
| 380 | EXPECT_CALL(mHwComposer, disconnectDisplay(DEFAULT_DISPLAY_ID)).Times(0); |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 381 | mDisplay->disconnect(); |
| 382 | EXPECT_FALSE(mDisplay->getId()); |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 383 | } |
| 384 | |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 385 | /* |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 386 | * Display::setColorTransform() |
| 387 | */ |
| 388 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 389 | using DisplaySetColorTransformTest = PartialMockDisplayTestCommon; |
| 390 | |
| 391 | TEST_F(DisplaySetColorTransformTest, setsTransform) { |
Lloyd Pique | 3eb1b21 | 2019-03-07 21:15:40 -0800 | [diff] [blame] | 392 | // No change does nothing |
| 393 | CompositionRefreshArgs refreshArgs; |
| 394 | refreshArgs.colorTransformMatrix = std::nullopt; |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 395 | mDisplay->setColorTransform(refreshArgs); |
Lloyd Pique | 3eb1b21 | 2019-03-07 21:15:40 -0800 | [diff] [blame] | 396 | |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 397 | // Identity matrix sets an identity state value |
Lloyd Pique | 3eb1b21 | 2019-03-07 21:15:40 -0800 | [diff] [blame] | 398 | const mat4 kIdentity; |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 399 | |
Lloyd Pique | 3eb1b21 | 2019-03-07 21:15:40 -0800 | [diff] [blame] | 400 | EXPECT_CALL(mHwComposer, setColorTransform(DEFAULT_DISPLAY_ID, kIdentity)).Times(1); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 401 | |
Lloyd Pique | 3eb1b21 | 2019-03-07 21:15:40 -0800 | [diff] [blame] | 402 | refreshArgs.colorTransformMatrix = kIdentity; |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 403 | mDisplay->setColorTransform(refreshArgs); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 404 | |
| 405 | // Non-identity matrix sets a non-identity state value |
Lloyd Pique | 3eb1b21 | 2019-03-07 21:15:40 -0800 | [diff] [blame] | 406 | const mat4 kNonIdentity = mat4() * 2; |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 407 | |
Lloyd Pique | 3eb1b21 | 2019-03-07 21:15:40 -0800 | [diff] [blame] | 408 | EXPECT_CALL(mHwComposer, setColorTransform(DEFAULT_DISPLAY_ID, kNonIdentity)).Times(1); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 409 | |
Lloyd Pique | 3eb1b21 | 2019-03-07 21:15:40 -0800 | [diff] [blame] | 410 | refreshArgs.colorTransformMatrix = kNonIdentity; |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 411 | mDisplay->setColorTransform(refreshArgs); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 412 | } |
| 413 | |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 414 | /* |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 415 | * Display::setColorMode() |
| 416 | */ |
| 417 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 418 | using DisplaySetColorModeTest = PartialMockDisplayTestCommon; |
| 419 | |
| 420 | TEST_F(DisplaySetColorModeTest, setsModeUnlessNoChange) { |
Lloyd Pique | 6a3b446 | 2019-03-07 20:58:12 -0800 | [diff] [blame] | 421 | using ColorProfile = Output::ColorProfile; |
| 422 | |
Lloyd Pique | 31cb294 | 2018-10-19 17:23:03 -0700 | [diff] [blame] | 423 | mock::RenderSurface* renderSurface = new StrictMock<mock::RenderSurface>(); |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 424 | mDisplay->setRenderSurfaceForTest(std::unique_ptr<RenderSurface>(renderSurface)); |
Lloyd Pique | f527548 | 2019-01-29 18:42:42 -0800 | [diff] [blame] | 425 | mock::DisplayColorProfile* colorProfile = new StrictMock<mock::DisplayColorProfile>(); |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 426 | mDisplay->setDisplayColorProfileForTest(std::unique_ptr<DisplayColorProfile>(colorProfile)); |
Lloyd Pique | 31cb294 | 2018-10-19 17:23:03 -0700 | [diff] [blame] | 427 | |
Lloyd Pique | f527548 | 2019-01-29 18:42:42 -0800 | [diff] [blame] | 428 | EXPECT_CALL(*colorProfile, getTargetDataspace(_, _, _)) |
| 429 | .WillRepeatedly(Return(ui::Dataspace::UNKNOWN)); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 430 | |
| 431 | // These values are expected to be the initial state. |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 432 | ASSERT_EQ(ui::ColorMode::NATIVE, mDisplay->getState().colorMode); |
| 433 | ASSERT_EQ(ui::Dataspace::UNKNOWN, mDisplay->getState().dataspace); |
| 434 | ASSERT_EQ(ui::RenderIntent::COLORIMETRIC, mDisplay->getState().renderIntent); |
| 435 | ASSERT_EQ(ui::Dataspace::UNKNOWN, mDisplay->getState().targetDataspace); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 436 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 437 | // Otherwise if the values are unchanged, nothing happens |
| 438 | mDisplay->setColorProfile(ColorProfile{ui::ColorMode::NATIVE, ui::Dataspace::UNKNOWN, |
| 439 | ui::RenderIntent::COLORIMETRIC, ui::Dataspace::UNKNOWN}); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 440 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 441 | EXPECT_EQ(ui::ColorMode::NATIVE, mDisplay->getState().colorMode); |
| 442 | EXPECT_EQ(ui::Dataspace::UNKNOWN, mDisplay->getState().dataspace); |
| 443 | EXPECT_EQ(ui::RenderIntent::COLORIMETRIC, mDisplay->getState().renderIntent); |
| 444 | EXPECT_EQ(ui::Dataspace::UNKNOWN, mDisplay->getState().targetDataspace); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 445 | |
| 446 | // Otherwise if the values are different, updates happen |
Lloyd Pique | ef95812 | 2019-02-05 18:00:12 -0800 | [diff] [blame] | 447 | EXPECT_CALL(*renderSurface, setBufferDataspace(ui::Dataspace::DISPLAY_P3)).Times(1); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 448 | EXPECT_CALL(mHwComposer, |
Lloyd Pique | ef95812 | 2019-02-05 18:00:12 -0800 | [diff] [blame] | 449 | setActiveColorMode(DEFAULT_DISPLAY_ID, ui::ColorMode::DISPLAY_P3, |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 450 | ui::RenderIntent::TONE_MAP_COLORIMETRIC)) |
| 451 | .Times(1); |
| 452 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 453 | mDisplay->setColorProfile(ColorProfile{ui::ColorMode::DISPLAY_P3, ui::Dataspace::DISPLAY_P3, |
| 454 | ui::RenderIntent::TONE_MAP_COLORIMETRIC, |
| 455 | ui::Dataspace::UNKNOWN}); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 456 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 457 | EXPECT_EQ(ui::ColorMode::DISPLAY_P3, mDisplay->getState().colorMode); |
| 458 | EXPECT_EQ(ui::Dataspace::DISPLAY_P3, mDisplay->getState().dataspace); |
| 459 | EXPECT_EQ(ui::RenderIntent::TONE_MAP_COLORIMETRIC, mDisplay->getState().renderIntent); |
| 460 | EXPECT_EQ(ui::Dataspace::UNKNOWN, mDisplay->getState().targetDataspace); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 461 | } |
| 462 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 463 | TEST_F(DisplaySetColorModeTest, doesNothingForVirtualDisplay) { |
Lloyd Pique | 6a3b446 | 2019-03-07 20:58:12 -0800 | [diff] [blame] | 464 | using ColorProfile = Output::ColorProfile; |
| 465 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 466 | auto args = getDisplayCreationArgsForNonHWCVirtualDisplay(); |
| 467 | std::shared_ptr<impl::Display> virtualDisplay = impl::createDisplay(mCompositionEngine, args); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 468 | |
Lloyd Pique | f527548 | 2019-01-29 18:42:42 -0800 | [diff] [blame] | 469 | mock::DisplayColorProfile* colorProfile = new StrictMock<mock::DisplayColorProfile>(); |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 470 | virtualDisplay->setDisplayColorProfileForTest( |
Lloyd Pique | f527548 | 2019-01-29 18:42:42 -0800 | [diff] [blame] | 471 | std::unique_ptr<DisplayColorProfile>(colorProfile)); |
| 472 | |
| 473 | EXPECT_CALL(*colorProfile, |
| 474 | getTargetDataspace(ui::ColorMode::DISPLAY_P3, ui::Dataspace::DISPLAY_P3, |
| 475 | ui::Dataspace::UNKNOWN)) |
| 476 | .WillOnce(Return(ui::Dataspace::UNKNOWN)); |
| 477 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 478 | virtualDisplay->setColorProfile( |
Lloyd Pique | 6a3b446 | 2019-03-07 20:58:12 -0800 | [diff] [blame] | 479 | ColorProfile{ui::ColorMode::DISPLAY_P3, ui::Dataspace::DISPLAY_P3, |
| 480 | ui::RenderIntent::TONE_MAP_COLORIMETRIC, ui::Dataspace::UNKNOWN}); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 481 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 482 | EXPECT_EQ(ui::ColorMode::NATIVE, virtualDisplay->getState().colorMode); |
| 483 | EXPECT_EQ(ui::Dataspace::UNKNOWN, virtualDisplay->getState().dataspace); |
| 484 | EXPECT_EQ(ui::RenderIntent::COLORIMETRIC, virtualDisplay->getState().renderIntent); |
| 485 | EXPECT_EQ(ui::Dataspace::UNKNOWN, virtualDisplay->getState().targetDataspace); |
Lloyd Pique | 32cbe28 | 2018-10-19 13:09:22 -0700 | [diff] [blame] | 486 | } |
| 487 | |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 488 | /* |
Lloyd Pique | 3d0c02e | 2018-10-19 18:38:12 -0700 | [diff] [blame] | 489 | * Display::createDisplayColorProfile() |
| 490 | */ |
| 491 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 492 | using DisplayCreateColorProfileTest = PartialMockDisplayTestCommon; |
| 493 | |
| 494 | TEST_F(DisplayCreateColorProfileTest, setsDisplayColorProfile) { |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 495 | EXPECT_TRUE(mDisplay->getDisplayColorProfile() == nullptr); |
| 496 | mDisplay->createDisplayColorProfile( |
Lloyd Pique | 3d0c02e | 2018-10-19 18:38:12 -0700 | [diff] [blame] | 497 | DisplayColorProfileCreationArgs{false, HdrCapabilities(), 0, |
| 498 | DisplayColorProfileCreationArgs::HwcColorModes()}); |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 499 | EXPECT_TRUE(mDisplay->getDisplayColorProfile() != nullptr); |
Lloyd Pique | 3d0c02e | 2018-10-19 18:38:12 -0700 | [diff] [blame] | 500 | } |
| 501 | |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 502 | /* |
Lloyd Pique | 31cb294 | 2018-10-19 17:23:03 -0700 | [diff] [blame] | 503 | * Display::createRenderSurface() |
| 504 | */ |
| 505 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 506 | using DisplayCreateRenderSurfaceTest = PartialMockDisplayTestCommon; |
| 507 | |
| 508 | TEST_F(DisplayCreateRenderSurfaceTest, setsRenderSurface) { |
chaviw | 8beb414 | 2019-04-11 13:09:05 -0700 | [diff] [blame] | 509 | EXPECT_CALL(*mNativeWindow, disconnect(NATIVE_WINDOW_API_EGL)).WillRepeatedly(Return(NO_ERROR)); |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 510 | EXPECT_TRUE(mDisplay->getRenderSurface() == nullptr); |
| 511 | mDisplay->createRenderSurface(RenderSurfaceCreationArgs{640, 480, mNativeWindow, nullptr}); |
| 512 | EXPECT_TRUE(mDisplay->getRenderSurface() != nullptr); |
Lloyd Pique | 31cb294 | 2018-10-19 17:23:03 -0700 | [diff] [blame] | 513 | } |
| 514 | |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 515 | /* |
Lloyd Pique | df336d9 | 2019-03-07 21:38:42 -0800 | [diff] [blame] | 516 | * Display::createOutputLayer() |
| 517 | */ |
| 518 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 519 | using DisplayCreateOutputLayerTest = FullDisplayImplTestCommon; |
| 520 | |
| 521 | TEST_F(DisplayCreateOutputLayerTest, setsHwcLayer) { |
Lloyd Pique | df336d9 | 2019-03-07 21:38:42 -0800 | [diff] [blame] | 522 | sp<mock::LayerFE> layerFE = new StrictMock<mock::LayerFE>(); |
Lloyd Pique | df336d9 | 2019-03-07 21:38:42 -0800 | [diff] [blame] | 523 | StrictMock<HWC2::mock::Layer> hwcLayer; |
| 524 | |
| 525 | EXPECT_CALL(mHwComposer, createLayer(DEFAULT_DISPLAY_ID)).WillOnce(Return(&hwcLayer)); |
| 526 | |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 527 | auto outputLayer = mDisplay->createOutputLayer(layerFE); |
Lloyd Pique | df336d9 | 2019-03-07 21:38:42 -0800 | [diff] [blame] | 528 | |
| 529 | EXPECT_EQ(&hwcLayer, outputLayer->getHwcLayer()); |
| 530 | |
| 531 | EXPECT_CALL(mHwComposer, destroyLayer(DEFAULT_DISPLAY_ID, &hwcLayer)); |
| 532 | outputLayer.reset(); |
| 533 | } |
| 534 | |
| 535 | /* |
Lloyd Pique | c29e4c6 | 2019-03-07 21:48:19 -0800 | [diff] [blame] | 536 | * Display::setReleasedLayers() |
| 537 | */ |
| 538 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 539 | using DisplaySetReleasedLayersTest = DisplayWithLayersTestCommon; |
| 540 | |
| 541 | TEST_F(DisplaySetReleasedLayersTest, doesNothingIfNotHwcDisplay) { |
| 542 | auto args = getDisplayCreationArgsForNonHWCVirtualDisplay(); |
| 543 | std::shared_ptr<impl::Display> nonHwcDisplay = impl::createDisplay(mCompositionEngine, args); |
Lloyd Pique | c29e4c6 | 2019-03-07 21:48:19 -0800 | [diff] [blame] | 544 | |
| 545 | sp<mock::LayerFE> layerXLayerFE = new StrictMock<mock::LayerFE>(); |
Lloyd Pique | c29e4c6 | 2019-03-07 21:48:19 -0800 | [diff] [blame] | 546 | |
| 547 | { |
| 548 | Output::ReleasedLayers releasedLayers; |
| 549 | releasedLayers.emplace_back(layerXLayerFE); |
| 550 | nonHwcDisplay->setReleasedLayers(std::move(releasedLayers)); |
| 551 | } |
| 552 | |
| 553 | CompositionRefreshArgs refreshArgs; |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 554 | refreshArgs.layersWithQueuedFrames.push_back(layerXLayerFE); |
Lloyd Pique | c29e4c6 | 2019-03-07 21:48:19 -0800 | [diff] [blame] | 555 | |
| 556 | nonHwcDisplay->setReleasedLayers(refreshArgs); |
| 557 | |
| 558 | const auto& releasedLayers = nonHwcDisplay->getReleasedLayersForTest(); |
| 559 | ASSERT_EQ(1, releasedLayers.size()); |
| 560 | } |
| 561 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 562 | TEST_F(DisplaySetReleasedLayersTest, doesNothingIfNoLayersWithQueuedFrames) { |
Lloyd Pique | c29e4c6 | 2019-03-07 21:48:19 -0800 | [diff] [blame] | 563 | sp<mock::LayerFE> layerXLayerFE = new StrictMock<mock::LayerFE>(); |
| 564 | |
| 565 | { |
| 566 | Output::ReleasedLayers releasedLayers; |
| 567 | releasedLayers.emplace_back(layerXLayerFE); |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 568 | mDisplay->setReleasedLayers(std::move(releasedLayers)); |
Lloyd Pique | c29e4c6 | 2019-03-07 21:48:19 -0800 | [diff] [blame] | 569 | } |
| 570 | |
| 571 | CompositionRefreshArgs refreshArgs; |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 572 | mDisplay->setReleasedLayers(refreshArgs); |
Lloyd Pique | c29e4c6 | 2019-03-07 21:48:19 -0800 | [diff] [blame] | 573 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 574 | const auto& releasedLayers = mDisplay->getReleasedLayersForTest(); |
Lloyd Pique | c29e4c6 | 2019-03-07 21:48:19 -0800 | [diff] [blame] | 575 | ASSERT_EQ(1, releasedLayers.size()); |
| 576 | } |
| 577 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 578 | TEST_F(DisplaySetReleasedLayersTest, setReleasedLayers) { |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 579 | sp<mock::LayerFE> unknownLayer = new StrictMock<mock::LayerFE>(); |
Lloyd Pique | c29e4c6 | 2019-03-07 21:48:19 -0800 | [diff] [blame] | 580 | |
| 581 | CompositionRefreshArgs refreshArgs; |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 582 | refreshArgs.layersWithQueuedFrames.push_back(mLayer1.layerFE); |
| 583 | refreshArgs.layersWithQueuedFrames.push_back(mLayer2.layerFE); |
| 584 | refreshArgs.layersWithQueuedFrames.push_back(unknownLayer); |
Lloyd Pique | c29e4c6 | 2019-03-07 21:48:19 -0800 | [diff] [blame] | 585 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 586 | mDisplay->setReleasedLayers(refreshArgs); |
Lloyd Pique | c29e4c6 | 2019-03-07 21:48:19 -0800 | [diff] [blame] | 587 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 588 | const auto& releasedLayers = mDisplay->getReleasedLayersForTest(); |
Lloyd Pique | c29e4c6 | 2019-03-07 21:48:19 -0800 | [diff] [blame] | 589 | ASSERT_EQ(2, releasedLayers.size()); |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 590 | ASSERT_EQ(mLayer1.layerFE.get(), releasedLayers[0].promote().get()); |
| 591 | ASSERT_EQ(mLayer2.layerFE.get(), releasedLayers[1].promote().get()); |
Lloyd Pique | c29e4c6 | 2019-03-07 21:48:19 -0800 | [diff] [blame] | 592 | } |
| 593 | |
| 594 | /* |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 595 | * Display::chooseCompositionStrategy() |
| 596 | */ |
| 597 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 598 | using DisplayChooseCompositionStrategyTest = PartialMockDisplayTestCommon; |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 599 | |
| 600 | TEST_F(DisplayChooseCompositionStrategyTest, takesEarlyOutIfNotAHwcDisplay) { |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 601 | auto args = getDisplayCreationArgsForNonHWCVirtualDisplay(); |
| 602 | std::shared_ptr<Display> nonHwcDisplay = |
| 603 | createPartialMockDisplay<Display>(mCompositionEngine, args); |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 604 | EXPECT_FALSE(nonHwcDisplay->getId()); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 605 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 606 | nonHwcDisplay->chooseCompositionStrategy(); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 607 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 608 | auto& state = nonHwcDisplay->getState(); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 609 | EXPECT_TRUE(state.usesClientComposition); |
| 610 | EXPECT_FALSE(state.usesDeviceComposition); |
| 611 | } |
| 612 | |
| 613 | TEST_F(DisplayChooseCompositionStrategyTest, takesEarlyOutOnHwcError) { |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 614 | EXPECT_CALL(*mDisplay, anyLayersRequireClientComposition()).WillOnce(Return(false)); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 615 | EXPECT_CALL(mHwComposer, getDeviceCompositionChanges(DEFAULT_DISPLAY_ID, false, _)) |
| 616 | .WillOnce(Return(INVALID_OPERATION)); |
| 617 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 618 | mDisplay->chooseCompositionStrategy(); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 619 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 620 | auto& state = mDisplay->getState(); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 621 | EXPECT_TRUE(state.usesClientComposition); |
| 622 | EXPECT_FALSE(state.usesDeviceComposition); |
| 623 | } |
| 624 | |
| 625 | TEST_F(DisplayChooseCompositionStrategyTest, normalOperation) { |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 626 | // Since two calls are made to anyLayersRequireClientComposition with different return |
| 627 | // values, use a Sequence to control the matching so the values are returned in a known |
| 628 | // order. |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 629 | Sequence s; |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 630 | EXPECT_CALL(*mDisplay, anyLayersRequireClientComposition()) |
| 631 | .InSequence(s) |
| 632 | .WillOnce(Return(true)); |
| 633 | EXPECT_CALL(*mDisplay, anyLayersRequireClientComposition()) |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 634 | .InSequence(s) |
| 635 | .WillOnce(Return(false)); |
| 636 | |
| 637 | EXPECT_CALL(mHwComposer, getDeviceCompositionChanges(DEFAULT_DISPLAY_ID, true, _)) |
| 638 | .WillOnce(Return(NO_ERROR)); |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 639 | EXPECT_CALL(*mDisplay, allLayersRequireClientComposition()).WillOnce(Return(false)); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 640 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 641 | mDisplay->chooseCompositionStrategy(); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 642 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 643 | auto& state = mDisplay->getState(); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 644 | EXPECT_FALSE(state.usesClientComposition); |
| 645 | EXPECT_TRUE(state.usesDeviceComposition); |
| 646 | } |
| 647 | |
| 648 | TEST_F(DisplayChooseCompositionStrategyTest, normalOperationWithChanges) { |
| 649 | android::HWComposer::DeviceRequestedChanges changes{ |
Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 650 | {{nullptr, hal::Composition::CLIENT}}, |
| 651 | hal::DisplayRequest::FLIP_CLIENT_TARGET, |
| 652 | {{nullptr, hal::LayerRequest::CLEAR_CLIENT_TARGET}}, |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 653 | }; |
| 654 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 655 | // Since two calls are made to anyLayersRequireClientComposition with different return |
| 656 | // values, use a Sequence to control the matching so the values are returned in a known |
| 657 | // order. |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 658 | Sequence s; |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 659 | EXPECT_CALL(*mDisplay, anyLayersRequireClientComposition()) |
| 660 | .InSequence(s) |
| 661 | .WillOnce(Return(true)); |
| 662 | EXPECT_CALL(*mDisplay, anyLayersRequireClientComposition()) |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 663 | .InSequence(s) |
| 664 | .WillOnce(Return(false)); |
| 665 | |
| 666 | EXPECT_CALL(mHwComposer, getDeviceCompositionChanges(DEFAULT_DISPLAY_ID, true, _)) |
| 667 | .WillOnce(DoAll(SetArgPointee<2>(changes), Return(NO_ERROR))); |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 668 | EXPECT_CALL(*mDisplay, applyChangedTypesToLayers(changes.changedTypes)).Times(1); |
| 669 | EXPECT_CALL(*mDisplay, applyDisplayRequests(changes.displayRequests)).Times(1); |
| 670 | EXPECT_CALL(*mDisplay, applyLayerRequestsToLayers(changes.layerRequests)).Times(1); |
| 671 | EXPECT_CALL(*mDisplay, allLayersRequireClientComposition()).WillOnce(Return(false)); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 672 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 673 | mDisplay->chooseCompositionStrategy(); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 674 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 675 | auto& state = mDisplay->getState(); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 676 | EXPECT_FALSE(state.usesClientComposition); |
| 677 | EXPECT_TRUE(state.usesDeviceComposition); |
| 678 | } |
| 679 | |
| 680 | /* |
Lloyd Pique | 688abd4 | 2019-02-15 15:42:24 -0800 | [diff] [blame] | 681 | * Display::getSkipColorTransform() |
| 682 | */ |
| 683 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 684 | using DisplayGetSkipColorTransformTest = DisplayWithLayersTestCommon; |
| 685 | |
Dominik Laskowski | 1162e47 | 2020-04-02 19:02:47 -0700 | [diff] [blame] | 686 | TEST_F(DisplayGetSkipColorTransformTest, checksCapabilityIfNonHwcDisplay) { |
Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 687 | EXPECT_CALL(mHwComposer, hasCapability(hal::Capability::SKIP_CLIENT_COLOR_TRANSFORM)) |
Dominik Laskowski | 1162e47 | 2020-04-02 19:02:47 -0700 | [diff] [blame] | 688 | .WillOnce(Return(true)); |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 689 | auto args = getDisplayCreationArgsForNonHWCVirtualDisplay(); |
| 690 | auto nonHwcDisplay{impl::createDisplay(mCompositionEngine, args)}; |
Dominik Laskowski | 1162e47 | 2020-04-02 19:02:47 -0700 | [diff] [blame] | 691 | EXPECT_TRUE(nonHwcDisplay->getSkipColorTransform()); |
Lloyd Pique | 688abd4 | 2019-02-15 15:42:24 -0800 | [diff] [blame] | 692 | } |
| 693 | |
Dominik Laskowski | 1162e47 | 2020-04-02 19:02:47 -0700 | [diff] [blame] | 694 | TEST_F(DisplayGetSkipColorTransformTest, checksDisplayCapability) { |
Lloyd Pique | 688abd4 | 2019-02-15 15:42:24 -0800 | [diff] [blame] | 695 | EXPECT_CALL(mHwComposer, |
Dominik Laskowski | 1162e47 | 2020-04-02 19:02:47 -0700 | [diff] [blame] | 696 | hasDisplayCapability(DEFAULT_DISPLAY_ID, |
Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 697 | hal::DisplayCapability::SKIP_CLIENT_COLOR_TRANSFORM)) |
Lloyd Pique | 688abd4 | 2019-02-15 15:42:24 -0800 | [diff] [blame] | 698 | .WillOnce(Return(true)); |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 699 | EXPECT_TRUE(mDisplay->getSkipColorTransform()); |
Lloyd Pique | 688abd4 | 2019-02-15 15:42:24 -0800 | [diff] [blame] | 700 | } |
| 701 | |
| 702 | /* |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 703 | * Display::anyLayersRequireClientComposition() |
| 704 | */ |
| 705 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 706 | using DisplayAnyLayersRequireClientCompositionTest = DisplayWithLayersTestCommon; |
| 707 | |
| 708 | TEST_F(DisplayAnyLayersRequireClientCompositionTest, returnsFalse) { |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 709 | EXPECT_CALL(*mLayer1.outputLayer, requiresClientComposition()).WillOnce(Return(false)); |
| 710 | EXPECT_CALL(*mLayer2.outputLayer, requiresClientComposition()).WillOnce(Return(false)); |
| 711 | EXPECT_CALL(*mLayer3.outputLayer, requiresClientComposition()).WillOnce(Return(false)); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 712 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 713 | EXPECT_FALSE(mDisplay->anyLayersRequireClientComposition()); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 714 | } |
| 715 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 716 | TEST_F(DisplayAnyLayersRequireClientCompositionTest, returnsTrue) { |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 717 | EXPECT_CALL(*mLayer1.outputLayer, requiresClientComposition()).WillOnce(Return(false)); |
| 718 | EXPECT_CALL(*mLayer2.outputLayer, requiresClientComposition()).WillOnce(Return(true)); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 719 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 720 | EXPECT_TRUE(mDisplay->anyLayersRequireClientComposition()); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 721 | } |
| 722 | |
| 723 | /* |
| 724 | * Display::allLayersRequireClientComposition() |
| 725 | */ |
| 726 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 727 | using DisplayAllLayersRequireClientCompositionTest = DisplayWithLayersTestCommon; |
| 728 | |
| 729 | TEST_F(DisplayAllLayersRequireClientCompositionTest, returnsTrue) { |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 730 | EXPECT_CALL(*mLayer1.outputLayer, requiresClientComposition()).WillOnce(Return(true)); |
| 731 | EXPECT_CALL(*mLayer2.outputLayer, requiresClientComposition()).WillOnce(Return(true)); |
| 732 | EXPECT_CALL(*mLayer3.outputLayer, requiresClientComposition()).WillOnce(Return(true)); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 733 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 734 | EXPECT_TRUE(mDisplay->allLayersRequireClientComposition()); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 735 | } |
| 736 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 737 | TEST_F(DisplayAllLayersRequireClientCompositionTest, returnsFalse) { |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 738 | EXPECT_CALL(*mLayer1.outputLayer, requiresClientComposition()).WillOnce(Return(true)); |
| 739 | EXPECT_CALL(*mLayer2.outputLayer, requiresClientComposition()).WillOnce(Return(false)); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 740 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 741 | EXPECT_FALSE(mDisplay->allLayersRequireClientComposition()); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 742 | } |
| 743 | |
| 744 | /* |
| 745 | * Display::applyChangedTypesToLayers() |
| 746 | */ |
| 747 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 748 | using DisplayApplyChangedTypesToLayersTest = DisplayWithLayersTestCommon; |
| 749 | |
| 750 | TEST_F(DisplayApplyChangedTypesToLayersTest, takesEarlyOutIfNoChangedLayers) { |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 751 | mDisplay->applyChangedTypesToLayers(impl::Display::ChangedTypes()); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 752 | } |
| 753 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 754 | TEST_F(DisplayApplyChangedTypesToLayersTest, appliesChanges) { |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 755 | EXPECT_CALL(*mLayer1.outputLayer, |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 756 | applyDeviceCompositionTypeChange(Hwc2::IComposerClient::Composition::CLIENT)) |
| 757 | .Times(1); |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 758 | EXPECT_CALL(*mLayer2.outputLayer, |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 759 | applyDeviceCompositionTypeChange(Hwc2::IComposerClient::Composition::DEVICE)) |
| 760 | .Times(1); |
| 761 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 762 | mDisplay->applyChangedTypesToLayers(impl::Display::ChangedTypes{ |
Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 763 | {&mLayer1.hwc2Layer, hal::Composition::CLIENT}, |
| 764 | {&mLayer2.hwc2Layer, hal::Composition::DEVICE}, |
| 765 | {&hwc2LayerUnknown, hal::Composition::SOLID_COLOR}, |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 766 | }); |
| 767 | } |
| 768 | |
| 769 | /* |
| 770 | * Display::applyDisplayRequests() |
| 771 | */ |
| 772 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 773 | using DisplayApplyDisplayRequestsTest = DisplayWithLayersTestCommon; |
| 774 | |
| 775 | TEST_F(DisplayApplyDisplayRequestsTest, handlesNoRequests) { |
Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 776 | mDisplay->applyDisplayRequests(static_cast<hal::DisplayRequest>(0)); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 777 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 778 | auto& state = mDisplay->getState(); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 779 | EXPECT_FALSE(state.flipClientTarget); |
| 780 | } |
| 781 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 782 | TEST_F(DisplayApplyDisplayRequestsTest, handlesFlipClientTarget) { |
Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 783 | mDisplay->applyDisplayRequests(hal::DisplayRequest::FLIP_CLIENT_TARGET); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 784 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 785 | auto& state = mDisplay->getState(); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 786 | EXPECT_TRUE(state.flipClientTarget); |
| 787 | } |
| 788 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 789 | TEST_F(DisplayApplyDisplayRequestsTest, handlesWriteClientTargetToOutput) { |
Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 790 | mDisplay->applyDisplayRequests(hal::DisplayRequest::WRITE_CLIENT_TARGET_TO_OUTPUT); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 791 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 792 | auto& state = mDisplay->getState(); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 793 | EXPECT_FALSE(state.flipClientTarget); |
| 794 | } |
| 795 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 796 | TEST_F(DisplayApplyDisplayRequestsTest, handlesAllRequestFlagsSet) { |
Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 797 | mDisplay->applyDisplayRequests(static_cast<hal::DisplayRequest>(~0)); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 798 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 799 | auto& state = mDisplay->getState(); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 800 | EXPECT_TRUE(state.flipClientTarget); |
| 801 | } |
| 802 | |
| 803 | /* |
| 804 | * Display::applyLayerRequestsToLayers() |
| 805 | */ |
| 806 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 807 | using DisplayApplyLayerRequestsToLayersTest = DisplayWithLayersTestCommon; |
| 808 | |
| 809 | TEST_F(DisplayApplyLayerRequestsToLayersTest, preparesAllLayers) { |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 810 | EXPECT_CALL(*mLayer1.outputLayer, prepareForDeviceLayerRequests()).Times(1); |
| 811 | EXPECT_CALL(*mLayer2.outputLayer, prepareForDeviceLayerRequests()).Times(1); |
| 812 | EXPECT_CALL(*mLayer3.outputLayer, prepareForDeviceLayerRequests()).Times(1); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 813 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 814 | mDisplay->applyLayerRequestsToLayers(impl::Display::LayerRequests()); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 815 | } |
| 816 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 817 | TEST_F(DisplayApplyLayerRequestsToLayersTest, appliesDeviceLayerRequests) { |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 818 | EXPECT_CALL(*mLayer1.outputLayer, prepareForDeviceLayerRequests()).Times(1); |
| 819 | EXPECT_CALL(*mLayer2.outputLayer, prepareForDeviceLayerRequests()).Times(1); |
| 820 | EXPECT_CALL(*mLayer3.outputLayer, prepareForDeviceLayerRequests()).Times(1); |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 821 | |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 822 | EXPECT_CALL(*mLayer1.outputLayer, |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 823 | applyDeviceLayerRequest(Hwc2::IComposerClient::LayerRequest::CLEAR_CLIENT_TARGET)) |
| 824 | .Times(1); |
| 825 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 826 | mDisplay->applyLayerRequestsToLayers(impl::Display::LayerRequests{ |
Peiyong Lin | e9d809e | 2020-04-14 13:10:48 -0700 | [diff] [blame] | 827 | {&mLayer1.hwc2Layer, hal::LayerRequest::CLEAR_CLIENT_TARGET}, |
| 828 | {&hwc2LayerUnknown, hal::LayerRequest::CLEAR_CLIENT_TARGET}, |
Lloyd Pique | 66d6860 | 2019-02-13 14:23:31 -0800 | [diff] [blame] | 829 | }); |
| 830 | } |
| 831 | |
Lloyd Pique | 35fca9d | 2019-02-13 14:24:11 -0800 | [diff] [blame] | 832 | /* |
| 833 | * Display::presentAndGetFrameFences() |
| 834 | */ |
| 835 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 836 | using DisplayPresentAndGetFrameFencesTest = DisplayWithLayersTestCommon; |
| 837 | |
| 838 | TEST_F(DisplayPresentAndGetFrameFencesTest, returnsNoFencesOnNonHwcDisplay) { |
| 839 | auto args = getDisplayCreationArgsForNonHWCVirtualDisplay(); |
| 840 | auto nonHwcDisplay{impl::createDisplay(mCompositionEngine, args)}; |
Lloyd Pique | 35fca9d | 2019-02-13 14:24:11 -0800 | [diff] [blame] | 841 | |
| 842 | auto result = nonHwcDisplay->presentAndGetFrameFences(); |
| 843 | |
| 844 | ASSERT_TRUE(result.presentFence.get()); |
| 845 | EXPECT_FALSE(result.presentFence->isValid()); |
| 846 | EXPECT_EQ(0u, result.layerFences.size()); |
| 847 | } |
| 848 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 849 | TEST_F(DisplayPresentAndGetFrameFencesTest, returnsPresentAndLayerFences) { |
Lloyd Pique | 35fca9d | 2019-02-13 14:24:11 -0800 | [diff] [blame] | 850 | sp<Fence> presentFence = new Fence(); |
| 851 | sp<Fence> layer1Fence = new Fence(); |
| 852 | sp<Fence> layer2Fence = new Fence(); |
| 853 | |
| 854 | EXPECT_CALL(mHwComposer, presentAndGetReleaseFences(DEFAULT_DISPLAY_ID)).Times(1); |
| 855 | EXPECT_CALL(mHwComposer, getPresentFence(DEFAULT_DISPLAY_ID)).WillOnce(Return(presentFence)); |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 856 | EXPECT_CALL(mHwComposer, getLayerReleaseFence(DEFAULT_DISPLAY_ID, &mLayer1.hwc2Layer)) |
Lloyd Pique | 35fca9d | 2019-02-13 14:24:11 -0800 | [diff] [blame] | 857 | .WillOnce(Return(layer1Fence)); |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 858 | EXPECT_CALL(mHwComposer, getLayerReleaseFence(DEFAULT_DISPLAY_ID, &mLayer2.hwc2Layer)) |
Lloyd Pique | 35fca9d | 2019-02-13 14:24:11 -0800 | [diff] [blame] | 859 | .WillOnce(Return(layer2Fence)); |
| 860 | EXPECT_CALL(mHwComposer, clearReleaseFences(DEFAULT_DISPLAY_ID)).Times(1); |
| 861 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 862 | auto result = mDisplay->presentAndGetFrameFences(); |
Lloyd Pique | 35fca9d | 2019-02-13 14:24:11 -0800 | [diff] [blame] | 863 | |
| 864 | EXPECT_EQ(presentFence, result.presentFence); |
| 865 | |
| 866 | EXPECT_EQ(2u, result.layerFences.size()); |
Lloyd Pique | de19665 | 2020-01-22 17:29:58 -0800 | [diff] [blame] | 867 | ASSERT_EQ(1, result.layerFences.count(&mLayer1.hwc2Layer)); |
| 868 | EXPECT_EQ(layer1Fence, result.layerFences[&mLayer1.hwc2Layer]); |
| 869 | ASSERT_EQ(1, result.layerFences.count(&mLayer2.hwc2Layer)); |
| 870 | EXPECT_EQ(layer2Fence, result.layerFences[&mLayer2.hwc2Layer]); |
Lloyd Pique | 35fca9d | 2019-02-13 14:24:11 -0800 | [diff] [blame] | 871 | } |
| 872 | |
Lloyd Pique | 688abd4 | 2019-02-15 15:42:24 -0800 | [diff] [blame] | 873 | /* |
| 874 | * Display::setExpensiveRenderingExpected() |
| 875 | */ |
| 876 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 877 | using DisplaySetExpensiveRenderingExpectedTest = DisplayWithLayersTestCommon; |
| 878 | |
| 879 | TEST_F(DisplaySetExpensiveRenderingExpectedTest, forwardsToPowerAdvisor) { |
Lloyd Pique | 688abd4 | 2019-02-15 15:42:24 -0800 | [diff] [blame] | 880 | EXPECT_CALL(mPowerAdvisor, setExpensiveRenderingExpected(DEFAULT_DISPLAY_ID, true)).Times(1); |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 881 | mDisplay->setExpensiveRenderingExpected(true); |
Lloyd Pique | 688abd4 | 2019-02-15 15:42:24 -0800 | [diff] [blame] | 882 | |
| 883 | EXPECT_CALL(mPowerAdvisor, setExpensiveRenderingExpected(DEFAULT_DISPLAY_ID, false)).Times(1); |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 884 | mDisplay->setExpensiveRenderingExpected(false); |
Lloyd Pique | 688abd4 | 2019-02-15 15:42:24 -0800 | [diff] [blame] | 885 | } |
| 886 | |
Lloyd Pique | d3d6988 | 2019-02-28 16:03:46 -0800 | [diff] [blame] | 887 | /* |
| 888 | * Display::finishFrame() |
| 889 | */ |
| 890 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 891 | using DisplayFinishFrameTest = DisplayWithLayersTestCommon; |
| 892 | |
| 893 | TEST_F(DisplayFinishFrameTest, doesNotSkipCompositionIfNotDirtyOnHwcDisplay) { |
Lloyd Pique | d3d6988 | 2019-02-28 16:03:46 -0800 | [diff] [blame] | 894 | mock::RenderSurface* renderSurface = new StrictMock<mock::RenderSurface>(); |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 895 | mDisplay->setRenderSurfaceForTest(std::unique_ptr<RenderSurface>(renderSurface)); |
Lloyd Pique | d3d6988 | 2019-02-28 16:03:46 -0800 | [diff] [blame] | 896 | |
| 897 | // We expect no calls to queueBuffer if composition was skipped. |
| 898 | EXPECT_CALL(*renderSurface, queueBuffer(_)).Times(1); |
| 899 | |
Lloyd Pique | a76ce46 | 2020-01-14 13:06:37 -0800 | [diff] [blame] | 900 | // Expect a call to signal no expensive rendering since there is no client composition. |
| 901 | EXPECT_CALL(mPowerAdvisor, setExpensiveRenderingExpected(DEFAULT_DISPLAY_ID, false)); |
| 902 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 903 | mDisplay->editState().isEnabled = true; |
| 904 | mDisplay->editState().usesClientComposition = false; |
| 905 | mDisplay->editState().viewport = Rect(0, 0, 1, 1); |
| 906 | mDisplay->editState().dirtyRegion = Region::INVALID_REGION; |
Lloyd Pique | d3d6988 | 2019-02-28 16:03:46 -0800 | [diff] [blame] | 907 | |
| 908 | CompositionRefreshArgs refreshArgs; |
| 909 | refreshArgs.repaintEverything = false; |
| 910 | |
Lloyd Pique | a38ea7e | 2019-04-16 18:10:26 -0700 | [diff] [blame] | 911 | mDisplay->finishFrame(refreshArgs); |
Lloyd Pique | d3d6988 | 2019-02-28 16:03:46 -0800 | [diff] [blame] | 912 | } |
| 913 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 914 | TEST_F(DisplayFinishFrameTest, skipsCompositionIfNotDirty) { |
| 915 | auto args = getDisplayCreationArgsForNonHWCVirtualDisplay(); |
| 916 | std::shared_ptr<impl::Display> nonHwcDisplay = impl::createDisplay(mCompositionEngine, args); |
Lloyd Pique | d3d6988 | 2019-02-28 16:03:46 -0800 | [diff] [blame] | 917 | |
| 918 | mock::RenderSurface* renderSurface = new StrictMock<mock::RenderSurface>(); |
| 919 | nonHwcDisplay->setRenderSurfaceForTest(std::unique_ptr<RenderSurface>(renderSurface)); |
| 920 | |
| 921 | // We expect no calls to queueBuffer if composition was skipped. |
| 922 | EXPECT_CALL(*renderSurface, queueBuffer(_)).Times(0); |
| 923 | |
| 924 | nonHwcDisplay->editState().isEnabled = true; |
| 925 | nonHwcDisplay->editState().usesClientComposition = false; |
| 926 | nonHwcDisplay->editState().viewport = Rect(0, 0, 1, 1); |
| 927 | nonHwcDisplay->editState().dirtyRegion = Region::INVALID_REGION; |
| 928 | |
| 929 | CompositionRefreshArgs refreshArgs; |
| 930 | refreshArgs.repaintEverything = false; |
| 931 | |
| 932 | nonHwcDisplay->finishFrame(refreshArgs); |
| 933 | } |
| 934 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 935 | TEST_F(DisplayFinishFrameTest, performsCompositionIfDirty) { |
| 936 | auto args = getDisplayCreationArgsForNonHWCVirtualDisplay(); |
| 937 | std::shared_ptr<impl::Display> nonHwcDisplay = impl::createDisplay(mCompositionEngine, args); |
Lloyd Pique | d3d6988 | 2019-02-28 16:03:46 -0800 | [diff] [blame] | 938 | |
| 939 | mock::RenderSurface* renderSurface = new StrictMock<mock::RenderSurface>(); |
| 940 | nonHwcDisplay->setRenderSurfaceForTest(std::unique_ptr<RenderSurface>(renderSurface)); |
| 941 | |
| 942 | // We expect a single call to queueBuffer when composition is not skipped. |
| 943 | EXPECT_CALL(*renderSurface, queueBuffer(_)).Times(1); |
| 944 | |
| 945 | nonHwcDisplay->editState().isEnabled = true; |
| 946 | nonHwcDisplay->editState().usesClientComposition = false; |
| 947 | nonHwcDisplay->editState().viewport = Rect(0, 0, 1, 1); |
| 948 | nonHwcDisplay->editState().dirtyRegion = Region(Rect(0, 0, 1, 1)); |
| 949 | |
| 950 | CompositionRefreshArgs refreshArgs; |
| 951 | refreshArgs.repaintEverything = false; |
| 952 | |
| 953 | nonHwcDisplay->finishFrame(refreshArgs); |
| 954 | } |
| 955 | |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 956 | TEST_F(DisplayFinishFrameTest, performsCompositionIfRepaintEverything) { |
| 957 | auto args = getDisplayCreationArgsForNonHWCVirtualDisplay(); |
| 958 | std::shared_ptr<impl::Display> nonHwcDisplay = impl::createDisplay(mCompositionEngine, args); |
Lloyd Pique | d3d6988 | 2019-02-28 16:03:46 -0800 | [diff] [blame] | 959 | |
| 960 | mock::RenderSurface* renderSurface = new StrictMock<mock::RenderSurface>(); |
| 961 | nonHwcDisplay->setRenderSurfaceForTest(std::unique_ptr<RenderSurface>(renderSurface)); |
| 962 | |
| 963 | // We expect a single call to queueBuffer when composition is not skipped. |
| 964 | EXPECT_CALL(*renderSurface, queueBuffer(_)).Times(1); |
| 965 | |
| 966 | nonHwcDisplay->editState().isEnabled = true; |
| 967 | nonHwcDisplay->editState().usesClientComposition = false; |
| 968 | nonHwcDisplay->editState().viewport = Rect(0, 0, 1, 1); |
| 969 | nonHwcDisplay->editState().dirtyRegion = Region::INVALID_REGION; |
| 970 | |
| 971 | CompositionRefreshArgs refreshArgs; |
| 972 | refreshArgs.repaintEverything = true; |
| 973 | |
| 974 | nonHwcDisplay->finishFrame(refreshArgs); |
| 975 | } |
| 976 | |
Lloyd Pique | c660755 | 2019-12-02 17:57:39 -0800 | [diff] [blame] | 977 | /* |
| 978 | * Display functional tests |
| 979 | */ |
| 980 | |
| 981 | struct DisplayFunctionalTest : public testing::Test { |
| 982 | class Display : public impl::Display { |
| 983 | public: |
Lloyd Pique | c660755 | 2019-12-02 17:57:39 -0800 | [diff] [blame] | 984 | using impl::Display::injectOutputLayerForTest; |
| 985 | virtual void injectOutputLayerForTest(std::unique_ptr<compositionengine::OutputLayer>) = 0; |
| 986 | }; |
| 987 | |
Lloyd Pique | c660755 | 2019-12-02 17:57:39 -0800 | [diff] [blame] | 988 | DisplayFunctionalTest() { |
| 989 | EXPECT_CALL(mCompositionEngine, getHwComposer()).WillRepeatedly(ReturnRef(mHwComposer)); |
| 990 | |
| 991 | mDisplay->setRenderSurfaceForTest(std::unique_ptr<RenderSurface>(mRenderSurface)); |
| 992 | } |
| 993 | |
| 994 | NiceMock<android::mock::HWComposer> mHwComposer; |
| 995 | NiceMock<Hwc2::mock::PowerAdvisor> mPowerAdvisor; |
| 996 | NiceMock<mock::CompositionEngine> mCompositionEngine; |
| 997 | sp<mock::NativeWindow> mNativeWindow = new NiceMock<mock::NativeWindow>(); |
| 998 | sp<mock::DisplaySurface> mDisplaySurface = new NiceMock<mock::DisplaySurface>(); |
Lloyd Pique | aad4ebf | 2019-10-03 17:58:30 -0700 | [diff] [blame] | 999 | std::shared_ptr<Display> mDisplay = impl::createDisplayTemplated< |
| 1000 | Display>(mCompositionEngine, |
| 1001 | DisplayCreationArgsBuilder() |
| 1002 | .setPhysical({DEFAULT_DISPLAY_ID, DisplayConnectionType::Internal}) |
| 1003 | .setPixels({DEFAULT_DISPLAY_WIDTH, DEFAULT_DISPLAY_HEIGHT}) |
| 1004 | .setPixelFormat(static_cast<ui::PixelFormat>(PIXEL_FORMAT_RGBA_8888)) |
| 1005 | .setIsSecure(true) |
| 1006 | .setLayerStackId(DEFAULT_LAYER_STACK) |
| 1007 | .setPowerAdvisor(&mPowerAdvisor) |
| 1008 | .build() |
| 1009 | |
| 1010 | ); |
Lloyd Pique | c660755 | 2019-12-02 17:57:39 -0800 | [diff] [blame] | 1011 | impl::RenderSurface* mRenderSurface = |
| 1012 | new impl::RenderSurface{mCompositionEngine, *mDisplay, |
| 1013 | RenderSurfaceCreationArgs{DEFAULT_DISPLAY_WIDTH, |
| 1014 | DEFAULT_DISPLAY_HEIGHT, mNativeWindow, |
| 1015 | mDisplaySurface}}; |
| 1016 | }; |
| 1017 | |
| 1018 | TEST_F(DisplayFunctionalTest, postFramebufferCriticalCallsAreOrdered) { |
| 1019 | InSequence seq; |
| 1020 | |
| 1021 | mDisplay->editState().isEnabled = true; |
| 1022 | |
| 1023 | EXPECT_CALL(mHwComposer, presentAndGetReleaseFences(_)); |
| 1024 | EXPECT_CALL(*mDisplaySurface, onFrameCommitted()); |
| 1025 | |
| 1026 | mDisplay->postFramebuffer(); |
| 1027 | } |
| 1028 | |
Lloyd Pique | 45a165a | 2018-10-19 11:54:47 -0700 | [diff] [blame] | 1029 | } // namespace |
| 1030 | } // namespace android::compositionengine |