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

Commit b13d74b8 authored by Alec Mouri's avatar Alec Mouri Committed by android-build-merger
Browse files

Merge "Respect crop scaling mode for texture transforms in BufferLayerConsumer" am: 4812c1b9

am: 6a84a712

Change-Id: Iabf3967a876a66750e5b0a104db0f655dada8c38
parents af0435dc 6a84a712
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -435,7 +435,9 @@ void BufferLayerConsumer::computeCurrentTransformMatrixLocked() {
        BLC_LOGD("computeCurrentTransformMatrixLocked: "
                 "mCurrentTextureImage is nullptr");
    }
    const Rect& cropRect = canUseImageCrop(mCurrentCrop) ? Rect::EMPTY_RECT : mCurrentCrop;

    const Rect& currentCrop = getCurrentCropLocked();
    const Rect& cropRect = canUseImageCrop(currentCrop) ? Rect::EMPTY_RECT : currentCrop;
    GLConsumer::computeTransformMatrix(mCurrentTransformMatrix, buf, cropRect, mCurrentTransform,
                                       mFilteringEnabled);
}
@@ -490,6 +492,10 @@ sp<GraphicBuffer> BufferLayerConsumer::getCurrentBuffer(int* outSlot) const {

Rect BufferLayerConsumer::getCurrentCrop() const {
    Mutex::Autolock lock(mMutex);
    return getCurrentCropLocked();
}

Rect BufferLayerConsumer::getCurrentCropLocked() const {
    return (mCurrentScalingMode == NATIVE_WINDOW_SCALING_MODE_SCALE_CROP)
            ? GLConsumer::scaleDownCrop(mCurrentCrop, mDefaultWidth, mDefaultHeight)
            : mCurrentCrop;
+3 −0
Original line number Diff line number Diff line
@@ -274,6 +274,9 @@ private:
    // mCurrentTextureImage must not be nullptr.
    void computeCurrentTransformMatrixLocked();

    // See getCurrentCrop, but with mMutex already held.
    Rect getCurrentCropLocked() const;

    // doFenceWaitLocked inserts a wait command into the RenderEngine command
    // stream to ensure that it is safe for future RenderEngine commands to
    // access the current texture buffer.