blob: 8065e658d522f08afe24a07139b5277136c9b85f [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);
Lucas Dupin19c8f0e2019-11-25 17:55:44 -080064 dumpVal(out, "backgroundBlurRadius", backgroundBlurRadius);
Lloyd Pique9755fb72019-03-26 14:44:40 -070065
66 out.append("\n ");
67 dumpVal(out, "type", type);
68 dumpVal(out, "appId", appId);
69
70 dumpVal(out, "composition type", toString(compositionType), compositionType);
71
72 out.append("\n buffer: ");
73 dumpVal(out, "slot", bufferSlot);
74 dumpVal(out, "buffer", buffer.get());
75
76 out.append("\n ");
77 dumpVal(out, "sideband stream", sidebandStream.get());
78
79 out.append("\n ");
80 dumpVal(out, "color", color);
81
82 out.append("\n ");
83 dumpVal(out, "isOpaque", isOpaque);
84 dumpVal(out, "hasProtectedContent", hasProtectedContent);
85 dumpVal(out, "isColorspaceAgnostic", isColorspaceAgnostic);
86 dumpVal(out, "dataspace", toString(dataspace), dataspace);
87 dumpVal(out, "hdr metadata types", hdrMetadata.validTypes);
88 dumpVal(out, "colorTransform", colorTransform);
89
90 out.append("\n");
91}
92
93} // namespace android::compositionengine
Ady Abrahamb0dbdaa2020-01-06 16:19:42 -080094
95// TODO(b/129481165): remove the #pragma below and fix conversion issues
96#pragma clang diagnostic pop // ignored "-Wconversion"