Lloyd Pique | 0b785d8 | 2018-12-04 17:25:27 -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 <android-base/stringprintf.h> |
| 18 | #include <compositionengine/impl/DumpHelpers.h> |
| 19 | #include <compositionengine/impl/LayerCompositionState.h> |
| 20 | |
| 21 | namespace android::compositionengine::impl { |
| 22 | |
| 23 | namespace { |
| 24 | |
| 25 | using android::compositionengine::impl::dumpVal; |
| 26 | |
| 27 | void dumpVal(std::string& out, const char* name, Hwc2::IComposerClient::Color value) { |
| 28 | using android::base::StringAppendF; |
| 29 | StringAppendF(&out, "%s=[%d %d %d] ", name, value.r, value.g, value.b); |
| 30 | } |
| 31 | |
| 32 | void dumpFrontEnd(std::string& out, const LayerFECompositionState& state) { |
| 33 | out.append(" "); |
| 34 | dumpVal(out, "blend", toString(state.blendMode), state.blendMode); |
| 35 | dumpVal(out, "alpha", state.alpha); |
| 36 | |
| 37 | out.append("\n "); |
| 38 | dumpVal(out, "type", state.type); |
| 39 | dumpVal(out, "appId", state.appId); |
| 40 | |
| 41 | dumpVal(out, "composition type", toString(state.compositionType), state.compositionType); |
| 42 | |
| 43 | out.append("\n buffer: "); |
| 44 | dumpVal(out, "buffer", state.buffer.get()); |
| 45 | dumpVal(out, "slot", state.bufferSlot); |
| 46 | |
| 47 | out.append("\n "); |
| 48 | dumpVal(out, "sideband stream", state.sidebandStream.get()); |
| 49 | |
| 50 | out.append("\n "); |
| 51 | dumpVal(out, "color", state.color); |
| 52 | |
| 53 | out.append("\n "); |
| 54 | dumpVal(out, "dataspace", toString(state.dataspace), state.dataspace); |
| 55 | dumpVal(out, "hdr metadata types", state.hdrMetadata.validTypes); |
| 56 | dumpVal(out, "colorTransform", state.colorTransform); |
| 57 | |
| 58 | out.append("\n"); |
| 59 | } |
| 60 | |
| 61 | } // namespace |
| 62 | |
| 63 | void LayerCompositionState::dump(std::string& out) const { |
| 64 | out.append(" frontend:\n"); |
| 65 | dumpFrontEnd(out, frontEnd); |
| 66 | } |
| 67 | |
| 68 | } // namespace android::compositionengine::impl |