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

Commit f904939a authored by nicolasroard's avatar nicolasroard
Browse files

Fix draw cache issue

Change-Id: Ib61dfb7763b929c9e51853da21031adcd16004d6
parent 75f5e650
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -49,8 +49,21 @@ public class BitmapCache {
            list = new ArrayList<WeakReference<Bitmap>>();
            mBitmapCache.put(key, list);
        }
        int i = 0;
        while (i < list.size()) {
            if (list.get(i).get() == null) {
                list.remove(i);
            } else {
                i++;
            }
        }
        for (i = 0; i < list.size(); i++) {
            if (list.get(i).get() == null) {
                list.remove(i);
            }
        }
        if (list.size() < mMaxItemsPerKey) {
            for (int i = 0; i < list.size(); i++) {
            for (i = 0; i < list.size(); i++) {
                WeakReference<Bitmap> ref = list.get(i);
                if (ref.get() == bitmap) {
                    return; // bitmap already in the cache
+0 −1
Original line number Diff line number Diff line
@@ -349,7 +349,6 @@ public class CachingPipeline implements PipelineInterface {
        }
        setupEnvironment(preset, false);
        Vector<FilterRepresentation> filters = preset.getFilters();
        mEnvironment.cache(buffer.getProducer()); // the producer bitmap isn't needed anymore
        Bitmap result = mCachedProcessing.process(mOriginalBitmap, filters, mEnvironment);
        buffer.setProducer(result);
    }