blob: 016084f519c2bad0d65eaf23d1cc74a44af1f00d [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
35void 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
Vishnu Naira483b4a2019-12-12 15:07:52 -080054 out.append(" ");
55 dumpVal(out, "shadowRadius", shadowRadius);
56
Lloyd Pique9755fb72019-03-26 14:44:40 -070057 out.append("\n ");
58 dumpVal(out, "blend", toString(blendMode), blendMode);
59 dumpVal(out, "alpha", alpha);
Lucas Dupin19c8f0e2019-11-25 17:55:44 -080060 dumpVal(out, "backgroundBlurRadius", backgroundBlurRadius);
Lloyd Pique9755fb72019-03-26 14:44:40 -070061
62 out.append("\n ");
63 dumpVal(out, "type", type);
64 dumpVal(out, "appId", appId);
65
66 dumpVal(out, "composition type", toString(compositionType), compositionType);
67
68 out.append("\n buffer: ");
69 dumpVal(out, "slot", bufferSlot);
70 dumpVal(out, "buffer", buffer.get());
71
72 out.append("\n ");
73 dumpVal(out, "sideband stream", sidebandStream.get());
74
75 out.append("\n ");
76 dumpVal(out, "color", color);
77
78 out.append("\n ");
79 dumpVal(out, "isOpaque", isOpaque);
80 dumpVal(out, "hasProtectedContent", hasProtectedContent);
81 dumpVal(out, "isColorspaceAgnostic", isColorspaceAgnostic);
82 dumpVal(out, "dataspace", toString(dataspace), dataspace);
83 dumpVal(out, "hdr metadata types", hdrMetadata.validTypes);
84 dumpVal(out, "colorTransform", colorTransform);
85
86 out.append("\n");
87}
88
89} // namespace android::compositionengine