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

Commit b2694cc3 authored by Riley Andrews's avatar Riley Andrews
Browse files

Make return of screenshotApplications an ashmem immutable bitmap.

Bug 21037890
Change-Id: I47a2ba11d26ec03a6e2e847f5af61b44efa2aa69
parent 721ae5fe
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -6380,10 +6380,9 @@ public class WindowManagerService extends IWindowManager.Stub
            }
        }

        // Copy the screenshot bitmap to another buffer so that the gralloc backed
        // bitmap will not have a long lifetime. Gralloc memory can be pinned or
        // duplicated and might have a higher cost than a skia backed buffer.
        Bitmap ret = bm.copy(bm.getConfig(),true);
        // Create a copy of the screenshot that is immutable and backed in ashmem.
        // This greatly reduces the overhead of passing the bitmap between processes.
        Bitmap ret = bm.createAshmemBitmap();
        bm.recycle();
        return ret;
    }