| Lloyd Pique | 9755fb7 | 2019-03-26 14:44:40 -0700 | [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/LayerFECompositionState.h> | 
|  | 19 | #include <compositionengine/impl/DumpHelpers.h> | 
|  | 20 |  | 
|  | 21 | namespace android::compositionengine { | 
|  | 22 |  | 
|  | 23 | namespace { | 
|  | 24 |  | 
|  | 25 | using android::compositionengine::impl::dumpVal; | 
|  | 26 |  | 
|  | 27 | void dumpVal(std::string& out, const char* name, half4 value) { | 
|  | 28 | using android::base::StringAppendF; | 
|  | 29 | StringAppendF(&out, "%s=[%f %f %f] ", name, static_cast<float>(value.r), | 
|  | 30 | static_cast<float>(value.g), static_cast<float>(value.b)); | 
|  | 31 | } | 
|  | 32 |  | 
|  | 33 | } // namespace | 
|  | 34 |  | 
|  | 35 | void LayerFECompositionState::dump(std::string& out) const { | 
|  | 36 | out.append("      "); | 
|  | 37 | dumpVal(out, "isSecure", isSecure); | 
|  | 38 | dumpVal(out, "geomUsesSourceCrop", geomUsesSourceCrop); | 
|  | 39 | dumpVal(out, "geomBufferUsesDisplayInverseTransform", geomBufferUsesDisplayInverseTransform); | 
|  | 40 | dumpVal(out, "geomLayerTransform", geomLayerTransform); | 
|  | 41 |  | 
|  | 42 | out.append("\n      "); | 
|  | 43 | dumpVal(out, "geomBufferSize", geomBufferSize); | 
|  | 44 | dumpVal(out, "geomContentCrop", geomContentCrop); | 
|  | 45 | dumpVal(out, "geomCrop", geomCrop); | 
|  | 46 | dumpVal(out, "geomBufferTransform", geomBufferTransform); | 
|  | 47 |  | 
|  | 48 | out.append("\n      "); | 
|  | 49 | dumpVal(out, "transparentRegionHint", transparentRegionHint); | 
|  | 50 |  | 
|  | 51 | out.append("      "); | 
|  | 52 | dumpVal(out, "geomLayerBounds", geomLayerBounds); | 
|  | 53 |  | 
|  | 54 | out.append("\n      "); | 
|  | 55 | dumpVal(out, "blend", toString(blendMode), blendMode); | 
|  | 56 | dumpVal(out, "alpha", alpha); | 
|  | 57 |  | 
|  | 58 | out.append("\n      "); | 
|  | 59 | dumpVal(out, "type", type); | 
|  | 60 | dumpVal(out, "appId", appId); | 
|  | 61 |  | 
|  | 62 | dumpVal(out, "composition type", toString(compositionType), compositionType); | 
|  | 63 |  | 
|  | 64 | out.append("\n      buffer: "); | 
|  | 65 | dumpVal(out, "slot", bufferSlot); | 
|  | 66 | dumpVal(out, "buffer", buffer.get()); | 
|  | 67 |  | 
|  | 68 | out.append("\n      "); | 
|  | 69 | dumpVal(out, "sideband stream", sidebandStream.get()); | 
|  | 70 |  | 
|  | 71 | out.append("\n      "); | 
|  | 72 | dumpVal(out, "color", color); | 
|  | 73 |  | 
|  | 74 | out.append("\n      "); | 
|  | 75 | dumpVal(out, "isOpaque", isOpaque); | 
|  | 76 | dumpVal(out, "hasProtectedContent", hasProtectedContent); | 
|  | 77 | dumpVal(out, "isColorspaceAgnostic", isColorspaceAgnostic); | 
|  | 78 | dumpVal(out, "dataspace", toString(dataspace), dataspace); | 
|  | 79 | dumpVal(out, "hdr metadata types", hdrMetadata.validTypes); | 
|  | 80 | dumpVal(out, "colorTransform", colorTransform); | 
|  | 81 |  | 
|  | 82 | out.append("\n"); | 
|  | 83 | } | 
|  | 84 |  | 
|  | 85 | } // namespace android::compositionengine |