blob: 3e0f8038d79ed3e1f8ac225f781c1a4ce68d4ef9 [file] [log] [blame]
Lloyd Pique9755fb72019-03-26 14:44:40 -07001/*
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
21namespace android::compositionengine {
22
23namespace {
24
25using android::compositionengine::impl::dumpVal;
26
27void 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
Lloyd Piquede196652020-01-22 17:29:58 -080035LayerFECompositionState::~LayerFECompositionState() = default;
36
Lloyd Pique9755fb72019-03-26 14:44:40 -070037void LayerFECompositionState::dump(std::string& out) const {
38 out.append(" ");
39 dumpVal(out, "isSecure", isSecure);
40 dumpVal(out, "geomUsesSourceCrop", geomUsesSourceCrop);
41 dumpVal(out, "geomBufferUsesDisplayInverseTransform", geomBufferUsesDisplayInverseTransform);
42 dumpVal(out, "geomLayerTransform", geomLayerTransform);
43
44 out.append("\n ");
45 dumpVal(out, "geomBufferSize", geomBufferSize);
46 dumpVal(out, "geomContentCrop", geomContentCrop);
47 dumpVal(out, "geomCrop", geomCrop);
48 dumpVal(out, "geomBufferTransform", geomBufferTransform);
49
50 out.append("\n ");
51 dumpVal(out, "transparentRegionHint", transparentRegionHint);
52
53 out.append(" ");
54 dumpVal(out, "geomLayerBounds", geomLayerBounds);
55
Vishnu Naira483b4a2019-12-12 15:07:52 -080056 out.append(" ");
57 dumpVal(out, "shadowRadius", shadowRadius);
58
Lloyd Pique9755fb72019-03-26 14:44:40 -070059 out.append("\n ");
60 dumpVal(out, "blend", toString(blendMode), blendMode);
61 dumpVal(out, "alpha", alpha);
Lucas Dupin19c8f0e2019-11-25 17:55:44 -080062 dumpVal(out, "backgroundBlurRadius", backgroundBlurRadius);
Lloyd Pique9755fb72019-03-26 14:44:40 -070063
64 out.append("\n ");
65 dumpVal(out, "type", type);
66 dumpVal(out, "appId", appId);
67
68 dumpVal(out, "composition type", toString(compositionType), compositionType);
69
70 out.append("\n buffer: ");
71 dumpVal(out, "slot", bufferSlot);
72 dumpVal(out, "buffer", buffer.get());
73
74 out.append("\n ");
75 dumpVal(out, "sideband stream", sidebandStream.get());
76
77 out.append("\n ");
78 dumpVal(out, "color", color);
79
80 out.append("\n ");
81 dumpVal(out, "isOpaque", isOpaque);
82 dumpVal(out, "hasProtectedContent", hasProtectedContent);
83 dumpVal(out, "isColorspaceAgnostic", isColorspaceAgnostic);
84 dumpVal(out, "dataspace", toString(dataspace), dataspace);
85 dumpVal(out, "hdr metadata types", hdrMetadata.validTypes);
86 dumpVal(out, "colorTransform", colorTransform);
87
88 out.append("\n");
89}
90
91} // namespace android::compositionengine