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

Commit f797336c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add plumbing for sending stretch effect to SF" into sc-dev am: 1c69780e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/13519705

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I928fe76767b853ac1bf55750207b5e448494b9cb
parents a095e453 1c69780e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -167,6 +167,9 @@ status_t layer_state_t::write(Parcel& output) const
        SAFE_PARCEL(output.writeInt32, region.right);
        SAFE_PARCEL(output.writeInt32, region.bottom);
    }

    SAFE_PARCEL(output.write, stretchEffect);

    return NO_ERROR;
}

@@ -290,6 +293,9 @@ status_t layer_state_t::read(const Parcel& input)
        SAFE_PARCEL(input.readInt32, &region.bottom);
        blurRegions.push_back(region);
    }

    SAFE_PARCEL(input.read, stretchEffect);

    return NO_ERROR;
}

+17 −0
Original line number Diff line number Diff line
@@ -1569,6 +1569,23 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setApply
    return *this;
}

SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setStretchEffect(
        const sp<SurfaceControl>& sc, float left, float top, float right, float bottom, float vecX,
        float vecY, float maxAmount) {
    layer_state_t* s = getLayerState(sc);
    if (!s) {
        mStatus = BAD_INDEX;
        return *this;
    }

    s->what |= layer_state_t::eStretchChanged;
    s->stretchEffect = StretchEffect{.area = {left, top, right, bottom},
                                     .vectorX = vecX,
                                     .vectorY = vecY,
                                     .maxAmount = maxAmount};
    return *this;
}

// ---------------------------------------------------------------------------

DisplayState& SurfaceComposerClient::Transaction::getDisplayState(const sp<IBinder>& token) {
+5 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@
#include <ui/Rect.h>
#include <ui/Region.h>
#include <ui/Rotation.h>
#include <ui/StretchEffect.h>
#include <ui/Transform.h>
#include <utils/Errors.h>

@@ -135,6 +136,7 @@ struct layer_state_t {
        eFrameTimelineInfoChanged = 0x800'00000000,
        eBlurRegionsChanged = 0x1000'00000000,
        eAutoRefreshChanged = 0x2000'00000000,
        eStretchChanged = 0x4000'00000000,
    };

    layer_state_t();
@@ -244,6 +246,9 @@ struct layer_state_t {
    // can and not wait for a frame to become available. This is only relevant
    // in shared buffer mode.
    bool autoRefresh;

    // Stretch effect to be applied to this layer
    StretchEffect stretchEffect;
};

struct ComposerState {
+4 −0
Original line number Diff line number Diff line
@@ -550,6 +550,10 @@ public:
        // transactions from blocking each other.
        Transaction& setApplyToken(const sp<IBinder>& token);

        Transaction& setStretchEffect(const sp<SurfaceControl>& sc, float left, float top,
                                      float right, float bottom, float vecX, float vecY,
                                      float maxAmount);

        status_t setDisplaySurface(const sp<IBinder>& token,
                const sp<IGraphicBufferProducer>& bufferProducer);

+3 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include <ui/GraphicTypes.h>
#include <ui/Rect.h>
#include <ui/Region.h>
#include <ui/StretchEffect.h>
#include <ui/Transform.h>

namespace android {
@@ -155,6 +156,8 @@ struct LayerSettings {

    std::vector<BlurRegion> blurRegions;

    StretchEffect stretchEffect;

    // Name associated with the layer for debugging purposes.
    std::string name;
};
Loading