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

Commit 4ea6cc9d authored by Chia-I Wu's avatar Chia-I Wu
Browse files

resolve merge conflicts of 1148147c to master

BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ic1f4b4a5e3390a1153af59197ed39cfb10856b31
parents 2da6d849 1148147c
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -519,11 +519,9 @@ Region BufferLayer::latchBuffer(bool& recomputeVisibleRegions, nsecs_t latchTime
        recomputeVisibleRegions = true;
    }

    // Dataspace::V0_SRGB and Dataspace::V0_SRGB_LINEAR are not legacy
    // data space, however since framework doesn't distinguish them out of
    // legacy SRGB, we have to treat them as the same for now.
    // UNKNOWN is treated as legacy SRGB when the connected api is EGL.
    ui::Dataspace dataSpace = mConsumer->getCurrentDataSpace();
    // treat modern dataspaces as legacy dataspaces whenever possible, until
    // we can trust the buffer producers
    switch (dataSpace) {
        case ui::Dataspace::V0_SRGB:
            dataSpace = ui::Dataspace::SRGB;
@@ -531,10 +529,17 @@ Region BufferLayer::latchBuffer(bool& recomputeVisibleRegions, nsecs_t latchTime
        case ui::Dataspace::V0_SRGB_LINEAR:
            dataSpace = ui::Dataspace::SRGB_LINEAR;
            break;
        case ui::Dataspace::UNKNOWN:
            if (mConsumer->getCurrentApi() == NATIVE_WINDOW_API_EGL) {
                dataSpace = ui::Dataspace::SRGB;
            }
        case ui::Dataspace::V0_JFIF:
            dataSpace = ui::Dataspace::JFIF;
            break;
        case ui::Dataspace::V0_BT601_625:
            dataSpace = ui::Dataspace::BT601_625;
            break;
        case ui::Dataspace::V0_BT601_525:
            dataSpace = ui::Dataspace::BT601_525;
            break;
        case ui::Dataspace::V0_BT709:
            dataSpace = ui::Dataspace::BT709;
            break;
        default:
            break;
+4 −3
Original line number Diff line number Diff line
@@ -1646,9 +1646,10 @@ bool Layer::detachChildren() {
    return true;
}

bool Layer::isLegacySrgbDataSpace() const {
    return mDrawingState.dataSpace == ui::Dataspace::SRGB ||
        mDrawingState.dataSpace == ui::Dataspace::SRGB_LINEAR;
bool Layer::isLegacyDataSpace() const {
    // return true when no higher bits are set
    return !(mDrawingState.dataSpace & (ui::Dataspace::STANDARD_MASK |
                ui::Dataspace::TRANSFER_MASK | ui::Dataspace::RANGE_MASK));
}

void Layer::setParent(const sp<Layer>& layer) {
+2 −2
Original line number Diff line number Diff line
@@ -240,8 +240,8 @@ public:
    // desaturated in order to match what they appears like visually.
    // With color management, these contents will appear desaturated, thus
    // needed to be saturated so that they match what they are designed for
    // visually. When returns true, legacy SRGB data space is passed to HWC.
    bool isLegacySrgbDataSpace() const;
    // visually.
    bool isLegacyDataSpace() const;

    // If we have received a new buffer this frame, we will pass its surface
    // damage down to hardware composer. Otherwise, we must send a region with
+1 −1
Original line number Diff line number Diff line
@@ -3080,7 +3080,7 @@ bool SurfaceFlinger::doComposeSurfaces(const sp<const DisplayDevice>& displayDev
                        bool restore = false;
                        mat4 savedMatrix;
                        if (mDisplayColorSetting == DisplayColorSetting::ENHANCED &&
                            layer->isLegacySrgbDataSpace()) {
                            layer->isLegacyDataSpace()) {
                            // TODO(b/78891890) Legacy sRGB saturation matrix should be set
                            // separately.
                            savedMatrix =