blob: 2c6de0e113c59a29ec062450e7b4d61162bd3d81 [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;
Ady Abraham8287e852020-08-12 14:44:58 -070030 std::unique_ptr<scheduler::VsyncConfiguration> createVsyncConfiguration(
Marin Shalamanov526c3382020-12-10 15:22:29 +010031 Fps currentRefreshRate) override;
Lloyd Pique24f3bfe2019-10-02 19:29:10 -070032 sp<StartPropertySetThread> createStartPropertySetThread(bool timestampPropertyValue) override;
Lloyd Pique9370a482019-10-03 17:58:30 -070033 sp<DisplayDevice> createDisplayDevice(DisplayDeviceCreationArgs&) override;
Lloyd Pique24f3bfe2019-10-02 19:29:10 -070034 sp<GraphicBuffer> createGraphicBuffer(uint32_t width, uint32_t height, PixelFormat format,
35 uint32_t layerCount, uint64_t usage,
36 std::string requestorName) override;
37 void createBufferQueue(sp<IGraphicBufferProducer>* outProducer,
38 sp<IGraphicBufferConsumer>* outConsumer,
39 bool consumerIsSurfaceFlinger) override;
Lloyd Pique24f3bfe2019-10-02 19:29:10 -070040 std::unique_ptr<surfaceflinger::NativeWindowSurface> createNativeWindowSurface(
41 const sp<IGraphicBufferProducer>&) override;
42 std::unique_ptr<compositionengine::CompositionEngine> createCompositionEngine() override;
Patrick Williams83f36b22022-09-14 17:57:35 +000043 sp<Layer> createBufferStateLayer(const LayerCreationArgs& args) override;
Patrick Williams46b61b92022-09-01 17:25:49 +000044 sp<Layer> createEffectLayer(const LayerCreationArgs& args) override;
Vishnu Naire14c6b32022-08-06 04:20:15 +000045 sp<LayerFE> createLayerFE(const std::string& layerName) override;
Adithya Srinivasan2db3c1b2020-11-18 12:43:17 -080046 std::unique_ptr<FrameTracer> createFrameTracer() override;
Adithya Srinivasan01189672020-10-20 14:23:05 -070047 std::unique_ptr<frametimeline::FrameTimeline> createFrameTimeline(
Adithya Srinivasan9b2ca3e2020-11-10 10:14:17 -080048 std::shared_ptr<TimeStats> timeStats, pid_t surfaceFlingerPid) override;
Lloyd Pique24f3bfe2019-10-02 19:29:10 -070049};
50
51} // namespace android::surfaceflinger