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

Commit 93d120d6 authored by Chia-I Wu's avatar Chia-I Wu Committed by Android (Google) Code Review
Browse files

Merge "surfaceflinger: defer EGLImage creation"

parents 2e6b717e 11f2a9b7
Loading
Loading
Loading
Loading
+0 −13
Original line number Original line Diff line number Diff line
@@ -292,19 +292,6 @@ status_t BufferLayerConsumer::updateAndReleaseLocked(const BufferItem& item,


    int slot = item.mSlot;
    int slot = item.mSlot;


    // Ensure we have a valid EglImageKHR for the slot, creating an EglImage
    // if nessessary, for the gralloc buffer currently in the slot in
    // ConsumerBase.
    // We may have to do this even when item.mGraphicBuffer == NULL (which
    // means the buffer was previously acquired).
    const Rect& imageCrop = canUseImageCrop(item.mCrop) ? item.mCrop : Rect::EMPTY_RECT;
    err = mImages[slot]->createIfNeeded(imageCrop);
    if (err != NO_ERROR) {
        BLC_LOGW("updateAndRelease: unable to createImage on slot=%d", slot);
        releaseBufferLocked(slot, mSlots[slot].mGraphicBuffer);
        return UNKNOWN_ERROR;
    }

    // Do whatever sync ops we need to do before releasing the old slot.
    // Do whatever sync ops we need to do before releasing the old slot.
    if (slot != mCurrentTexture) {
    if (slot != mCurrentTexture) {
        err = syncForReleaseLocked();
        err = syncForReleaseLocked();