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

Commit ac61530c authored by Aurélien Pomini's avatar Aurélien Pomini Committed by Android (Google) Code Review
Browse files

Merge "Load and draw bitmap only once with ImageWallpaper" into udc-qpr-dev

parents 6e178a6d 11514a90
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ public class ImageWallpaper extends WallpaperService {
        private WallpaperManager mWallpaperManager;
        private final WallpaperLocalColorExtractor mWallpaperLocalColorExtractor;
        private SurfaceHolder mSurfaceHolder;
        private boolean mDrawn = false;
        @VisibleForTesting
        static final int MIN_SURFACE_WIDTH = 128;
        @VisibleForTesting
@@ -238,6 +239,7 @@ public class ImageWallpaper extends WallpaperService {

        private void drawFrameSynchronized() {
            synchronized (mLock) {
                if (mDrawn) return;
                drawFrameInternal();
            }
        }
@@ -275,6 +277,7 @@ public class ImageWallpaper extends WallpaperService {
                Rect dest = mSurfaceHolder.getSurfaceFrame();
                try {
                    canvas.drawBitmap(bitmap, null, dest, null);
                    mDrawn = true;
                } finally {
                    surface.unlockCanvasAndPost(canvas);
                }