blob: 517b641594408154c9ce117451cce71f248a0150 [file] [log] [blame]
Lloyd Pique0b785d82018-12-04 17:25:27 -08001/*
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/impl/DumpHelpers.h>
19#include <compositionengine/impl/LayerCompositionState.h>
20
21namespace android::compositionengine::impl {
22
23namespace {
24
25using android::compositionengine::impl::dumpVal;
26
27void dumpVal(std::string& out, const char* name, Hwc2::IComposerClient::Color value) {
28 using android::base::StringAppendF;
29 StringAppendF(&out, "%s=[%d %d %d] ", name, value.r, value.g, value.b);
30}
31
32void dumpFrontEnd(std::string& out, const LayerFECompositionState& state) {
33 out.append(" ");
34 dumpVal(out, "blend", toString(state.blendMode), state.blendMode);
35 dumpVal(out, "alpha", state.alpha);
36
37 out.append("\n ");
38 dumpVal(out, "type", state.type);
39 dumpVal(out, "appId", state.appId);
40
41 dumpVal(out, "composition type", toString(state.compositionType), state.compositionType);
42
43 out.append("\n buffer: ");
44 dumpVal(out, "buffer", state.buffer.get());
45 dumpVal(out, "slot", state.bufferSlot);
46
47 out.append("\n ");
48 dumpVal(out, "sideband stream", state.sidebandStream.get());
49
50 out.append("\n ");
51 dumpVal(out, "color", state.color);
52
53 out.append("\n ");
54 dumpVal(out, "dataspace", toString(state.dataspace), state.dataspace);
55 dumpVal(out, "hdr metadata types", state.hdrMetadata.validTypes);
56 dumpVal(out, "colorTransform", state.colorTransform);
57
58 out.append("\n");
59}
60
61} // namespace
62
63void LayerCompositionState::dump(std::string& out) const {
64 out.append(" frontend:\n");
65 dumpFrontEnd(out, frontEnd);
66}
67
68} // namespace android::compositionengine::impl