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

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

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

parents 9ae031a6 2ee0dda9
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -323,7 +323,8 @@ void BufferLayerConsumer::computeCurrentTransformMatrixLocked() {
                                       mCurrentTextureBuffer == nullptr
                                               ? nullptr
                                               : mCurrentTextureBuffer->graphicBuffer(),
                                       mCurrentCrop, mCurrentTransform, mFilteringEnabled);
                                       getCurrentCropLocked(), mCurrentTransform,
                                       mFilteringEnabled);
}

nsecs_t BufferLayerConsumer::getTimestamp() {
@@ -380,6 +381,10 @@ sp<GraphicBuffer> BufferLayerConsumer::getCurrentBuffer(int* outSlot, sp<Fence>*

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
@@ -253,6 +253,9 @@ private:
    // access the current texture buffer.
    status_t doFenceWaitLocked() const;

    // getCurrentCropLocked returns the cropping rectangle of the current buffer.
    Rect getCurrentCropLocked() const;

    // The default consumer usage flags that BufferLayerConsumer always sets on its
    // BufferQueue instance; these will be OR:d with any additional flags passed
    // from the BufferLayerConsumer user. In particular, BufferLayerConsumer will always