blob: d69a923b4e7519cd51f682d5c47556b6585ac81f [file] [log] [blame]
Chia-I Wuaab99f52016-10-05 12:59:58 +08001/*
2 * Copyright 2016 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#undef LOG_TAG
18#define LOG_TAG "HwcComposer"
Midas Chien243b6452021-03-30 19:55:12 +080019#define ATRACE_TAG ATRACE_TAG_GRAPHICS
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -070020
Ady Abraham9fc28052021-10-14 17:21:38 -070021#include "AidlComposerHal.h"
22#include "HidlComposerHal.h"
Chia-I Wuaab99f52016-10-05 12:59:58 +080023
Ady Abraham9fc28052021-10-14 17:21:38 -070024namespace android::Hwc2 {
Chia-I Wuaab99f52016-10-05 12:59:58 +080025
Lloyd Piquea822d522017-12-20 16:42:57 -080026Composer::~Composer() = default;
27
Ady Abraham9fc28052021-10-14 17:21:38 -070028std::unique_ptr<Composer> Composer::create(const std::string& serviceName) {
29 if (AidlComposer::isDeclared(serviceName)) {
30 return std::make_unique<AidlComposer>(serviceName);
Chia-I Wuaab99f52016-10-05 12:59:58 +080031 }
32
Ady Abraham9fc28052021-10-14 17:21:38 -070033 return std::make_unique<HidlComposer>(serviceName);
Chia-I Wuaab99f52016-10-05 12:59:58 +080034}
35
Ady Abraham9fc28052021-10-14 17:21:38 -070036} // namespace android::Hwc2