Loading services/surfaceflinger/Layer.cpp +27 −30 Original line number Diff line number Diff line Loading @@ -1787,6 +1787,32 @@ bool Layer::isVisible() const { #endif } bool Layer::allTransactionsSignaled() { auto headFrameNumber = getHeadFrameNumber(); bool matchingFramesFound = false; bool allTransactionsApplied = true; Mutex::Autolock lock(mLocalSyncPointMutex); for (auto& point : mLocalSyncPoints) { if (point->getFrameNumber() > headFrameNumber) { break; } matchingFramesFound = true; if (!point->frameIsAvailable()) { // We haven't notified the remote layer that the frame for // this point is available yet. Notify it now, and then // abort this attempt to latch. point->setFrameAvailable(); allTransactionsApplied = false; break; } allTransactionsApplied = allTransactionsApplied && point->transactionIsApplied(); } return !matchingFramesFound || allTransactionsApplied; } Region Layer::latchBuffer(bool& recomputeVisibleRegions) { ATRACE_CALL(); Loading Loading @@ -1830,36 +1856,7 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions) const bool oldOpacity = isOpaque(s); sp<GraphicBuffer> oldActiveBuffer = mActiveBuffer; // Check all of our local sync points to ensure that all transactions // which need to have been applied prior to the frame which is about to // be latched have signaled auto headFrameNumber = getHeadFrameNumber(); bool matchingFramesFound = false; bool allTransactionsApplied = true; { Mutex::Autolock lock(mLocalSyncPointMutex); for (auto& point : mLocalSyncPoints) { if (point->getFrameNumber() > headFrameNumber) { break; } matchingFramesFound = true; if (!point->frameIsAvailable()) { // We haven't notified the remote layer that the frame for // this point is available yet. Notify it now, and then // abort this attempt to latch. point->setFrameAvailable(); allTransactionsApplied = false; break; } allTransactionsApplied &= point->transactionIsApplied(); } } if (matchingFramesFound && !allTransactionsApplied) { if (!allTransactionsSignaled()) { mFlinger->signalLayerUpdate(); return outDirtyRegion; } Loading services/surfaceflinger/Layer.h +5 −0 Original line number Diff line number Diff line Loading @@ -558,6 +558,11 @@ private: // ----------------------------------------------------------------------- // Check all of the local sync points to ensure that all transactions // which need to have been applied prior to the frame which is about to // be latched have signaled bool allTransactionsSignaled(); // constants sp<SurfaceFlingerConsumer> mSurfaceFlingerConsumer; sp<IGraphicBufferProducer> mProducer; Loading Loading
services/surfaceflinger/Layer.cpp +27 −30 Original line number Diff line number Diff line Loading @@ -1787,6 +1787,32 @@ bool Layer::isVisible() const { #endif } bool Layer::allTransactionsSignaled() { auto headFrameNumber = getHeadFrameNumber(); bool matchingFramesFound = false; bool allTransactionsApplied = true; Mutex::Autolock lock(mLocalSyncPointMutex); for (auto& point : mLocalSyncPoints) { if (point->getFrameNumber() > headFrameNumber) { break; } matchingFramesFound = true; if (!point->frameIsAvailable()) { // We haven't notified the remote layer that the frame for // this point is available yet. Notify it now, and then // abort this attempt to latch. point->setFrameAvailable(); allTransactionsApplied = false; break; } allTransactionsApplied = allTransactionsApplied && point->transactionIsApplied(); } return !matchingFramesFound || allTransactionsApplied; } Region Layer::latchBuffer(bool& recomputeVisibleRegions) { ATRACE_CALL(); Loading Loading @@ -1830,36 +1856,7 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions) const bool oldOpacity = isOpaque(s); sp<GraphicBuffer> oldActiveBuffer = mActiveBuffer; // Check all of our local sync points to ensure that all transactions // which need to have been applied prior to the frame which is about to // be latched have signaled auto headFrameNumber = getHeadFrameNumber(); bool matchingFramesFound = false; bool allTransactionsApplied = true; { Mutex::Autolock lock(mLocalSyncPointMutex); for (auto& point : mLocalSyncPoints) { if (point->getFrameNumber() > headFrameNumber) { break; } matchingFramesFound = true; if (!point->frameIsAvailable()) { // We haven't notified the remote layer that the frame for // this point is available yet. Notify it now, and then // abort this attempt to latch. point->setFrameAvailable(); allTransactionsApplied = false; break; } allTransactionsApplied &= point->transactionIsApplied(); } } if (matchingFramesFound && !allTransactionsApplied) { if (!allTransactionsSignaled()) { mFlinger->signalLayerUpdate(); return outDirtyRegion; } Loading
services/surfaceflinger/Layer.h +5 −0 Original line number Diff line number Diff line Loading @@ -558,6 +558,11 @@ private: // ----------------------------------------------------------------------- // Check all of the local sync points to ensure that all transactions // which need to have been applied prior to the frame which is about to // be latched have signaled bool allTransactionsSignaled(); // constants sp<SurfaceFlingerConsumer> mSurfaceFlingerConsumer; sp<IGraphicBufferProducer> mProducer; Loading