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

Commit 9675c86a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "SF: replicate mSidebandStream in LayerBE"

parents 8955cb94 386c22e7
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ bool BufferLayer::isProtected() const {

bool BufferLayer::isVisible() const {
    return !(isHiddenByPolicy()) && getAlpha() > 0.0f &&
            (mActiveBuffer != NULL || mSidebandStream != NULL);
            (mActiveBuffer != NULL || getBE().mSidebandStream != NULL);
}

bool BufferLayer::isFixedSize() const {
@@ -385,7 +385,9 @@ Region BufferLayer::latchBuffer(bool& recomputeVisibleRegions, nsecs_t latchTime
    if (android_atomic_acquire_cas(true, false, &mSidebandStreamChanged) == 0) {
        // mSidebandStreamChanged was true
        mSidebandStream = mSurfaceFlingerConsumer->getSidebandStream();
        if (mSidebandStream != NULL) {
        // replicated in LayerBE until FE/BE is ready to be synchronized
        getBE().mSidebandStream = mSidebandStream;
        if (getBE().mSidebandStream != NULL) {
            setTransactionFlags(eTransactionNeeded);
            mFlinger->setTransactionFlags(eTraversalNeeded);
        }
@@ -606,13 +608,13 @@ void BufferLayer::setPerFrameData(const sp<const DisplayDevice>& displayDevice)
    }

    // Sideband layers
    if (mSidebandStream.get()) {
    if (getBE().mSidebandStream.get()) {
        setCompositionType(hwcId, HWC2::Composition::Sideband);
        ALOGV("[%s] Requesting Sideband composition", mName.string());
        error = hwcLayer->setSidebandStream(mSidebandStream->handle());
        error = hwcLayer->setSidebandStream(getBE().mSidebandStream->handle());
        if (error != HWC2::Error::None) {
            ALOGE("[%s] Failed to set sideband stream %p: %s (%d)", mName.string(),
                  mSidebandStream->handle(), to_string(error).c_str(),
                  getBE().mSidebandStream->handle(), to_string(error).c_str(),
                  static_cast<int32_t>(error));
        }
        return;
@@ -651,7 +653,7 @@ void BufferLayer::setPerFrameData(const sp<const DisplayDevice>& displayDevice)
bool BufferLayer::isOpaque(const Layer::State& s) const {
    // if we don't have a buffer or sidebandStream yet, we're translucent regardless of the
    // layer's opaque flag.
    if ((mSidebandStream == nullptr) && (mActiveBuffer == nullptr)) {
    if ((getBE().mSidebandStream == nullptr) && (mActiveBuffer == nullptr)) {
        return false;
    }

+1 −1
Original line number Diff line number Diff line
@@ -1002,7 +1002,7 @@ uint32_t Layer::doTransaction(uint32_t flags) {
    const bool resizePending = ((c.requested.w != c.active.w) || (c.requested.h != c.active.h)) &&
            (mActiveBuffer != nullptr);
    if (!isFixedSize()) {
        if (resizePending && mSidebandStream == NULL) {
        if (resizePending && getBE().mSidebandStream == NULL) {
            flags |= eDontUpdateGeometryState;
        }
    }
+2 −0
Original line number Diff line number Diff line
@@ -73,6 +73,8 @@ class LayerBE {
public:
    LayerBE();

    sp<NativeHandle> mSidebandStream;

    // The mesh used to draw the layer in GLES composition mode
    Mesh mMesh;