blob: 40774ef1083bac7c66db6b15551c829ca6177a96 [file] [log] [blame]
Lloyd Pique24f3bfe2019-10-02 19:29:10 -07001/*
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
21namespace android::surfaceflinger {
22
23// A default implementation of the factory which creates the standard
24// implementation types for each interface.
25class DefaultFactory : public surfaceflinger::Factory {
26public:
27 virtual ~DefaultFactory();
28
Lloyd Pique24f3bfe2019-10-02 19:29:10 -070029 std::unique_ptr<HWComposer> createHWComposer(const std::string& serviceName) override;
30 std::unique_ptr<MessageQueue> createMessageQueue() override;
Ady Abraham8287e852020-08-12 14:44:58 -070031 std::unique_ptr<scheduler::VsyncConfiguration> createVsyncConfiguration(
Ady Abraham9e16a482019-12-03 17:19:41 -080032 const scheduler::RefreshRateConfigs&) override;
Dominik Laskowski8b01cc02020-07-14 19:02:41 -070033 std::unique_ptr<Scheduler> createScheduler(const scheduler::RefreshRateConfigs&,
Ady Abraham3a77a7b2019-12-02 18:46:59 -080034 ISchedulerCallback&) override;
Pablo Gamitoc351d6f2020-09-17 15:34:26 +000035 sp<SurfaceInterceptor> createSurfaceInterceptor() override;
Lloyd Pique24f3bfe2019-10-02 19:29:10 -070036 sp<StartPropertySetThread> createStartPropertySetThread(bool timestampPropertyValue) override;
Lloyd Pique9370a482019-10-03 17:58:30 -070037 sp<DisplayDevice> createDisplayDevice(DisplayDeviceCreationArgs&) override;
Lloyd Pique24f3bfe2019-10-02 19:29:10 -070038 sp<GraphicBuffer> createGraphicBuffer(uint32_t width, uint32_t height, PixelFormat format,
39 uint32_t layerCount, uint64_t usage,
40 std::string requestorName) override;
41 void createBufferQueue(sp<IGraphicBufferProducer>* outProducer,
42 sp<IGraphicBufferConsumer>* outConsumer,
43 bool consumerIsSurfaceFlinger) override;
Lloyd Piquee300b312019-10-03 13:03:45 -070044 sp<IGraphicBufferProducer> createMonitoredProducer(const sp<IGraphicBufferProducer>&,
45 const sp<SurfaceFlinger>&,
46 const wp<Layer>&) override;
47 sp<BufferLayerConsumer> createBufferLayerConsumer(const sp<IGraphicBufferConsumer>&,
48 renderengine::RenderEngine&, uint32_t tex,
49 Layer*) override;
Lloyd Pique24f3bfe2019-10-02 19:29:10 -070050 std::unique_ptr<surfaceflinger::NativeWindowSurface> createNativeWindowSurface(
51 const sp<IGraphicBufferProducer>&) override;
52 std::unique_ptr<compositionengine::CompositionEngine> createCompositionEngine() override;
53 sp<BufferQueueLayer> createBufferQueueLayer(const LayerCreationArgs& args) override;
54 sp<BufferStateLayer> createBufferStateLayer(const LayerCreationArgs& args) override;
Vishnu Nairfa247b12020-02-11 08:58:26 -080055 sp<EffectLayer> createEffectLayer(const LayerCreationArgs& args) override;
Lloyd Pique24f3bfe2019-10-02 19:29:10 -070056 sp<ContainerLayer> createContainerLayer(const LayerCreationArgs& args) override;
57};
58
59} // namespace android::surfaceflinger