Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 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 | |
| 17 | #pragma once |
| 18 | |
Lloyd Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame] | 19 | #include <compositionengine/Display.h> |
Lloyd Pique | 0b785d8 | 2018-12-04 17:25:27 -0800 | [diff] [blame] | 20 | #include <compositionengine/Layer.h> |
Lloyd Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame] | 21 | #include <compositionengine/OutputLayer.h> |
Lloyd Pique | 70d9136 | 2018-10-18 16:02:55 -0700 | [diff] [blame] | 22 | #include <compositionengine/impl/CompositionEngine.h> |
Lloyd Pique | 0b785d8 | 2018-12-04 17:25:27 -0800 | [diff] [blame] | 23 | #include <compositionengine/impl/LayerCompositionState.h> |
Lloyd Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame] | 24 | #include <compositionengine/impl/OutputLayerCompositionState.h> |
Lloyd Pique | 70d9136 | 2018-10-18 16:02:55 -0700 | [diff] [blame] | 25 | |
Lloyd Pique | 90c115d | 2018-09-18 21:39:42 -0700 | [diff] [blame] | 26 | #include "BufferQueueLayer.h" |
| 27 | #include "BufferStateLayer.h" |
| 28 | #include "ColorLayer.h" |
| 29 | #include "ContainerLayer.h" |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 30 | #include "DisplayDevice.h" |
Ana Krulec | 757f63a | 2019-01-25 10:46:18 -0800 | [diff] [blame] | 31 | #include "FakePhaseOffsets.h" |
Lloyd Pique | d6b579f | 2018-04-06 15:29:10 -0700 | [diff] [blame] | 32 | #include "Layer.h" |
Lloyd Pique | 90c115d | 2018-09-18 21:39:42 -0700 | [diff] [blame] | 33 | #include "NativeWindowSurface.h" |
Dominik Laskowski | 9dab343 | 2019-03-27 13:21:10 -0700 | [diff] [blame] | 34 | #include "Scheduler/MessageQueue.h" |
Lloyd Pique | 90c115d | 2018-09-18 21:39:42 -0700 | [diff] [blame] | 35 | #include "StartPropertySetThread.h" |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 36 | #include "SurfaceFlinger.h" |
Lloyd Pique | 90c115d | 2018-09-18 21:39:42 -0700 | [diff] [blame] | 37 | #include "SurfaceFlingerFactory.h" |
| 38 | #include "SurfaceInterceptor.h" |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 39 | |
Yiwei Zhang | 7e666a5 | 2018-11-15 13:33:42 -0800 | [diff] [blame] | 40 | #include "TimeStats/TimeStats.h" |
| 41 | |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 42 | namespace android { |
| 43 | |
Lloyd Pique | e39cad2 | 2017-12-20 17:01:29 -0800 | [diff] [blame] | 44 | class EventThread; |
| 45 | |
Peiyong Lin | 833074a | 2018-08-28 11:53:54 -0700 | [diff] [blame] | 46 | namespace renderengine { |
Lloyd Pique | 90c115d | 2018-09-18 21:39:42 -0700 | [diff] [blame] | 47 | |
Lloyd Pique | e39cad2 | 2017-12-20 17:01:29 -0800 | [diff] [blame] | 48 | class RenderEngine; |
Lloyd Pique | 90c115d | 2018-09-18 21:39:42 -0700 | [diff] [blame] | 49 | |
| 50 | } // namespace renderengine |
Lloyd Pique | e39cad2 | 2017-12-20 17:01:29 -0800 | [diff] [blame] | 51 | |
| 52 | namespace Hwc2 { |
Lloyd Pique | 90c115d | 2018-09-18 21:39:42 -0700 | [diff] [blame] | 53 | |
Lloyd Pique | e39cad2 | 2017-12-20 17:01:29 -0800 | [diff] [blame] | 54 | class Composer; |
Lloyd Pique | 90c115d | 2018-09-18 21:39:42 -0700 | [diff] [blame] | 55 | |
| 56 | } // namespace Hwc2 |
| 57 | |
| 58 | namespace surfaceflinger::test { |
| 59 | |
| 60 | class Factory final : public surfaceflinger::Factory { |
| 61 | public: |
| 62 | ~Factory() = default; |
| 63 | |
| 64 | std::unique_ptr<DispSync> createDispSync(const char*, bool, int64_t) override { |
| 65 | // TODO: Use test-fixture controlled factory |
| 66 | return nullptr; |
| 67 | } |
| 68 | |
| 69 | std::unique_ptr<EventControlThread> createEventControlThread( |
| 70 | std::function<void(bool)>) override { |
| 71 | // TODO: Use test-fixture controlled factory |
| 72 | return nullptr; |
| 73 | } |
| 74 | |
| 75 | std::unique_ptr<HWComposer> createHWComposer(const std::string&) override { |
| 76 | // TODO: Use test-fixture controlled factory |
| 77 | return nullptr; |
| 78 | } |
| 79 | |
| 80 | std::unique_ptr<MessageQueue> createMessageQueue() override { |
| 81 | // TODO: Use test-fixture controlled factory |
| 82 | return std::make_unique<android::impl::MessageQueue>(); |
| 83 | } |
| 84 | |
Ana Krulec | 757f63a | 2019-01-25 10:46:18 -0800 | [diff] [blame] | 85 | std::unique_ptr<scheduler::PhaseOffsets> createPhaseOffsets() override { |
| 86 | return std::make_unique<scheduler::FakePhaseOffsets>(); |
| 87 | } |
| 88 | |
Lloyd Pique | 90c115d | 2018-09-18 21:39:42 -0700 | [diff] [blame] | 89 | std::unique_ptr<Scheduler> createScheduler(std::function<void(bool)>) override { |
| 90 | // TODO: Use test-fixture controlled factory |
| 91 | return nullptr; |
| 92 | } |
| 93 | |
| 94 | std::unique_ptr<SurfaceInterceptor> createSurfaceInterceptor(SurfaceFlinger* flinger) override { |
| 95 | // TODO: Use test-fixture controlled factory |
| 96 | return std::make_unique<android::impl::SurfaceInterceptor>(flinger); |
| 97 | } |
| 98 | |
| 99 | sp<StartPropertySetThread> createStartPropertySetThread(bool timestampPropertyValue) override { |
| 100 | // TODO: Use test-fixture controlled factory |
| 101 | return new StartPropertySetThread(timestampPropertyValue); |
| 102 | } |
| 103 | |
| 104 | sp<DisplayDevice> createDisplayDevice(DisplayDeviceCreationArgs&& creationArgs) override { |
| 105 | // TODO: Use test-fixture controlled factory |
| 106 | return new DisplayDevice(std::move(creationArgs)); |
| 107 | } |
| 108 | |
| 109 | sp<GraphicBuffer> createGraphicBuffer(uint32_t width, uint32_t height, PixelFormat format, |
| 110 | uint32_t layerCount, uint64_t usage, |
| 111 | std::string requestorName) override { |
| 112 | // TODO: Use test-fixture controlled factory |
| 113 | return new GraphicBuffer(width, height, format, layerCount, usage, requestorName); |
| 114 | } |
| 115 | |
| 116 | void createBufferQueue(sp<IGraphicBufferProducer>* outProducer, |
| 117 | sp<IGraphicBufferConsumer>* outConsumer, |
| 118 | bool consumerIsSurfaceFlinger) override { |
| 119 | if (!mCreateBufferQueue) return; |
| 120 | mCreateBufferQueue(outProducer, outConsumer, consumerIsSurfaceFlinger); |
| 121 | } |
| 122 | |
| 123 | std::unique_ptr<surfaceflinger::NativeWindowSurface> createNativeWindowSurface( |
| 124 | const sp<IGraphicBufferProducer>& producer) override { |
| 125 | if (!mCreateNativeWindowSurface) return nullptr; |
| 126 | return mCreateNativeWindowSurface(producer); |
| 127 | } |
| 128 | |
Lloyd Pique | 70d9136 | 2018-10-18 16:02:55 -0700 | [diff] [blame] | 129 | std::unique_ptr<compositionengine::CompositionEngine> createCompositionEngine() override { |
| 130 | return compositionengine::impl::createCompositionEngine(); |
| 131 | } |
| 132 | |
Lloyd Pique | 90c115d | 2018-09-18 21:39:42 -0700 | [diff] [blame] | 133 | sp<BufferQueueLayer> createBufferQueueLayer(const LayerCreationArgs&) override { |
| 134 | // TODO: Use test-fixture controlled factory |
| 135 | return nullptr; |
| 136 | } |
| 137 | |
| 138 | sp<BufferStateLayer> createBufferStateLayer(const LayerCreationArgs&) override { |
| 139 | // TODO: Use test-fixture controlled factory |
| 140 | return nullptr; |
| 141 | } |
| 142 | |
| 143 | sp<ColorLayer> createColorLayer(const LayerCreationArgs&) override { |
| 144 | // TODO: Use test-fixture controlled factory |
| 145 | return nullptr; |
| 146 | } |
| 147 | |
| 148 | sp<ContainerLayer> createContainerLayer(const LayerCreationArgs&) override { |
| 149 | // TODO: Use test-fixture controlled factory |
| 150 | return nullptr; |
| 151 | } |
| 152 | |
Alec Mouri | fb571ea | 2019-01-24 18:42:10 -0800 | [diff] [blame] | 153 | std::shared_ptr<TimeStats> createTimeStats() override { |
Yiwei Zhang | 7e666a5 | 2018-11-15 13:33:42 -0800 | [diff] [blame] | 154 | // TODO: Use test-fixture controlled factory |
Alec Mouri | fb571ea | 2019-01-24 18:42:10 -0800 | [diff] [blame] | 155 | return std::make_shared<android::impl::TimeStats>(); |
Yiwei Zhang | 7e666a5 | 2018-11-15 13:33:42 -0800 | [diff] [blame] | 156 | } |
| 157 | |
Lloyd Pique | 90c115d | 2018-09-18 21:39:42 -0700 | [diff] [blame] | 158 | using CreateBufferQueueFunction = |
| 159 | std::function<void(sp<IGraphicBufferProducer>* /* outProducer */, |
| 160 | sp<IGraphicBufferConsumer>* /* outConsumer */, |
| 161 | bool /* consumerIsSurfaceFlinger */)>; |
| 162 | CreateBufferQueueFunction mCreateBufferQueue; |
| 163 | |
| 164 | using CreateNativeWindowSurfaceFunction = |
| 165 | std::function<std::unique_ptr<surfaceflinger::NativeWindowSurface>( |
| 166 | const sp<IGraphicBufferProducer>&)>; |
| 167 | CreateNativeWindowSurfaceFunction mCreateNativeWindowSurface; |
Lloyd Pique | 70d9136 | 2018-10-18 16:02:55 -0700 | [diff] [blame] | 168 | |
| 169 | using CreateCompositionEngineFunction = |
| 170 | std::function<std::unique_ptr<compositionengine::CompositionEngine>()>; |
| 171 | CreateCompositionEngineFunction mCreateCompositionEngine; |
Lloyd Pique | 90c115d | 2018-09-18 21:39:42 -0700 | [diff] [blame] | 172 | }; |
| 173 | |
| 174 | } // namespace surfaceflinger::test |
Lloyd Pique | e39cad2 | 2017-12-20 17:01:29 -0800 | [diff] [blame] | 175 | |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 176 | class TestableSurfaceFlinger { |
| 177 | public: |
| 178 | // Extend this as needed for accessing SurfaceFlinger private (and public) |
| 179 | // functions. |
| 180 | |
Peiyong Lin | 833074a | 2018-08-28 11:53:54 -0700 | [diff] [blame] | 181 | void setupRenderEngine(std::unique_ptr<renderengine::RenderEngine> renderEngine) { |
Lloyd Pique | b97e04f | 2018-10-18 17:07:05 -0700 | [diff] [blame] | 182 | mFlinger->mCompositionEngine->setRenderEngine(std::move(renderEngine)); |
Lloyd Pique | e39cad2 | 2017-12-20 17:01:29 -0800 | [diff] [blame] | 183 | } |
| 184 | |
| 185 | void setupComposer(std::unique_ptr<Hwc2::Composer> composer) { |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 186 | mFlinger->mCompositionEngine->setHwComposer( |
| 187 | std::make_unique<impl::HWComposer>(std::move(composer))); |
Lloyd Pique | e39cad2 | 2017-12-20 17:01:29 -0800 | [diff] [blame] | 188 | } |
| 189 | |
Lloyd Pique | 90c115d | 2018-09-18 21:39:42 -0700 | [diff] [blame] | 190 | using CreateBufferQueueFunction = surfaceflinger::test::Factory::CreateBufferQueueFunction; |
Lloyd Pique | 5b36f3f | 2018-01-17 11:57:07 -0800 | [diff] [blame] | 191 | void setCreateBufferQueueFunction(CreateBufferQueueFunction f) { |
Lloyd Pique | 90c115d | 2018-09-18 21:39:42 -0700 | [diff] [blame] | 192 | mFactory.mCreateBufferQueue = f; |
Lloyd Pique | 5b36f3f | 2018-01-17 11:57:07 -0800 | [diff] [blame] | 193 | } |
| 194 | |
Lloyd Pique | 90c115d | 2018-09-18 21:39:42 -0700 | [diff] [blame] | 195 | using CreateNativeWindowSurfaceFunction = |
| 196 | surfaceflinger::test::Factory::CreateNativeWindowSurfaceFunction; |
Lloyd Pique | 0b1fe70 | 2018-01-22 18:03:16 -0800 | [diff] [blame] | 197 | void setCreateNativeWindowSurface(CreateNativeWindowSurfaceFunction f) { |
Lloyd Pique | 90c115d | 2018-09-18 21:39:42 -0700 | [diff] [blame] | 198 | mFactory.mCreateNativeWindowSurface = f; |
Lloyd Pique | 0b1fe70 | 2018-01-22 18:03:16 -0800 | [diff] [blame] | 199 | } |
| 200 | |
Daniel Solomon | 42d0456 | 2019-01-20 21:03:19 -0800 | [diff] [blame] | 201 | void setInternalDisplayPrimaries(const ui::DisplayPrimaries& primaries) { |
| 202 | memcpy(&mFlinger->mInternalDisplayPrimaries, &primaries, sizeof(ui::DisplayPrimaries)); |
| 203 | } |
| 204 | |
Lloyd Pique | 0b1fe70 | 2018-01-22 18:03:16 -0800 | [diff] [blame] | 205 | using HotplugEvent = SurfaceFlinger::HotplugEvent; |
| 206 | |
Lloyd Pique | 0449b0f | 2018-12-20 16:23:45 -0800 | [diff] [blame] | 207 | auto& mutableLayerCurrentState(sp<Layer> layer) { return layer->mCurrentState; } |
| 208 | auto& mutableLayerDrawingState(sp<Layer> layer) { return layer->mDrawingState; } |
Lloyd Pique | d6b579f | 2018-04-06 15:29:10 -0700 | [diff] [blame] | 209 | |
| 210 | void setLayerSidebandStream(sp<Layer> layer, sp<NativeHandle> sidebandStream) { |
Lloyd Pique | 0449b0f | 2018-12-20 16:23:45 -0800 | [diff] [blame] | 211 | layer->mDrawingState.sidebandStream = sidebandStream; |
Lloyd Pique | 0b785d8 | 2018-12-04 17:25:27 -0800 | [diff] [blame] | 212 | layer->mSidebandStream = sidebandStream; |
| 213 | layer->getCompositionLayer()->editState().frontEnd.sidebandStream = sidebandStream; |
Lloyd Pique | d6b579f | 2018-04-06 15:29:10 -0700 | [diff] [blame] | 214 | } |
| 215 | |
Lloyd Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame] | 216 | void setLayerCompositionType(sp<Layer> layer, HWC2::Composition type) { |
| 217 | auto outputLayer = layer->findOutputLayerForDisplay(mFlinger->getDefaultDisplayDevice()); |
| 218 | LOG_ALWAYS_FATAL_IF(!outputLayer); |
| 219 | auto& state = outputLayer->editState(); |
| 220 | LOG_ALWAYS_FATAL_IF(!outputLayer->getState().hwc); |
| 221 | (*state.hwc).hwcCompositionType = static_cast<Hwc2::IComposerClient::Composition>(type); |
| 222 | }; |
| 223 | |
Lloyd Pique | d6b579f | 2018-04-06 15:29:10 -0700 | [diff] [blame] | 224 | void setLayerPotentialCursor(sp<Layer> layer, bool potentialCursor) { |
| 225 | layer->mPotentialCursor = potentialCursor; |
| 226 | } |
| 227 | |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 228 | /* ------------------------------------------------------------------------ |
| 229 | * Forwarding for functions being tested |
| 230 | */ |
Lloyd Pique | 0b1fe70 | 2018-01-22 18:03:16 -0800 | [diff] [blame] | 231 | |
Lloyd Pique | a482f99 | 2018-01-22 19:00:34 -0800 | [diff] [blame] | 232 | auto createDisplay(const String8& displayName, bool secure) { |
| 233 | return mFlinger->createDisplay(displayName, secure); |
| 234 | } |
| 235 | |
Dominik Laskowski | eecd659 | 2018-05-29 10:25:41 -0700 | [diff] [blame] | 236 | auto destroyDisplay(const sp<IBinder>& displayToken) { |
| 237 | return mFlinger->destroyDisplay(displayToken); |
| 238 | } |
Lloyd Pique | a482f99 | 2018-01-22 19:00:34 -0800 | [diff] [blame] | 239 | |
Lloyd Pique | d6fbb8a | 2018-01-22 19:08:36 -0800 | [diff] [blame] | 240 | auto resetDisplayState() { return mFlinger->resetDisplayState(); } |
| 241 | |
Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 242 | auto setupNewDisplayDeviceInternal(const wp<IBinder>& displayToken, |
| 243 | const std::optional<DisplayId>& displayId, |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 244 | const DisplayDeviceState& state, |
Lloyd Pique | 542307f | 2018-10-19 13:24:08 -0700 | [diff] [blame] | 245 | const sp<compositionengine::DisplaySurface>& dispSurface, |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 246 | const sp<IGraphicBufferProducer>& producer) { |
Dominik Laskowski | 7e04546 | 2018-05-30 13:02:02 -0700 | [diff] [blame] | 247 | return mFlinger->setupNewDisplayDeviceInternal(displayToken, displayId, state, dispSurface, |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 248 | producer); |
| 249 | } |
| 250 | |
Lloyd Pique | 0b1fe70 | 2018-01-22 18:03:16 -0800 | [diff] [blame] | 251 | auto handleTransactionLocked(uint32_t transactionFlags) { |
Vishnu Nair | fa5f8df | 2019-02-13 17:02:51 -0800 | [diff] [blame] | 252 | Mutex::Autolock _l(mFlinger->mStateLock); |
Lloyd Pique | 0b1fe70 | 2018-01-22 18:03:16 -0800 | [diff] [blame] | 253 | return mFlinger->handleTransactionLocked(transactionFlags); |
| 254 | } |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 255 | |
Lloyd Pique | 6cf1103 | 2018-01-22 18:57:44 -0800 | [diff] [blame] | 256 | auto onHotplugReceived(int32_t sequenceId, hwc2_display_t display, |
| 257 | HWC2::Connection connection) { |
| 258 | return mFlinger->onHotplugReceived(sequenceId, display, connection); |
| 259 | } |
| 260 | |
Vishnu Nair | ce5d0cc | 2019-02-28 14:38:41 -0800 | [diff] [blame] | 261 | auto setDisplayStateLocked(const DisplayState& s) { |
| 262 | Mutex::Autolock _l(mFlinger->mStateLock); |
| 263 | return mFlinger->setDisplayStateLocked(s); |
| 264 | } |
Lloyd Pique | 9d9cf40 | 2018-02-16 17:47:13 -0800 | [diff] [blame] | 265 | |
Dominik Laskowski | 83b8821 | 2018-12-11 13:34:06 -0800 | [diff] [blame] | 266 | // Allow reading display state without locking, as if called on the SF main thread. |
| 267 | auto onInitializeDisplays() NO_THREAD_SAFETY_ANALYSIS { |
| 268 | return mFlinger->onInitializeDisplays(); |
| 269 | } |
Lloyd Pique | 86016da | 2018-03-01 16:09:38 -0800 | [diff] [blame] | 270 | |
Dominik Laskowski | 83b8821 | 2018-12-11 13:34:06 -0800 | [diff] [blame] | 271 | // Allow reading display state without locking, as if called on the SF main thread. |
| 272 | auto setPowerModeInternal(const sp<DisplayDevice>& display, |
| 273 | int mode) NO_THREAD_SAFETY_ANALYSIS { |
Dominik Laskowski | e977409 | 2018-12-11 10:04:24 -0800 | [diff] [blame] | 274 | return mFlinger->setPowerModeInternal(display, mode); |
Lloyd Pique | 7d4aa6c | 2018-03-01 16:36:35 -0800 | [diff] [blame] | 275 | } |
| 276 | |
Lloyd Pique | d6b579f | 2018-04-06 15:29:10 -0700 | [diff] [blame] | 277 | auto onMessageReceived(int32_t what) { return mFlinger->onMessageReceived(what); } |
| 278 | |
Robert Carr | 108b2c7 | 2019-04-02 16:32:58 -0700 | [diff] [blame^] | 279 | auto captureScreenImplLocked( |
| 280 | const RenderArea& renderArea, SurfaceFlinger::TraverseLayersFunction traverseLayers, |
| 281 | ANativeWindowBuffer* buffer, bool useIdentityTransform, bool forSystem, int* outSyncFd) { |
| 282 | bool ignored; |
Lloyd Pique | d6b579f | 2018-04-06 15:29:10 -0700 | [diff] [blame] | 283 | return mFlinger->captureScreenImplLocked(renderArea, traverseLayers, buffer, |
Robert Carr | 108b2c7 | 2019-04-02 16:32:58 -0700 | [diff] [blame^] | 284 | useIdentityTransform, forSystem, outSyncFd, |
| 285 | ignored); |
Lloyd Pique | d6b579f | 2018-04-06 15:29:10 -0700 | [diff] [blame] | 286 | } |
| 287 | |
chaviw | 0e3479f | 2018-09-10 16:49:30 -0700 | [diff] [blame] | 288 | auto traverseLayersInDisplay(const sp<const DisplayDevice>& display, |
| 289 | const LayerVector::Visitor& visitor) { |
| 290 | return mFlinger->SurfaceFlinger::traverseLayersInDisplay(display, visitor); |
Lloyd Pique | d6b579f | 2018-04-06 15:29:10 -0700 | [diff] [blame] | 291 | } |
| 292 | |
Daniel Solomon | 42d0456 | 2019-01-20 21:03:19 -0800 | [diff] [blame] | 293 | auto getDisplayNativePrimaries(const sp<IBinder>& displayToken, |
| 294 | ui::DisplayPrimaries &primaries) { |
| 295 | return mFlinger->SurfaceFlinger::getDisplayNativePrimaries(displayToken, primaries); |
| 296 | } |
| 297 | |
Lloyd Pique | 86016da | 2018-03-01 16:09:38 -0800 | [diff] [blame] | 298 | /* ------------------------------------------------------------------------ |
| 299 | * Read-only access to private data to assert post-conditions. |
| 300 | */ |
| 301 | |
| 302 | const auto& getAnimFrameTracker() const { return mFlinger->mAnimFrameTracker; } |
Lloyd Pique | 7d4aa6c | 2018-03-01 16:36:35 -0800 | [diff] [blame] | 303 | const auto& getHasPoweredOff() const { return mFlinger->mHasPoweredOff; } |
Lloyd Pique | 7d4aa6c | 2018-03-01 16:36:35 -0800 | [diff] [blame] | 304 | const auto& getVisibleRegionsDirty() const { return mFlinger->mVisibleRegionsDirty; } |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 305 | auto& getHwComposer() const { |
| 306 | return static_cast<impl::HWComposer&>(mFlinger->getHwComposer()); |
| 307 | } |
Lloyd Pique | 7d4aa6c | 2018-03-01 16:36:35 -0800 | [diff] [blame] | 308 | |
Lloyd Pique | 86016da | 2018-03-01 16:09:38 -0800 | [diff] [blame] | 309 | const auto& getCompositorTiming() const { return mFlinger->getBE().mCompositorTiming; } |
| 310 | |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 311 | /* ------------------------------------------------------------------------ |
| 312 | * Read-write access to private data to set up preconditions and assert |
| 313 | * post-conditions. |
| 314 | */ |
Lloyd Pique | 0b1fe70 | 2018-01-22 18:03:16 -0800 | [diff] [blame] | 315 | |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 316 | auto& mutableHasWideColorDisplay() { return SurfaceFlinger::hasWideColorDisplay; } |
Chia-I Wu | 304d9cd | 2018-08-27 14:38:14 -0700 | [diff] [blame] | 317 | auto& mutablePrimaryDisplayOrientation() { return SurfaceFlinger::primaryDisplayOrientation; } |
Peiyong Lin | 13effd1 | 2018-07-24 17:01:47 -0700 | [diff] [blame] | 318 | auto& mutableUseColorManagement() { return SurfaceFlinger::useColorManagement; } |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 319 | |
Lloyd Pique | e39cad2 | 2017-12-20 17:01:29 -0800 | [diff] [blame] | 320 | auto& mutableCurrentState() { return mFlinger->mCurrentState; } |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 321 | auto& mutableDisplayColorSetting() { return mFlinger->mDisplayColorSetting; } |
Lloyd Pique | d6b579f | 2018-04-06 15:29:10 -0700 | [diff] [blame] | 322 | auto& mutableDisplays() { return mFlinger->mDisplays; } |
Lloyd Pique | e39cad2 | 2017-12-20 17:01:29 -0800 | [diff] [blame] | 323 | auto& mutableDrawingState() { return mFlinger->mDrawingState; } |
Lloyd Pique | e39cad2 | 2017-12-20 17:01:29 -0800 | [diff] [blame] | 324 | auto& mutableEventQueue() { return mFlinger->mEventQueue; } |
Lloyd Pique | d6b579f | 2018-04-06 15:29:10 -0700 | [diff] [blame] | 325 | auto& mutableGeometryInvalid() { return mFlinger->mGeometryInvalid; } |
Lloyd Pique | 0b1fe70 | 2018-01-22 18:03:16 -0800 | [diff] [blame] | 326 | auto& mutableInterceptor() { return mFlinger->mInterceptor; } |
Lloyd Pique | 6cf1103 | 2018-01-22 18:57:44 -0800 | [diff] [blame] | 327 | auto& mutableMainThreadId() { return mFlinger->mMainThreadId; } |
Lloyd Pique | 0b1fe70 | 2018-01-22 18:03:16 -0800 | [diff] [blame] | 328 | auto& mutablePendingHotplugEvents() { return mFlinger->mPendingHotplugEvents; } |
Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 329 | auto& mutablePhysicalDisplayTokens() { return mFlinger->mPhysicalDisplayTokens; } |
Lloyd Pique | d6b579f | 2018-04-06 15:29:10 -0700 | [diff] [blame] | 330 | auto& mutableTexturePool() { return mFlinger->mTexturePool; } |
Lloyd Pique | 0b1fe70 | 2018-01-22 18:03:16 -0800 | [diff] [blame] | 331 | auto& mutableTransactionFlags() { return mFlinger->mTransactionFlags; } |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 332 | auto& mutableUseHwcVirtualDisplays() { return mFlinger->mUseHwcVirtualDisplays; } |
Peiyong Lin | 74ca2f4 | 2019-01-14 19:36:57 -0800 | [diff] [blame] | 333 | auto& mutablePowerAdvisor() { return mFlinger->mPowerAdvisor; } |
Lloyd Pique | e39cad2 | 2017-12-20 17:01:29 -0800 | [diff] [blame] | 334 | |
Lloyd Pique | 6cf1103 | 2018-01-22 18:57:44 -0800 | [diff] [blame] | 335 | auto& mutableComposerSequenceId() { return mFlinger->getBE().mComposerSequenceId; } |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 336 | auto& mutableHwcDisplayData() { return getHwComposer().mDisplayData; } |
| 337 | auto& mutableHwcPhysicalDisplayIdMap() { return getHwComposer().mPhysicalDisplayIdMap; } |
| 338 | auto& mutableInternalHwcDisplayId() { return getHwComposer().mInternalHwcDisplayId; } |
| 339 | auto& mutableExternalHwcDisplayId() { return getHwComposer().mExternalHwcDisplayId; } |
Ana Krulec | afb4584 | 2019-02-13 13:33:03 -0800 | [diff] [blame] | 340 | auto& mutableScheduler() { return mFlinger->mScheduler; } |
| 341 | auto& mutableAppConnectionHandle() { return mFlinger->mAppConnectionHandle; } |
| 342 | auto& mutableSfConnectionHandle() { return mFlinger->mSfConnectionHandle; } |
Lloyd Pique | a618d85 | 2018-01-17 11:52:30 -0800 | [diff] [blame] | 343 | |
Lloyd Pique | e39cad2 | 2017-12-20 17:01:29 -0800 | [diff] [blame] | 344 | ~TestableSurfaceFlinger() { |
| 345 | // All these pointer and container clears help ensure that GMock does |
| 346 | // not report a leaked object, since the SurfaceFlinger instance may |
| 347 | // still be referenced by something despite our best efforts to destroy |
| 348 | // it after each test is done. |
| 349 | mutableDisplays().clear(); |
Ady Abraham | 2939f09 | 2019-03-04 17:44:06 -0800 | [diff] [blame] | 350 | mutableCurrentState().displays.clear(); |
| 351 | mutableDrawingState().displays.clear(); |
Lloyd Pique | 0b1fe70 | 2018-01-22 18:03:16 -0800 | [diff] [blame] | 352 | mutableEventQueue().reset(); |
Lloyd Pique | 0b1fe70 | 2018-01-22 18:03:16 -0800 | [diff] [blame] | 353 | mutableInterceptor().reset(); |
Ana Krulec | afb4584 | 2019-02-13 13:33:03 -0800 | [diff] [blame] | 354 | mutableScheduler().reset(); |
Lloyd Pique | 441d504 | 2018-10-18 16:49:51 -0700 | [diff] [blame] | 355 | mFlinger->mCompositionEngine->setHwComposer(std::unique_ptr<HWComposer>()); |
Lloyd Pique | b97e04f | 2018-10-18 17:07:05 -0700 | [diff] [blame] | 356 | mFlinger->mCompositionEngine->setRenderEngine( |
| 357 | std::unique_ptr<renderengine::RenderEngine>()); |
Lloyd Pique | e39cad2 | 2017-12-20 17:01:29 -0800 | [diff] [blame] | 358 | } |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 359 | |
Lloyd Pique | a618d85 | 2018-01-17 11:52:30 -0800 | [diff] [blame] | 360 | /* ------------------------------------------------------------------------ |
| 361 | * Wrapper classes for Read-write access to private data to set up |
| 362 | * preconditions and assert post-conditions. |
| 363 | */ |
Ana Krulec | 4593b69 | 2019-01-11 22:07:25 -0800 | [diff] [blame] | 364 | struct HWC2Display : public HWC2::impl::Display { |
Peiyong Lin | 74ca2f4 | 2019-01-14 19:36:57 -0800 | [diff] [blame] | 365 | HWC2Display(Hwc2::Composer& composer, |
Lloyd Pique | a618d85 | 2018-01-17 11:52:30 -0800 | [diff] [blame] | 366 | const std::unordered_set<HWC2::Capability>& capabilities, hwc2_display_t id, |
| 367 | HWC2::DisplayType type) |
Peiyong Lin | 74ca2f4 | 2019-01-14 19:36:57 -0800 | [diff] [blame] | 368 | : HWC2::impl::Display(composer, capabilities, id, type) {} |
Lloyd Pique | a618d85 | 2018-01-17 11:52:30 -0800 | [diff] [blame] | 369 | ~HWC2Display() { |
| 370 | // Prevents a call to disable vsyncs. |
| 371 | mType = HWC2::DisplayType::Invalid; |
| 372 | } |
| 373 | |
| 374 | auto& mutableIsConnected() { return this->mIsConnected; } |
| 375 | auto& mutableConfigs() { return this->mConfigs; } |
Lloyd Pique | d6b579f | 2018-04-06 15:29:10 -0700 | [diff] [blame] | 376 | auto& mutableLayers() { return this->mLayers; } |
Lloyd Pique | a618d85 | 2018-01-17 11:52:30 -0800 | [diff] [blame] | 377 | }; |
| 378 | |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 379 | class FakeHwcDisplayInjector { |
| 380 | public: |
| 381 | static constexpr hwc2_display_t DEFAULT_HWC_DISPLAY_ID = 1000; |
| 382 | static constexpr int32_t DEFAULT_WIDTH = 1920; |
| 383 | static constexpr int32_t DEFAULT_HEIGHT = 1280; |
| 384 | static constexpr int32_t DEFAULT_REFRESH_RATE = 16'666'666; |
| 385 | static constexpr int32_t DEFAULT_DPI = 320; |
| 386 | static constexpr int32_t DEFAULT_ACTIVE_CONFIG = 0; |
| 387 | |
Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 388 | FakeHwcDisplayInjector(DisplayId displayId, HWC2::DisplayType hwcDisplayType, |
| 389 | bool isPrimary) |
| 390 | : mDisplayId(displayId), mHwcDisplayType(hwcDisplayType), mIsPrimary(isPrimary) {} |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 391 | |
| 392 | auto& setHwcDisplayId(hwc2_display_t displayId) { |
| 393 | mHwcDisplayId = displayId; |
| 394 | return *this; |
| 395 | } |
| 396 | |
| 397 | auto& setWidth(int32_t width) { |
| 398 | mWidth = width; |
| 399 | return *this; |
| 400 | } |
| 401 | |
| 402 | auto& setHeight(int32_t height) { |
| 403 | mHeight = height; |
| 404 | return *this; |
| 405 | } |
| 406 | |
| 407 | auto& setRefreshRate(int32_t refreshRate) { |
| 408 | mRefreshRate = refreshRate; |
| 409 | return *this; |
| 410 | } |
| 411 | |
| 412 | auto& setDpiX(int32_t dpi) { |
| 413 | mDpiX = dpi; |
| 414 | return *this; |
| 415 | } |
| 416 | |
| 417 | auto& setDpiY(int32_t dpi) { |
| 418 | mDpiY = dpi; |
| 419 | return *this; |
| 420 | } |
| 421 | |
| 422 | auto& setActiveConfig(int32_t config) { |
| 423 | mActiveConfig = config; |
| 424 | return *this; |
| 425 | } |
| 426 | |
Lloyd Pique | e22f033 | 2018-07-16 16:35:56 -0700 | [diff] [blame] | 427 | auto& setCapabilities(const std::unordered_set<HWC2::Capability>* capabilities) { |
| 428 | mCapabilities = capabilities; |
| 429 | return *this; |
| 430 | } |
| 431 | |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 432 | void inject(TestableSurfaceFlinger* flinger, Hwc2::Composer* composer) { |
Lloyd Pique | e22f033 | 2018-07-16 16:35:56 -0700 | [diff] [blame] | 433 | static const std::unordered_set<HWC2::Capability> defaultCapabilities; |
| 434 | if (mCapabilities == nullptr) mCapabilities = &defaultCapabilities; |
| 435 | |
| 436 | // Caution - Make sure that any values passed by reference here do |
| 437 | // not refer to an instance owned by FakeHwcDisplayInjector. This |
| 438 | // class has temporary lifetime, while the constructed HWC2::Display |
| 439 | // is much longer lived. |
Peiyong Lin | 74ca2f4 | 2019-01-14 19:36:57 -0800 | [diff] [blame] | 440 | auto display = std::make_unique<HWC2Display>(*composer, *mCapabilities, mHwcDisplayId, |
| 441 | mHwcDisplayType); |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 442 | |
| 443 | auto config = HWC2::Display::Config::Builder(*display, mActiveConfig); |
| 444 | config.setWidth(mWidth); |
| 445 | config.setHeight(mHeight); |
| 446 | config.setVsyncPeriod(mRefreshRate); |
| 447 | config.setDpiX(mDpiX); |
| 448 | config.setDpiY(mDpiY); |
| 449 | display->mutableConfigs().emplace(mActiveConfig, config.build()); |
| 450 | display->mutableIsConnected() = true; |
| 451 | |
Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 452 | flinger->mutableHwcDisplayData()[mDisplayId].hwcDisplay = display.get(); |
| 453 | |
| 454 | if (mHwcDisplayType == HWC2::DisplayType::Physical) { |
| 455 | flinger->mutableHwcPhysicalDisplayIdMap().emplace(mHwcDisplayId, mDisplayId); |
| 456 | (mIsPrimary ? flinger->mutableInternalHwcDisplayId() |
| 457 | : flinger->mutableExternalHwcDisplayId()) = mHwcDisplayId; |
| 458 | } |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 459 | |
| 460 | flinger->mFakeHwcDisplays.push_back(std::move(display)); |
| 461 | } |
| 462 | |
| 463 | private: |
Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 464 | const DisplayId mDisplayId; |
| 465 | const HWC2::DisplayType mHwcDisplayType; |
| 466 | const bool mIsPrimary; |
| 467 | |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 468 | hwc2_display_t mHwcDisplayId = DEFAULT_HWC_DISPLAY_ID; |
| 469 | int32_t mWidth = DEFAULT_WIDTH; |
| 470 | int32_t mHeight = DEFAULT_HEIGHT; |
| 471 | int32_t mRefreshRate = DEFAULT_REFRESH_RATE; |
| 472 | int32_t mDpiX = DEFAULT_DPI; |
| 473 | int32_t mDpiY = DEFAULT_DPI; |
| 474 | int32_t mActiveConfig = DEFAULT_ACTIVE_CONFIG; |
Lloyd Pique | e22f033 | 2018-07-16 16:35:56 -0700 | [diff] [blame] | 475 | const std::unordered_set<HWC2::Capability>* mCapabilities = nullptr; |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 476 | }; |
| 477 | |
| 478 | class FakeDisplayDeviceInjector { |
| 479 | public: |
Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 480 | FakeDisplayDeviceInjector(TestableSurfaceFlinger& flinger, |
| 481 | const std::optional<DisplayId>& displayId, bool isVirtual, |
| 482 | bool isPrimary) |
| 483 | : mFlinger(flinger), mCreationArgs(flinger.mFlinger.get(), mDisplayToken, displayId) { |
| 484 | mCreationArgs.isVirtual = isVirtual; |
| 485 | mCreationArgs.isPrimary = isPrimary; |
| 486 | } |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 487 | |
| 488 | sp<IBinder> token() const { return mDisplayToken; } |
| 489 | |
| 490 | DisplayDeviceState& mutableDrawingDisplayState() { |
| 491 | return mFlinger.mutableDrawingState().displays.editValueFor(mDisplayToken); |
| 492 | } |
| 493 | |
| 494 | DisplayDeviceState& mutableCurrentDisplayState() { |
| 495 | return mFlinger.mutableCurrentState().displays.editValueFor(mDisplayToken); |
| 496 | } |
| 497 | |
Lloyd Pique | 9d9cf40 | 2018-02-16 17:47:13 -0800 | [diff] [blame] | 498 | const auto& getDrawingDisplayState() { |
| 499 | return mFlinger.mutableDrawingState().displays.valueFor(mDisplayToken); |
| 500 | } |
| 501 | |
| 502 | const auto& getCurrentDisplayState() { |
| 503 | return mFlinger.mutableCurrentState().displays.valueFor(mDisplayToken); |
| 504 | } |
| 505 | |
Dominik Laskowski | 9fae102 | 2018-05-29 13:17:40 -0700 | [diff] [blame] | 506 | auto& mutableDisplayDevice() { return mFlinger.mutableDisplays()[mDisplayToken]; } |
Lloyd Pique | 9d9cf40 | 2018-02-16 17:47:13 -0800 | [diff] [blame] | 507 | |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 508 | auto& setNativeWindow(const sp<ANativeWindow>& nativeWindow) { |
Lloyd Pique | 2eef1d2 | 2018-09-18 21:30:04 -0700 | [diff] [blame] | 509 | mCreationArgs.nativeWindow = nativeWindow; |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 510 | return *this; |
| 511 | } |
| 512 | |
Lloyd Pique | 542307f | 2018-10-19 13:24:08 -0700 | [diff] [blame] | 513 | auto& setDisplaySurface(const sp<compositionengine::DisplaySurface>& displaySurface) { |
Lloyd Pique | 2eef1d2 | 2018-09-18 21:30:04 -0700 | [diff] [blame] | 514 | mCreationArgs.displaySurface = displaySurface; |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 515 | return *this; |
| 516 | } |
| 517 | |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 518 | auto& setSecure(bool secure) { |
Lloyd Pique | 2eef1d2 | 2018-09-18 21:30:04 -0700 | [diff] [blame] | 519 | mCreationArgs.isSecure = secure; |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 520 | return *this; |
| 521 | } |
| 522 | |
Lloyd Pique | d6b579f | 2018-04-06 15:29:10 -0700 | [diff] [blame] | 523 | auto& setPowerMode(int mode) { |
Lloyd Pique | 2eef1d2 | 2018-09-18 21:30:04 -0700 | [diff] [blame] | 524 | mCreationArgs.initialPowerMode = mode; |
Lloyd Pique | d6b579f | 2018-04-06 15:29:10 -0700 | [diff] [blame] | 525 | return *this; |
| 526 | } |
| 527 | |
Valerie Hau | 9758ae0 | 2018-10-09 16:05:09 -0700 | [diff] [blame] | 528 | auto& setHwcColorModes( |
| 529 | const std::unordered_map<ui::ColorMode, std::vector<ui::RenderIntent>> |
| 530 | hwcColorModes) { |
| 531 | mCreationArgs.hwcColorModes = hwcColorModes; |
| 532 | return *this; |
| 533 | } |
| 534 | |
| 535 | auto& setHasWideColorGamut(bool hasWideColorGamut) { |
| 536 | mCreationArgs.hasWideColorGamut = hasWideColorGamut; |
| 537 | return *this; |
| 538 | } |
| 539 | |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 540 | sp<DisplayDevice> inject() { |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 541 | DisplayDeviceState state; |
Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 542 | state.displayId = mCreationArgs.isVirtual ? std::nullopt : mCreationArgs.displayId; |
Lloyd Pique | 2eef1d2 | 2018-09-18 21:30:04 -0700 | [diff] [blame] | 543 | state.isSecure = mCreationArgs.isSecure; |
| 544 | |
| 545 | sp<DisplayDevice> device = new DisplayDevice(std::move(mCreationArgs)); |
| 546 | mFlinger.mutableDisplays().emplace(mDisplayToken, device); |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 547 | mFlinger.mutableCurrentState().displays.add(mDisplayToken, state); |
| 548 | mFlinger.mutableDrawingState().displays.add(mDisplayToken, state); |
| 549 | |
Dominik Laskowski | 075d317 | 2018-05-24 15:50:06 -0700 | [diff] [blame] | 550 | if (!mCreationArgs.isVirtual) { |
| 551 | LOG_ALWAYS_FATAL_IF(!state.displayId); |
| 552 | mFlinger.mutablePhysicalDisplayTokens()[*state.displayId] = mDisplayToken; |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 553 | } |
| 554 | |
| 555 | return device; |
| 556 | } |
| 557 | |
| 558 | private: |
| 559 | TestableSurfaceFlinger& mFlinger; |
| 560 | sp<BBinder> mDisplayToken = new BBinder(); |
Lloyd Pique | 2eef1d2 | 2018-09-18 21:30:04 -0700 | [diff] [blame] | 561 | DisplayDeviceCreationArgs mCreationArgs; |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 562 | }; |
| 563 | |
Lloyd Pique | 90c115d | 2018-09-18 21:39:42 -0700 | [diff] [blame] | 564 | surfaceflinger::test::Factory mFactory; |
| 565 | sp<SurfaceFlinger> mFlinger = new SurfaceFlinger(mFactory, SurfaceFlinger::SkipInitialization); |
Lloyd Pique | c11e0d3 | 2018-01-22 18:44:59 -0800 | [diff] [blame] | 566 | |
| 567 | // We need to keep a reference to these so they are properly destroyed. |
| 568 | std::vector<std::unique_ptr<HWC2Display>> mFakeHwcDisplays; |
Lloyd Pique | f58625d | 2017-12-19 13:22:33 -0800 | [diff] [blame] | 569 | }; |
| 570 | |
| 571 | } // namespace android |