Loading core/java/com/android/internal/service/wallpaper/ImageWallpaper.java +26 −23 Original line number Original line Diff line number Diff line Loading @@ -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(); Loading @@ -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); Loading Loading
core/java/com/android/internal/service/wallpaper/ImageWallpaper.java +26 −23 Original line number Original line Diff line number Diff line Loading @@ -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(); Loading @@ -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); Loading