Bug 1166981 - Decode images in LIFO order. r=tn

This commit is contained in:
Seth Fowler 2015-06-24 11:37:59 -07:00
parent bd635e2c8a
commit 4a89c186ce

View File

@ -217,11 +217,6 @@ public:
MonitorAutoLock lock(mMonitor);
do {
// XXX(seth): The queue popping code below is NOT efficient, obviously,
// since we're removing an element from the front of the array. However,
// it's not worth implementing something better right now, because we are
// replacing this FIFO behavior with LIFO behavior very soon.
// Prioritize size decodes over full decodes.
if (!mSizeDecodeQueue.IsEmpty()) {
return PopWorkFromQueue(mSizeDecodeQueue);
@ -249,8 +244,8 @@ private:
{
Work work;
work.mType = Work::Type::DECODE;
work.mDecoder = aQueue.ElementAt(0);
aQueue.RemoveElementAt(0);
work.mDecoder = aQueue.LastElement();
aQueue.RemoveElementAt(aQueue.Length() - 1);
return work;
}