Vishnu Nair | 67b431c | 2022-11-16 01:54:05 +0000 | [diff] [blame] | 1 | /* |
| 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 Nair | cfb2d25 | 2023-01-19 04:44:02 +0000 | [diff] [blame] | 19 | #include <sstream> |
| 20 | |
Vishnu Nair | 67b431c | 2022-11-16 01:54:05 +0000 | [diff] [blame] | 21 | #include <gui/DisplayInfo.h> |
Dominik Laskowski | 6b049ff | 2023-01-29 15:46:45 -0500 | [diff] [blame] | 22 | #include <ui/DisplayMap.h> |
| 23 | #include <ui/LayerStack.h> |
| 24 | #include <ui/Transform.h> |
Vishnu Nair | 67b431c | 2022-11-16 01:54:05 +0000 | [diff] [blame] | 25 | |
Vishnu Nair | af6d297 | 2022-11-18 06:26:38 +0000 | [diff] [blame] | 26 | namespace android::surfaceflinger::frontend { |
Vishnu Nair | 67b431c | 2022-11-16 01:54:05 +0000 | [diff] [blame] | 27 | |
| 28 | // Display information needed to populate input and calculate layer geometry. |
Vishnu Nair | af6d297 | 2022-11-18 06:26:38 +0000 | [diff] [blame] | 29 | struct DisplayInfo { |
Vishnu Nair | 67b431c | 2022-11-16 01:54:05 +0000 | [diff] [blame] | 30 | gui::DisplayInfo info; |
| 31 | ui::Transform transform; |
| 32 | bool receivesInput; |
| 33 | bool isSecure; |
Leon Scroggins III | 85d4b22 | 2023-05-09 13:58:18 -0400 | [diff] [blame] | 34 | // TODO(b/259407931): can eliminate once SurfaceFlinger::sActiveDisplayRotationFlags is removed. |
Vishnu Nair | 67b431c | 2022-11-16 01:54:05 +0000 | [diff] [blame] | 35 | bool isPrimary; |
Vishnu Nair | 8175062 | 2023-03-08 15:02:06 -0800 | [diff] [blame] | 36 | bool isVirtual; |
Vishnu Nair | 67b431c | 2022-11-16 01:54:05 +0000 | [diff] [blame] | 37 | ui::Transform::RotationFlags rotationFlags; |
Vishnu Nair | cfb2d25 | 2023-01-19 04:44:02 +0000 | [diff] [blame] | 38 | 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 Nair | 67b431c | 2022-11-16 01:54:05 +0000 | [diff] [blame] | 48 | }; |
| 49 | |
Dominik Laskowski | 6b049ff | 2023-01-29 15:46:45 -0500 | [diff] [blame] | 50 | using DisplayInfos = ui::DisplayMap<ui::LayerStack, DisplayInfo>; |
| 51 | |
Vishnu Nair | af6d297 | 2022-11-18 06:26:38 +0000 | [diff] [blame] | 52 | } // namespace android::surfaceflinger::frontend |