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 | |
| 17 | #include <compositionengine/impl/DumpHelpers.h> |
| 18 | #include <compositionengine/impl/OutputLayerCompositionState.h> |
| 19 | |
| 20 | #include "DisplayHardware/HWC2.h" |
| 21 | |
| 22 | namespace android::compositionengine::impl { |
| 23 | |
| 24 | namespace { |
| 25 | |
| 26 | void dumpHwc(const OutputLayerCompositionState::Hwc& hwc, std::string& out) { |
| 27 | out.append("\n hwc: "); |
| 28 | |
| 29 | if (hwc.hwcLayer == nullptr) { |
| 30 | out.append("No layer "); |
| 31 | } else { |
| 32 | dumpHex(out, "layer", hwc.hwcLayer->getId()); |
| 33 | } |
| 34 | |
| 35 | dumpVal(out, "composition", toString(hwc.hwcCompositionType), hwc.hwcCompositionType); |
| 36 | } |
| 37 | |
| 38 | } // namespace |
| 39 | |
| 40 | void OutputLayerCompositionState::dump(std::string& out) const { |
| 41 | out.append(" "); |
| 42 | dumpVal(out, "visibleRegion", visibleRegion); |
| 43 | |
| 44 | out.append(" "); |
Lloyd Pique | a246866 | 2019-03-07 21:31:06 -0800 | [diff] [blame] | 45 | dumpVal(out, "visibleNonTransparentRegion", visibleNonTransparentRegion); |
| 46 | |
| 47 | out.append(" "); |
| 48 | dumpVal(out, "coveredRegion", coveredRegion); |
| 49 | |
| 50 | out.append(" "); |
| 51 | dumpVal(out, "output visibleRegion", outputSpaceVisibleRegion); |
| 52 | |
| 53 | out.append(" "); |
Vishnu Nair | a483b4a | 2019-12-12 15:07:52 -0800 | [diff] [blame^] | 54 | dumpVal(out, "shadowRegion", shadowRegion); |
| 55 | |
| 56 | out.append(" "); |
Lloyd Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame] | 57 | dumpVal(out, "forceClientComposition", forceClientComposition); |
| 58 | dumpVal(out, "clearClientTarget", clearClientTarget); |
| 59 | dumpVal(out, "displayFrame", displayFrame); |
| 60 | dumpVal(out, "sourceCrop", sourceCrop); |
Lloyd Pique | 207def9 | 2019-02-28 16:09:52 -0800 | [diff] [blame] | 61 | dumpVal(out, "bufferTransform", toString(bufferTransform), bufferTransform); |
Lloyd Pique | f527548 | 2019-01-29 18:42:42 -0800 | [diff] [blame] | 62 | dumpVal(out, "dataspace", toString(dataspace), dataspace); |
Lloyd Pique | 37c2c9b | 2018-12-04 17:25:10 -0800 | [diff] [blame] | 63 | dumpVal(out, "z-index", z); |
| 64 | |
| 65 | if (hwc) { |
| 66 | dumpHwc(*hwc, out); |
| 67 | } |
| 68 | |
| 69 | out.append("\n"); |
| 70 | } |
| 71 | |
| 72 | } // namespace android::compositionengine::impl |