Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10dc2bbc authored by Leon Scroggins's avatar Leon Scroggins Committed by Android (Google) Code Review
Browse files

Merge "Handle DISPLAY_DECORATION"

parents d34795a6 09c25417
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -539,6 +539,7 @@ void OutputLayer::writeOutputIndependentPerFrameStateToHWC(
            break;
            break;
        case Composition::CURSOR:
        case Composition::CURSOR:
        case Composition::DEVICE:
        case Composition::DEVICE:
        case Composition::DISPLAY_DECORATION:
            writeBufferStateToHWC(hwcLayer, outputIndependentState, skipLayer);
            writeBufferStateToHWC(hwcLayer, outputIndependentState, skipLayer);
            break;
            break;
        case Composition::INVALID:
        case Composition::INVALID:
@@ -684,6 +685,7 @@ void OutputLayer::detectDisallowedCompositionTypeChange(Composition from, Compos


        case Composition::DEVICE:
        case Composition::DEVICE:
        case Composition::SOLID_COLOR:
        case Composition::SOLID_COLOR:
        case Composition::DISPLAY_DECORATION:
            result = (to == Composition::CLIENT);
            result = (to == Composition::CLIENT);
            break;
            break;


+8 −0
Original line number Original line Diff line number Diff line
@@ -114,6 +114,10 @@ std::optional<Plan> Plan::fromString(const std::string& string) {
                plan.addLayerType(
                plan.addLayerType(
                        aidl::android::hardware::graphics::composer3::Composition::SOLID_COLOR);
                        aidl::android::hardware::graphics::composer3::Composition::SOLID_COLOR);
                continue;
                continue;
            case 'A':
                plan.addLayerType(aidl::android::hardware::graphics::composer3::Composition::
                                          DISPLAY_DECORATION);
                continue;
            default:
            default:
                return std::nullopt;
                return std::nullopt;
        }
        }
@@ -143,6 +147,10 @@ std::string to_string(const Plan& plan) {
            case aidl::android::hardware::graphics::composer3::Composition::SOLID_COLOR:
            case aidl::android::hardware::graphics::composer3::Composition::SOLID_COLOR:
                result.append("S");
                result.append("S");
                break;
                break;
            case aidl::android::hardware::graphics::composer3::Composition::DISPLAY_DECORATION:
                // A for "Alpha", since the decoration is an alpha layer.
                result.append("A");
                break;
        }
        }
    }
    }
    return result;
    return result;
+2 −0
Original line number Original line Diff line number Diff line
@@ -111,6 +111,8 @@ inline std::string to_string(
            return "Cursor";
            return "Cursor";
        case aidl::android::hardware::graphics::composer3::Composition::SIDEBAND:
        case aidl::android::hardware::graphics::composer3::Composition::SIDEBAND:
            return "Sideband";
            return "Sideband";
        case aidl::android::hardware::graphics::composer3::Composition::DISPLAY_DECORATION:
            return "DisplayDecoration";
        default:
        default:
            return "Unknown";
            return "Unknown";
    }
    }
+6 −0
Original line number Original line Diff line number Diff line
@@ -30,6 +30,7 @@
#include <hidl/HidlTransportUtils.h>
#include <hidl/HidlTransportUtils.h>
#include <log/log.h>
#include <log/log.h>
#include <utils/Trace.h>
#include <utils/Trace.h>
#include "Hal.h"


#include <algorithm>
#include <algorithm>
#include <cinttypes>
#include <cinttypes>
@@ -620,6 +621,11 @@ Error HidlComposer::setLayerColor(Display display, Layer layer,


static IComposerClient::Composition to_hidl_type(
static IComposerClient::Composition to_hidl_type(
        aidl::android::hardware::graphics::composer3::Composition type) {
        aidl::android::hardware::graphics::composer3::Composition type) {
    LOG_ALWAYS_FATAL_IF(static_cast<int32_t>(type) >
                                static_cast<int32_t>(IComposerClient::Composition::SIDEBAND),
                        "Trying to use %s, which is not supported by HidlComposer!",
                        android::to_string(type).c_str());

    return static_cast<IComposerClient::Composition>(type);
    return static_cast<IComposerClient::Composition>(type);
}
}