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

Commit fc84e826 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android (Google) Code Review
Browse files

Merge "[317580] fix issue where the screen wouldn't be rotated properly in...

Merge "[317580] fix issue where the screen wouldn't be rotated properly in bypass mode" into gingerbread
parents ce561faf e24cc7a3
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -466,6 +466,18 @@ bool Layer::setBypass(bool enable)
    return true;
    return true;
}
}


void Layer::updateBuffersOrientation()
{
    sp<GraphicBuffer> buffer(getBypassBuffer());
    if (buffer != NULL && mOrientation != buffer->transform) {
        ClientRef::Access sharedClient(mUserClientRef);
        SharedBufferServer* lcblk(sharedClient.get());
        if (lcblk) { // all buffers need reallocation
            lcblk->reallocateAll();
        }
    }
}

uint32_t Layer::doTransaction(uint32_t flags)
uint32_t Layer::doTransaction(uint32_t flags)
{
{
    const Layer::State& front(drawingState());
    const Layer::State& front(drawingState());
+2 −0
Original line number Original line Diff line number Diff line
@@ -83,6 +83,8 @@ public:
    virtual void onRemoved();
    virtual void onRemoved();
    virtual bool setBypass(bool enable);
    virtual bool setBypass(bool enable);


    void updateBuffersOrientation();

    inline sp<GraphicBuffer> getBypassBuffer() const {
    inline sp<GraphicBuffer> getBypassBuffer() const {
        return mBufferManager.getActiveBuffer(); }
        return mBufferManager.getActiveBuffer(); }


+5 −1
Original line number Original line Diff line number Diff line
@@ -725,8 +725,12 @@ void SurfaceFlinger::setBypassLayer(const sp<LayerBase>& layer)
{
{
    // if this layer is already the bypass layer, do nothing
    // if this layer is already the bypass layer, do nothing
    sp<Layer> cur(mBypassLayer.promote());
    sp<Layer> cur(mBypassLayer.promote());
    if (mBypassLayer == layer)
    if (mBypassLayer == layer) {
        if (cur != NULL) {
            cur->updateBuffersOrientation();
        }
        return;
        return;
    }


    // clear the current bypass layer
    // clear the current bypass layer
    mBypassLayer.clear();
    mBypassLayer.clear();