Lloyd Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 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 | |
Lloyd Pique | 3b5a69e | 2020-01-16 17:51:01 -0800 | [diff] [blame] | 17 | #include <compositionengine/impl/DumpHelpers.h> |
| 18 | #include <compositionengine/impl/OutputLayerCompositionState.h> |
| 19 | |
Ady Abraham | b0dbdaa | 2020-01-06 16:19:42 -0800 | [diff] [blame] | 20 | // TODO(b/129481165): remove the #pragma below and fix conversion issues |
| 21 | #pragma clang diagnostic push |
| 22 | #pragma clang diagnostic ignored "-Wconversion" |
| 23 | |
Lloyd Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame] | 24 | #include "DisplayHardware/HWC2.h" |
| 25 | |
Lloyd Pique | 3b5a69e | 2020-01-16 17:51:01 -0800 | [diff] [blame] | 26 | // TODO(b/129481165): remove the #pragma below and fix conversion issues |
| 27 | #pragma clang diagnostic pop // ignored "-Wconversion" |
| 28 | |
Lloyd Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame] | 29 | namespace android::compositionengine::impl { |
| 30 | |
| 31 | namespace { |
| 32 | |
| 33 | void dumpHwc(const OutputLayerCompositionState::Hwc& hwc, std::string& out) { |
| 34 | out.append("\n hwc: "); |
| 35 | |
| 36 | if (hwc.hwcLayer == nullptr) { |
| 37 | out.append("No layer "); |
| 38 | } else { |
| 39 | dumpHex(out, "layer", hwc.hwcLayer->getId()); |
| 40 | } |
| 41 | |
| 42 | dumpVal(out, "composition", toString(hwc.hwcCompositionType), hwc.hwcCompositionType); |
| 43 | } |
| 44 | |
| 45 | } // namespace |
| 46 | |
| 47 | void OutputLayerCompositionState::dump(std::string& out) const { |
| 48 | out.append(" "); |
| 49 | dumpVal(out, "visibleRegion", visibleRegion); |
| 50 | |
| 51 | out.append(" "); |
Lloyd Pique | a246866 | 2019-03-07 21:31:06 -0800 | [diff] [blame] | 52 | dumpVal(out, "visibleNonTransparentRegion", visibleNonTransparentRegion); |
| 53 | |
| 54 | out.append(" "); |
| 55 | dumpVal(out, "coveredRegion", coveredRegion); |
| 56 | |
| 57 | out.append(" "); |
| 58 | dumpVal(out, "output visibleRegion", outputSpaceVisibleRegion); |
| 59 | |
| 60 | out.append(" "); |
Vishnu Nair | a483b4a | 2019-12-12 15:07:52 -0800 | [diff] [blame] | 61 | dumpVal(out, "shadowRegion", shadowRegion); |
| 62 | |
| 63 | out.append(" "); |
Leon Scroggins III | 7f7ad2c | 2022-03-17 17:06:20 -0400 | [diff] [blame] | 64 | dumpVal(out, "outputSpaceBlockingRegionHint", outputSpaceBlockingRegionHint); |
| 65 | |
| 66 | out.append(" "); |
Lloyd Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame] | 67 | dumpVal(out, "forceClientComposition", forceClientComposition); |
| 68 | dumpVal(out, "clearClientTarget", clearClientTarget); |
| 69 | dumpVal(out, "displayFrame", displayFrame); |
| 70 | dumpVal(out, "sourceCrop", sourceCrop); |
Lloyd Pique | 207def9 | 2019-02-28 16:09:52 -0800 | [diff] [blame] | 71 | dumpVal(out, "bufferTransform", toString(bufferTransform), bufferTransform); |
Lloyd Pique | f527548 | 2019-01-29 18:42:42 -0800 | [diff] [blame] | 72 | dumpVal(out, "dataspace", toString(dataspace), dataspace); |
Alec Mouri | c6f3101 | 2022-02-11 12:24:52 -0800 | [diff] [blame] | 73 | dumpVal(out, "whitePointNits", whitePointNits); |
| 74 | dumpVal(out, "dimmingRatio", dimmingRatio); |
Brian Lindahl | 1a4ffd8 | 2024-10-30 11:00:37 -0600 | [diff] [blame] | 75 | if (pictureProfileHandle) { |
| 76 | dumpVal(out, "pictureProfile", toString(pictureProfileHandle)); |
| 77 | } |
Alec Mouri | 96b9645 | 2021-03-16 17:03:43 -0700 | [diff] [blame] | 78 | dumpVal(out, "override buffer", overrideInfo.buffer.get()); |
| 79 | dumpVal(out, "override acquire fence", overrideInfo.acquireFence.get()); |
| 80 | dumpVal(out, "override display frame", overrideInfo.displayFrame); |
| 81 | dumpVal(out, "override dataspace", toString(overrideInfo.dataspace), overrideInfo.dataspace); |
Alec Mouri | 7be6c0a | 2021-03-19 15:22:01 -0700 | [diff] [blame] | 82 | dumpVal(out, "override display space", to_string(overrideInfo.displaySpace)); |
Alec Mouri | 464352b | 2021-03-24 16:33:21 -0700 | [diff] [blame] | 83 | std::string damageRegionString; |
| 84 | overrideInfo.damageRegion.dump(damageRegionString, ""); |
| 85 | dumpVal(out, "override damage region", damageRegionString); |
| 86 | std::string visibleRegionString; |
| 87 | overrideInfo.visibleRegion.dump(visibleRegionString, ""); |
| 88 | dumpVal(out, "override visible region", visibleRegionString); |
Alec Mouri | f54453c | 2021-05-13 16:28:28 -0700 | [diff] [blame] | 89 | dumpVal(out, "override peekThroughLayer", overrideInfo.peekThroughLayer); |
| 90 | dumpVal(out, "override disableBackgroundBlur", overrideInfo.disableBackgroundBlur); |
Lloyd Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame] | 91 | |
| 92 | if (hwc) { |
| 93 | dumpHwc(*hwc, out); |
| 94 | } |
| 95 | |
| 96 | out.append("\n"); |
| 97 | } |
| 98 | |
| 99 | } // namespace android::compositionengine::impl |