surfaceflinger: Add check for number of queued buffers
Pop buffer item from shadow queue only when number of queued buffer items is greater than zero. Change-Id: I039bc133842293c29e3e130efd65f521ef0049c6 CRs-Fixed: 1009466
This commit is contained in:
parent
2ab013db02
commit
52b8462635
@ -1448,11 +1448,16 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions)
|
|||||||
|
|
||||||
// Remove any stale buffers that have been dropped during
|
// Remove any stale buffers that have been dropped during
|
||||||
// updateTexImage
|
// updateTexImage
|
||||||
while (mQueueItems[0].mFrameNumber != currentFrameNumber) {
|
while ((mQueuedFrames > 0) && (mQueueItems[0].mFrameNumber != currentFrameNumber)) {
|
||||||
mQueueItems.removeAt(0);
|
mQueueItems.removeAt(0);
|
||||||
android_atomic_dec(&mQueuedFrames);
|
android_atomic_dec(&mQueuedFrames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mQueuedFrames == 0) {
|
||||||
|
ALOGE("[%s] mQueuedFrames is zero !!", mName.string());
|
||||||
|
return outDirtyRegion;
|
||||||
|
}
|
||||||
|
|
||||||
mQueueItems.removeAt(0);
|
mQueueItems.removeAt(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user