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

Commit 4812c1b9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Respect crop scaling mode for texture transforms in BufferLayerConsumer"

parents a9ed1a64 bc566da9
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -435,7 +435,9 @@ void BufferLayerConsumer::computeCurrentTransformMatrixLocked() {
        BLC_LOGD("computeCurrentTransformMatrixLocked: "
        BLC_LOGD("computeCurrentTransformMatrixLocked: "
                 "mCurrentTextureImage is nullptr");
                 "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,
    GLConsumer::computeTransformMatrix(mCurrentTransformMatrix, buf, cropRect, mCurrentTransform,
                                       mFilteringEnabled);
                                       mFilteringEnabled);
}
}
@@ -490,6 +492,10 @@ sp<GraphicBuffer> BufferLayerConsumer::getCurrentBuffer(int* outSlot) const {


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

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


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

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