blob: 085e83838ece648fc733800d5d8f1bbd1e1f9eef [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
Ady Abrahamb0dbdaa2020-01-06 16:19:42 -080017// TODO(b/129481165): remove the #pragma below and fix conversion issues
18#pragma clang diagnostic push
19#pragma clang diagnostic ignored "-Wconversion"
20
Lloyd Pique9755fb72019-03-26 14:44:40 -070021#include <android-base/stringprintf.h>
22#include <compositionengine/LayerFECompositionState.h>
23#include <compositionengine/impl/DumpHelpers.h>
24
25namespace android::compositionengine {
26
27namespace {
28
29using android::compositionengine::impl::dumpVal;
30
31void dumpVal(std::string& out, const char* name, half4 value) {
32 using android::base::StringAppendF;
33 StringAppendF(&out, "%s=[%f %f %f] ", name, static_cast<float>(value.r),
34 static_cast<float>(value.g), static_cast<float>(value.b));
35}
36
37} // namespace
38
39void LayerFECompositionState::dump(std::string& out) const {
40 out.append(" ");
41 dumpVal(out, "isSecure", isSecure);
42 dumpVal(out, "geomUsesSourceCrop", geomUsesSourceCrop);
43 dumpVal(out, "geomBufferUsesDisplayInverseTransform", geomBufferUsesDisplayInverseTransform);
44 dumpVal(out, "geomLayerTransform", geomLayerTransform);
45
46 out.append("\n ");
47 dumpVal(out, "geomBufferSize", geomBufferSize);
48 dumpVal(out, "geomContentCrop", geomContentCrop);
49 dumpVal(out, "geomCrop", geomCrop);
50 dumpVal(out, "geomBufferTransform", geomBufferTransform);
51
52 out.append("\n ");
53 dumpVal(out, "transparentRegionHint", transparentRegionHint);
54
55 out.append(" ");
56 dumpVal(out, "geomLayerBounds", geomLayerBounds);
57
Vishnu Naira483b4a2019-12-12 15:07:52 -080058 out.append(" ");
59 dumpVal(out, "shadowRadius", shadowRadius);
60
Lloyd Pique9755fb72019-03-26 14:44:40 -070061 out.append("\n ");
62 dumpVal(out, "blend", toString(blendMode), blendMode);
63 dumpVal(out, "alpha", alpha);
64
65 out.append("\n ");
66 dumpVal(out, "type", type);
67 dumpVal(out, "appId", appId);
68
69 dumpVal(out, "composition type", toString(compositionType), compositionType);
70
71 out.append("\n buffer: ");
72 dumpVal(out, "slot", bufferSlot);
73 dumpVal(out, "buffer", buffer.get());
74
75 out.append("\n ");
76 dumpVal(out, "sideband stream", sidebandStream.get());
77
78 out.append("\n ");
79 dumpVal(out, "color", color);
80
81 out.append("\n ");
82 dumpVal(out, "isOpaque", isOpaque);
83 dumpVal(out, "hasProtectedContent", hasProtectedContent);
84 dumpVal(out, "isColorspaceAgnostic", isColorspaceAgnostic);
85 dumpVal(out, "dataspace", toString(dataspace), dataspace);
86 dumpVal(out, "hdr metadata types", hdrMetadata.validTypes);
87 dumpVal(out, "colorTransform", colorTransform);
88
89 out.append("\n");
90}
91
92} // namespace android::compositionengine
Ady Abrahamb0dbdaa2020-01-06 16:19:42 -080093
94// TODO(b/129481165): remove the #pragma below and fix conversion issues
95#pragma clang diagnostic pop // ignored "-Wconversion"