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

Commit 9b53c23f authored by Danny Baumann's avatar Danny Baumann
Browse files

Refresh whole screen after changing render effect.

Previously, when applying render effects, parts of the screen that were
not refreshed as part of the setting procedure (such as the status bar)
didn't get the render effect applied, which looked ugly.
parent d559580d
Loading
Loading
Loading
Loading
+23 −14
Original line number Diff line number Diff line
@@ -1552,6 +1552,14 @@ status_t SurfaceFlinger::dump(int fd, const Vector<String16>& args)
    return NO_ERROR;
}

void SurfaceFlinger::triggerScreenRepaint()
{
    Mutex::Autolock _l(mStateLock);
    const DisplayHardware& hw(graphicPlane(0).displayHardware());
    mDirtyRegion.set(hw.bounds()); // careful that's not thread-safe
    signalEvent();
}

status_t SurfaceFlinger::onTransact(
    uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
@@ -1617,10 +1625,7 @@ status_t SurfaceFlinger::onTransact(
                mDebugBackground = n ? 1 : 0;
                return NO_ERROR;
            case 1004:{ // repaint everything
                Mutex::Autolock _l(mStateLock);
                const DisplayHardware& hw(graphicPlane(0).displayHardware());
                mDirtyRegion.set(hw.bounds()); // careful that's not thread-safe
                signalEvent();
                triggerScreenRepaint();
                return NO_ERROR;
            }
            case 1005:{ // force transaction
@@ -1651,18 +1656,22 @@ status_t SurfaceFlinger::onTransact(
            case 1014: { // RENDER_EFFECT
                // TODO: filter to only allow valid effects
                mRenderEffect = data.readInt32();
                triggerScreenRepaint();
                return NO_ERROR;
            }
            case 1015: { // RENDER_COLOR_RED
                mRenderColorR = data.readInt32();
                triggerScreenRepaint();
                return NO_ERROR;
            }
            case 1016: { // RENDER_COLOR_GREEN
                mRenderColorG = data.readInt32();
                triggerScreenRepaint();
                return NO_ERROR;
            }
            case 1017: { // RENDER_COLOR_BLUE
                mRenderColorB = data.readInt32();
                triggerScreenRepaint();
                return NO_ERROR;
            }
            return NO_ERROR;
+1 −1
Original line number Diff line number Diff line
@@ -376,7 +376,7 @@ private:
            void        debugFlashRegions();
            void        debugShowFPS() const;
            void        drawWormhole() const;
           
            void        triggerScreenRepaint();

    mutable     MessageQueue    mEventQueue;