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

Commit b304b2f1 authored by Vishnu Nair's avatar Vishnu Nair Committed by Android (Google) Code Review
Browse files

Merge changes Iddd5754a,I245702f8,I7abe5e9c,Id9ff8a03 into udc-dev

* changes:
  [sf] destroy unreachable snapshots
  [sf] fix snapshot updates for mirror layers
  [sf] Add fps, meta data and opaque to layer snapshots
  SF: Frontend fixes for issues surfaced by SurfaceFlinger_test
parents 26b34d62 fccd6362
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ layer_state_t::layer_state_t()
        surfaceDamageRegion(),
        api(-1),
        colorTransform(mat4()),
        bgColorAlpha(0),
        bgColor(0),
        bgColorDataspace(ui::Dataspace::UNKNOWN),
        colorSpaceAgnostic(false),
        shadowRadius(0.0f),
@@ -140,7 +140,10 @@ status_t layer_state_t::write(Parcel& output) const
    SAFE_PARCEL(output.writeFloat, cornerRadius);
    SAFE_PARCEL(output.writeUint32, backgroundBlurRadius);
    SAFE_PARCEL(output.writeParcelable, metadata);
    SAFE_PARCEL(output.writeFloat, bgColorAlpha);
    SAFE_PARCEL(output.writeFloat, bgColor.r);
    SAFE_PARCEL(output.writeFloat, bgColor.g);
    SAFE_PARCEL(output.writeFloat, bgColor.b);
    SAFE_PARCEL(output.writeFloat, bgColor.a);
    SAFE_PARCEL(output.writeUint32, static_cast<uint32_t>(bgColorDataspace));
    SAFE_PARCEL(output.writeBool, colorSpaceAgnostic);
    SAFE_PARCEL(output.writeVectorSize, listeners);
@@ -259,7 +262,14 @@ status_t layer_state_t::read(const Parcel& input)
    SAFE_PARCEL(input.readUint32, &backgroundBlurRadius);
    SAFE_PARCEL(input.readParcelable, &metadata);

    SAFE_PARCEL(input.readFloat, &bgColorAlpha);
    SAFE_PARCEL(input.readFloat, &tmpFloat);
    bgColor.r = tmpFloat;
    SAFE_PARCEL(input.readFloat, &tmpFloat);
    bgColor.g = tmpFloat;
    SAFE_PARCEL(input.readFloat, &tmpFloat);
    bgColor.b = tmpFloat;
    SAFE_PARCEL(input.readFloat, &tmpFloat);
    bgColor.a = tmpFloat;
    SAFE_PARCEL(input.readUint32, &tmpUint32);
    bgColorDataspace = static_cast<ui::Dataspace>(tmpUint32);
    SAFE_PARCEL(input.readBool, &colorSpaceAgnostic);
@@ -618,8 +628,7 @@ void layer_state_t::merge(const layer_state_t& other) {
    }
    if (other.what & eBackgroundColorChanged) {
        what |= eBackgroundColorChanged;
        color.rgb = other.color.rgb;
        bgColorAlpha = other.bgColorAlpha;
        bgColor = other.bgColor;
        bgColorDataspace = other.bgColorDataspace;
    }
    if (other.what & eMetadataChanged) {
@@ -752,7 +761,7 @@ uint64_t layer_state_t::diff(const layer_state_t& other) const {
    CHECK_DIFF(diff, eColorTransformChanged, other, colorTransform);
    if (other.what & eHasListenerCallbacksChanged) diff |= eHasListenerCallbacksChanged;
    if (other.what & eInputInfoChanged) diff |= eInputInfoChanged;
    CHECK_DIFF3(diff, eBackgroundColorChanged, other, color.rgb, bgColorAlpha, bgColorDataspace);
    CHECK_DIFF2(diff, eBackgroundColorChanged, other, bgColor, bgColorDataspace);
    if (other.what & eMetadataChanged) diff |= eMetadataChanged;
    CHECK_DIFF(diff, eShadowRadiusChanged, other, shadowRadius);
    CHECK_DIFF3(diff, eRenderBorderChanged, other, borderEnabled, borderWidth, borderColor);
+2 −2
Original line number Diff line number Diff line
@@ -1560,8 +1560,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBackg
    }

    s->what |= layer_state_t::eBackgroundColorChanged;
    s->color.rgb = color;
    s->bgColorAlpha = alpha;
    s->bgColor.rgb = color;
    s->bgColor.a = alpha;
    s->bgColorDataspace = dataspace;

    registerSurfaceControlForCallback(sc);
+6 −7
Original line number Diff line number Diff line
@@ -226,9 +226,9 @@ struct layer_state_t {
    bool hasBufferChanges() const;

    // Layer hierarchy updates.
    static constexpr uint64_t HIERARCHY_CHANGES = layer_state_t::eBackgroundColorChanged |
            layer_state_t::eLayerChanged | layer_state_t::eRelativeLayerChanged |
            layer_state_t::eReparent;
    static constexpr uint64_t HIERARCHY_CHANGES = layer_state_t::eLayerChanged |
            layer_state_t::eRelativeLayerChanged | layer_state_t::eReparent |
            layer_state_t::eLayerStackChanged;

    // Geometry updates.
    static constexpr uint64_t GEOMETRY_CHANGES = layer_state_t::eBufferCropChanged |
@@ -264,9 +264,8 @@ struct layer_state_t {
    static constexpr uint64_t AFFECTS_CHILDREN = layer_state_t::GEOMETRY_CHANGES |
            layer_state_t::HIERARCHY_CHANGES | layer_state_t::eAlphaChanged |
            layer_state_t::eColorTransformChanged | layer_state_t::eCornerRadiusChanged |
            layer_state_t::eFlagsChanged | layer_state_t::eLayerStackChanged |
            layer_state_t::eTrustedOverlayChanged | layer_state_t::eFrameRateChanged |
            layer_state_t::eFixedTransformHintChanged;
            layer_state_t::eFlagsChanged | layer_state_t::eTrustedOverlayChanged |
            layer_state_t::eFrameRateChanged | layer_state_t::eFixedTransformHintChanged;

    // Changes affecting data sent to input.
    static constexpr uint64_t INPUT_CHANGES = layer_state_t::GEOMETRY_CHANGES |
@@ -333,7 +332,7 @@ struct layer_state_t {

    // The following refer to the alpha, and dataspace, respectively of
    // the background color layer
    float bgColorAlpha;
    half4 bgColor;
    ui::Dataspace bgColorDataspace;

    // A color space agnostic layer means the color of this layer can be
+0 −2
Original line number Diff line number Diff line
@@ -213,9 +213,7 @@ struct LayerFECompositionState {
    float currentSdrHdrRatio = 1.f;
    float desiredSdrHdrRatio = 1.f;

    bool isInternalDisplayOverlay = false;
    gui::CachingHint cachingHint = gui::CachingHint::Enabled;

    virtual ~LayerFECompositionState();

    // Debugging
+2 −2
Original line number Diff line number Diff line
@@ -538,8 +538,8 @@ void Output::ensureOutputLayerIfVisible(sp<compositionengine::LayerFE>& layerFE,
        return;
    }

    bool computeAboveCoveredExcludingOverlays =
            coverage.aboveCoveredLayersExcludingOverlays && !layerFEState->isInternalDisplayOverlay;
    bool computeAboveCoveredExcludingOverlays = coverage.aboveCoveredLayersExcludingOverlays &&
            !layerFEState->outputFilter.toInternalDisplay;

    /*
     * opaqueRegion: area of a surface that is fully opaque.
Loading