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

Commit cd4abe68 authored by Vishnu Nair's avatar Vishnu Nair Committed by Android (Google) Code Review
Browse files

Merge "[bbq] always update size if scaling mode changes to non freeze" into udc-dev

parents 7e74d2ca 5b5f6936
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -582,7 +582,8 @@ status_t BLASTBufferQueue::acquireNextBufferLocked(
    // Only update mSize for destination bounds if the incoming buffer matches the requested size.
    // Otherwise, it could cause stretching since the destination bounds will update before the
    // buffer with the new size is acquired.
    if (mRequestedSize == getBufferSize(bufferItem)) {
    if (mRequestedSize == getBufferSize(bufferItem) ||
        bufferItem.mScalingMode != NATIVE_WINDOW_SCALING_MODE_FREEZE) {
        mSize = mRequestedSize;
    }
    Rect crop = computeCrop(bufferItem);
+6 −3
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@
#include <private/gui/ComposerService.h>
#include <private/gui/ComposerServiceAIDL.h>
#include <ui/DisplayMode.h>
#include <ui/DisplayState.h>
#include <ui/GraphicBuffer.h>
#include <ui/GraphicTypes.h>
#include <ui/Transform.h>
@@ -198,11 +199,13 @@ protected:
        t.apply();
        t.clear();

        ui::DisplayMode mode;
        ASSERT_EQ(NO_ERROR, SurfaceComposerClient::getActiveDisplayMode(mDisplayToken, &mode));
        const ui::Size& resolution = mode.resolution;
        ui::DisplayState displayState;
        ASSERT_EQ(NO_ERROR, SurfaceComposerClient::getDisplayState(mDisplayToken, &displayState));
        const ui::Size& resolution = displayState.layerStackSpaceRect;
        mDisplayWidth = resolution.getWidth();
        mDisplayHeight = resolution.getHeight();
        ALOGV("Display: %dx%d orientation:%d", mDisplayWidth, mDisplayHeight,
              displayState.orientation);

        mSurfaceControl = mClient->createSurface(String8("TestSurface"), mDisplayWidth,
                                                 mDisplayHeight, PIXEL_FORMAT_RGBA_8888,