Lloyd Pique | 24f3bfe | 2019-10-02 19:29:10 -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 | |
| 17 | #pragma once |
| 18 | |
| 19 | #include "SurfaceFlingerFactory.h" |
| 20 | |
| 21 | namespace android::surfaceflinger { |
| 22 | |
| 23 | // A default implementation of the factory which creates the standard |
| 24 | // implementation types for each interface. |
| 25 | class DefaultFactory : public surfaceflinger::Factory { |
| 26 | public: |
| 27 | virtual ~DefaultFactory(); |
| 28 | |
| 29 | std::unique_ptr<DispSync> createDispSync(const char* name, bool hasSyncFramework) override; |
| 30 | std::unique_ptr<EventControlThread> createEventControlThread(SetVSyncEnabled) override; |
| 31 | std::unique_ptr<HWComposer> createHWComposer(const std::string& serviceName) override; |
| 32 | std::unique_ptr<MessageQueue> createMessageQueue() override; |
Ady Abraham | 9e16a48 | 2019-12-03 17:19:41 -0800 | [diff] [blame] | 33 | std::unique_ptr<scheduler::PhaseConfiguration> createPhaseConfiguration( |
| 34 | const scheduler::RefreshRateConfigs&) override; |
Lloyd Pique | 24f3bfe | 2019-10-02 19:29:10 -0700 | [diff] [blame] | 35 | std::unique_ptr<Scheduler> createScheduler(SetVSyncEnabled, |
Ady Abraham | 3a77a7b | 2019-12-02 18:46:59 -0800 | [diff] [blame] | 36 | const scheduler::RefreshRateConfigs&, |
| 37 | ISchedulerCallback&) override; |
Lloyd Pique | 24f3bfe | 2019-10-02 19:29:10 -0700 | [diff] [blame] | 38 | std::unique_ptr<SurfaceInterceptor> createSurfaceInterceptor(SurfaceFlinger*) override; |
| 39 | sp<StartPropertySetThread> createStartPropertySetThread(bool timestampPropertyValue) override; |
| 40 | sp<DisplayDevice> createDisplayDevice(DisplayDeviceCreationArgs&&) override; |
| 41 | sp<GraphicBuffer> createGraphicBuffer(uint32_t width, uint32_t height, PixelFormat format, |
| 42 | uint32_t layerCount, uint64_t usage, |
| 43 | std::string requestorName) override; |
| 44 | void createBufferQueue(sp<IGraphicBufferProducer>* outProducer, |
| 45 | sp<IGraphicBufferConsumer>* outConsumer, |
| 46 | bool consumerIsSurfaceFlinger) override; |
Lloyd Pique | e300b31 | 2019-10-03 13:03:45 -0700 | [diff] [blame] | 47 | sp<IGraphicBufferProducer> createMonitoredProducer(const sp<IGraphicBufferProducer>&, |
| 48 | const sp<SurfaceFlinger>&, |
| 49 | const wp<Layer>&) override; |
| 50 | sp<BufferLayerConsumer> createBufferLayerConsumer(const sp<IGraphicBufferConsumer>&, |
| 51 | renderengine::RenderEngine&, uint32_t tex, |
| 52 | Layer*) override; |
Lloyd Pique | 24f3bfe | 2019-10-02 19:29:10 -0700 | [diff] [blame] | 53 | std::unique_ptr<surfaceflinger::NativeWindowSurface> createNativeWindowSurface( |
| 54 | const sp<IGraphicBufferProducer>&) override; |
| 55 | std::unique_ptr<compositionengine::CompositionEngine> createCompositionEngine() override; |
| 56 | sp<BufferQueueLayer> createBufferQueueLayer(const LayerCreationArgs& args) override; |
| 57 | sp<BufferStateLayer> createBufferStateLayer(const LayerCreationArgs& args) override; |
| 58 | sp<ColorLayer> createColorLayer(const LayerCreationArgs& args) override; |
| 59 | sp<ContainerLayer> createContainerLayer(const LayerCreationArgs& args) override; |
| 60 | }; |
| 61 | |
| 62 | } // namespace android::surfaceflinger |