Home | History | Annotate | Download | only in src
      1 /*
      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 <compositionengine/impl/DumpHelpers.h>
     18 #include <compositionengine/impl/OutputLayerCompositionState.h>
     19 
     20 #include "DisplayHardware/HWC2.h"
     21 
     22 namespace android::compositionengine::impl {
     23 
     24 namespace {
     25 
     26 void dumpHwc(const OutputLayerCompositionState::Hwc& hwc, std::string& out) {
     27     out.append("\n      hwc: ");
     28 
     29     if (hwc.hwcLayer == nullptr) {
     30         out.append("No layer ");
     31     } else {
     32         dumpHex(out, "layer", hwc.hwcLayer->getId());
     33     }
     34 
     35     dumpVal(out, "composition", toString(hwc.hwcCompositionType), hwc.hwcCompositionType);
     36 }
     37 
     38 } // namespace
     39 
     40 void OutputLayerCompositionState::dump(std::string& out) const {
     41     out.append("      ");
     42     dumpVal(out, "visibleRegion", visibleRegion);
     43 
     44     out.append("      ");
     45     dumpVal(out, "forceClientComposition", forceClientComposition);
     46     dumpVal(out, "clearClientTarget", clearClientTarget);
     47     dumpVal(out, "displayFrame", displayFrame);
     48     dumpVal(out, "sourceCrop", sourceCrop);
     49     dumpVal(out, "bufferTransform", toString(bufferTransform), bufferTransform);
     50     dumpVal(out, "z-index", z);
     51 
     52     if (hwc) {
     53         dumpHwc(*hwc, out);
     54     }
     55 
     56     out.append("\n");
     57 }
     58 
     59 } // namespace android::compositionengine::impl
     60