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

Commit 582a3944 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Fix a regression in the wallpaper drawing." into honeycomb

parents 77ddb026 033f63a1
Loading
Loading
Loading
Loading
+26 −23
Original line number Original line Diff line number Diff line
@@ -187,9 +187,6 @@ public class ImageWallpaper extends WallpaperService {
            }
            }


            SurfaceHolder sh = getSurfaceHolder();
            SurfaceHolder sh = getSurfaceHolder();
            Canvas c = sh.lockCanvas();
            if (c != null) {
                try {
            final Rect frame = sh.getSurfaceFrame();
            final Rect frame = sh.getSurfaceFrame();
            final Drawable background = mBackground;
            final Drawable background = mBackground;
            final int dw = frame.width();
            final int dw = frame.width();
@@ -202,19 +199,25 @@ public class ImageWallpaper extends WallpaperService {
            int yPixels = availh < 0 ? (int)(availh * mYOffset + .5f) : (availh / 2);
            int yPixels = availh < 0 ? (int)(availh * mYOffset + .5f) : (availh / 2);


            mOffsetsChanged = false;
            mOffsetsChanged = false;
                    if (!mRedrawNeeded) {
            if (!mRedrawNeeded
                        if (xPixels == mLastXTranslation && yPixels == mLastYTranslation) {
                    && xPixels == mLastXTranslation && yPixels == mLastYTranslation) {
                if (DEBUG) {
                if (DEBUG) {
                    Log.d(TAG, "Suppressed drawFrame since the image has not "
                    Log.d(TAG, "Suppressed drawFrame since the image has not "
                            + "actually moved an integral number of pixels.");
                            + "actually moved an integral number of pixels.");
                }
                }
                return;
                return;
            }
            }
                    }
            mRedrawNeeded = false;
            mRedrawNeeded = false;
            mLastXTranslation = xPixels;
            mLastXTranslation = xPixels;
            mLastYTranslation = yPixels;
            mLastYTranslation = yPixels;


            Canvas c = sh.lockCanvas();
            if (c != null) {
                try {
                    if (DEBUG) {
                        Log.d(TAG, "Redrawing: xPixels=" + xPixels + ", yPixels=" + yPixels);
                    }

                    c.translate(xPixels, yPixels);
                    c.translate(xPixels, yPixels);
                    if (availw < 0 || availh < 0) {
                    if (availw < 0 || availh < 0) {
                        c.save(Canvas.CLIP_SAVE_FLAG);
                        c.save(Canvas.CLIP_SAVE_FLAG);