blob: 6502f36f702cd3dc2125441338d5756e21560b6f [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>
24#include <ui/Transform.h>
Vishnu Nair67b431c2022-11-16 01:54:05 +000025
Vishnu Nairaf6d2972022-11-18 06:26:38 +000026namespace android::surfaceflinger::frontend {
Vishnu Nair67b431c2022-11-16 01:54:05 +000027
28// Display information needed to populate input and calculate layer geometry.
Vishnu Nairaf6d2972022-11-18 06:26:38 +000029struct DisplayInfo {
Vishnu Nair67b431c2022-11-16 01:54:05 +000030 gui::DisplayInfo info;
31 ui::Transform transform;
32 bool receivesInput;
33 bool isSecure;
Leon Scroggins III85d4b222023-05-09 13:58:18 -040034 // TODO(b/259407931): can eliminate once SurfaceFlinger::sActiveDisplayRotationFlags is removed.
Vishnu Nair67b431c2022-11-16 01:54:05 +000035 bool isPrimary;
Vishnu Nair81750622023-03-08 15:02:06 -080036 bool isVirtual;
Vishnu Nair67b431c2022-11-16 01:54:05 +000037 ui::Transform::RotationFlags rotationFlags;
Vishnu Naircfb2d252023-01-19 04:44:02 +000038 ui::Transform::RotationFlags transformHint;
39 std::string getDebugString() const {
40 std::stringstream debug;
41 debug << "DisplayInfo {displayId=" << info.displayId << " lw=" << info.logicalWidth
42 << " lh=" << info.logicalHeight << " transform={" << transform.dsdx() << " ,"
43 << transform.dsdy() << " ," << transform.dtdx() << " ," << transform.dtdy()
44 << "} isSecure=" << isSecure << " isPrimary=" << isPrimary
45 << " rotationFlags=" << rotationFlags << " transformHint=" << transformHint << "}";
46 return debug.str();
47 }
Vishnu Nair67b431c2022-11-16 01:54:05 +000048};
49
Dominik Laskowski6b049ff2023-01-29 15:46:45 -050050using DisplayInfos = ui::DisplayMap<ui::LayerStack, DisplayInfo>;
51
Vishnu Nairaf6d2972022-11-18 06:26:38 +000052} // namespace android::surfaceflinger::frontend