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

Commit 51726c38 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android Git Automerger
Browse files

am aa938c8d: Merge "mDirtyRegion is single threaded, but could be accessed...

am aa938c8d: Merge "mDirtyRegion is single threaded, but could be accessed from a hwc thread" into ics-mr0

* commit 'aa938c8d9c0e71c9b556657cb33794210ce6ebf8':
  mDirtyRegion is single threaded, but could be accessed from a hwc thread
parents 3d62b42d 239c0491
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -742,6 +742,8 @@ void SurfaceFlinger::handlePageFlip()
        }

    unlockPageFlip(currentLayers);

    mDirtyRegion.orSelf(getAndClearInvalidateRegion());
    mDirtyRegion.andSelf(screenRegion);
}

@@ -1716,12 +1718,24 @@ status_t SurfaceFlinger::onTransact(
}

void SurfaceFlinger::repaintEverything() {
    Mutex::Autolock _l(mStateLock);
    const DisplayHardware& hw(graphicPlane(0).displayHardware());
    mDirtyRegion.set(hw.bounds());
    const Rect bounds(hw.getBounds());
    setInvalidateRegion(Region(bounds));
    signalEvent();
}

void SurfaceFlinger::setInvalidateRegion(const Region& reg) {
    Mutex::Autolock _l(mInvalidateLock);
    mInvalidateRegion = reg;
}

Region SurfaceFlinger::getAndClearInvalidateRegion() {
    Mutex::Autolock _l(mInvalidateLock);
    Region reg(mInvalidateRegion);
    mInvalidateRegion.clear();
    return reg;
}

// ---------------------------------------------------------------------------

status_t SurfaceFlinger::renderScreenToTexture(DisplayID dpy,
+7 −0
Original line number Diff line number Diff line
@@ -303,6 +303,9 @@ private:
            void        composeSurfaces(const Region& dirty);


            void        setInvalidateRegion(const Region& reg);
            Region      getAndClearInvalidateRegion();

            ssize_t     addClientLayer(const sp<Client>& client,
                    const sp<LayerBaseClient>& lbc);
            status_t    addLayer_l(const sp<LayerBase>& layer);
@@ -348,6 +351,10 @@ private:
                bool                        mLayersRemoved;
                DefaultKeyedVector< wp<IBinder>, wp<Layer> > mLayerMap;

                // access must be protected by mInvalidateLock
    mutable     Mutex                       mInvalidateLock;
                Region                      mInvalidateRegion;

                // constant members (no synchronization needed for access)
                sp<IMemoryHeap>             mServerHeap;
                surface_flinger_cblk_t*     mServerCblk;