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 19 #include <sstream> 20 21 #include <gui/DisplayInfo.h> 22 #include <ui/DisplayMap.h> 23 #include <ui/LayerStack.h> 24 #include <ui/Transform.h> 25 26 namespace android::surfaceflinger::frontend { 27 28 // Display information needed to populate input and calculate layer geometry. 29 struct DisplayInfo { 30 gui::DisplayInfo info; 31 ui::Transform transform; 32 bool receivesInput; 33 bool isSecure; 34 // TODO(b/259407931): can eliminate once SurfaceFlinger::sActiveDisplayRotationFlags is removed. 35 bool isPrimary; 36 bool isVirtual; 37 ui::Transform::RotationFlags rotationFlags; 38 ui::Transform::RotationFlags transformHint; getDebugStringDisplayInfo39 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 } 48 }; 49 50 using DisplayInfos = ui::DisplayMap<ui::LayerStack, DisplayInfo>; 51 52 } // namespace android::surfaceflinger::frontend 53