blob: ea51e92e7b7da656a34602e98db99bcd5d9bab85 [file] [log] [blame]
Vishnu Nair67b431c2022-11-16 01:54:05 +00001/*
2 * Copyright 2022 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
Vishnu Naircfb2d252023-01-19 04:44:02 +000019#include <sstream>
20
Vishnu Nair67b431c2022-11-16 01:54:05 +000021#include <gui/DisplayInfo.h>
Dominik Laskowski6b049ff2023-01-29 15:46:45 -050022#include <ui/DisplayMap.h>
23#include <ui/LayerStack.h>
Linnan Li13bf76a2024-05-05 19:18:02 +080024#include <ui/LogicalDisplayId.h>
Dominik Laskowski6b049ff2023-01-29 15:46:45 -050025#include <ui/Transform.h>
Vishnu Nair67b431c2022-11-16 01:54:05 +000026
Vishnu Nairaf6d2972022-11-18 06:26:38 +000027namespace android::surfaceflinger::frontend {
Vishnu Nair67b431c2022-11-16 01:54:05 +000028
29// Display information needed to populate input and calculate layer geometry.
Vishnu Nairaf6d2972022-11-18 06:26:38 +000030struct DisplayInfo {
Vishnu Nair67b431c2022-11-16 01:54:05 +000031 gui::DisplayInfo info;
32 ui::Transform transform;
33 bool receivesInput;
34 bool isSecure;
Leon Scroggins III85d4b222023-05-09 13:58:18 -040035 // TODO(b/259407931): can eliminate once SurfaceFlinger::sActiveDisplayRotationFlags is removed.
Vishnu Nair67b431c2022-11-16 01:54:05 +000036 bool isPrimary;
Vishnu Nair81750622023-03-08 15:02:06 -080037 bool isVirtual;
Vishnu Nair67b431c2022-11-16 01:54:05 +000038 ui::Transform::RotationFlags rotationFlags;
Vishnu Naircfb2d252023-01-19 04:44:02 +000039 ui::Transform::RotationFlags transformHint;
40 std::string getDebugString() const {
41 std::stringstream debug;
42 debug << "DisplayInfo {displayId=" << info.displayId << " lw=" << info.logicalWidth
43 << " lh=" << info.logicalHeight << " transform={" << transform.dsdx() << " ,"
44 << transform.dsdy() << " ," << transform.dtdx() << " ," << transform.dtdy()
45 << "} isSecure=" << isSecure << " isPrimary=" << isPrimary
46 << " rotationFlags=" << rotationFlags << " transformHint=" << transformHint << "}";
47 return debug.str();
48 }
Vishnu Nair67b431c2022-11-16 01:54:05 +000049};
50
Dominik Laskowski6b049ff2023-01-29 15:46:45 -050051using DisplayInfos = ui::DisplayMap<ui::LayerStack, DisplayInfo>;
52
Vishnu Nairaf6d2972022-11-18 06:26:38 +000053} // namespace android::surfaceflinger::frontend