Loading packages/SystemUI/src/com/android/systemui/ImageWallpaper.java +90 −84 Original line number Diff line number Diff line Loading @@ -174,7 +174,7 @@ public class ImageWallpaper extends WallpaperService { public void trimMemory(int level) { if (level >= ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW && mBackground != null && mIsHwAccelerated) { mBackground != null) { if (DEBUG) { Log.d(TAG, "trimMemory"); } Loading Loading @@ -212,6 +212,7 @@ public class ImageWallpaper extends WallpaperService { unregisterReceiver(mReceiver); } mBackground = null; mWallpaperManager.forgetLoadedWallpaper(); } void updateSurfaceSize(SurfaceHolder surfaceHolder) { Loading Loading @@ -337,6 +338,7 @@ public class ImageWallpaper extends WallpaperService { } void drawFrame() { try { int newRotation = ((WindowManager) getSystemService(WINDOW_SERVICE)). getDefaultDisplay().getRotation(); Loading @@ -351,7 +353,8 @@ public class ImageWallpaper extends WallpaperService { final Rect frame = sh.getSurfaceFrame(); final int dw = frame.width(); final int dh = frame.height(); boolean surfaceDimensionsChanged = dw != mLastSurfaceWidth || dh != mLastSurfaceHeight; boolean surfaceDimensionsChanged = dw != mLastSurfaceWidth || dh != mLastSurfaceHeight; boolean redrawNeeded = surfaceDimensionsChanged || newRotation != mLastRotation; if (!redrawNeeded && !mOffsetsChanged) { Loading Loading @@ -402,8 +405,10 @@ public class ImageWallpaper extends WallpaperService { // will remain unchanged final int availwUnscaled = dw - mBackground.getWidth(); final int availhUnscaled = dh - mBackground.getHeight(); if (availwUnscaled < 0) xPixels += (int)(availwUnscaled * (mXOffset - .5f) + .5f); if (availhUnscaled < 0) yPixels += (int)(availhUnscaled * (mYOffset - .5f) + .5f); if (availwUnscaled < 0) xPixels += (int) (availwUnscaled * (mXOffset - .5f) + .5f); if (availhUnscaled < 0) yPixels += (int) (availhUnscaled * (mYOffset - .5f) + .5f); mOffsetsChanged = false; mRedrawNeeded = false; Loading Loading @@ -431,17 +436,18 @@ public class ImageWallpaper extends WallpaperService { } } else { drawWallpaperWithCanvas(sh, availw, availh, xPixels, yPixels); if (FIXED_SIZED_SURFACE) { } } finally { if (FIXED_SIZED_SURFACE && !mIsHwAccelerated) { // If the surface is fixed-size, we should only need to // draw it once and then we'll let the window manager // position it appropriately. As such, we no longer needed // the loaded bitmap. Yay! // hw-accelerated path retains bitmap for faster rotation // hw-accelerated renderer retains bitmap for faster rotation mBackground = null; mWallpaperManager.forgetLoadedWallpaper(); } } } private void updateWallpaperLocked() { Loading Loading
packages/SystemUI/src/com/android/systemui/ImageWallpaper.java +90 −84 Original line number Diff line number Diff line Loading @@ -174,7 +174,7 @@ public class ImageWallpaper extends WallpaperService { public void trimMemory(int level) { if (level >= ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW && mBackground != null && mIsHwAccelerated) { mBackground != null) { if (DEBUG) { Log.d(TAG, "trimMemory"); } Loading Loading @@ -212,6 +212,7 @@ public class ImageWallpaper extends WallpaperService { unregisterReceiver(mReceiver); } mBackground = null; mWallpaperManager.forgetLoadedWallpaper(); } void updateSurfaceSize(SurfaceHolder surfaceHolder) { Loading Loading @@ -337,6 +338,7 @@ public class ImageWallpaper extends WallpaperService { } void drawFrame() { try { int newRotation = ((WindowManager) getSystemService(WINDOW_SERVICE)). getDefaultDisplay().getRotation(); Loading @@ -351,7 +353,8 @@ public class ImageWallpaper extends WallpaperService { final Rect frame = sh.getSurfaceFrame(); final int dw = frame.width(); final int dh = frame.height(); boolean surfaceDimensionsChanged = dw != mLastSurfaceWidth || dh != mLastSurfaceHeight; boolean surfaceDimensionsChanged = dw != mLastSurfaceWidth || dh != mLastSurfaceHeight; boolean redrawNeeded = surfaceDimensionsChanged || newRotation != mLastRotation; if (!redrawNeeded && !mOffsetsChanged) { Loading Loading @@ -402,8 +405,10 @@ public class ImageWallpaper extends WallpaperService { // will remain unchanged final int availwUnscaled = dw - mBackground.getWidth(); final int availhUnscaled = dh - mBackground.getHeight(); if (availwUnscaled < 0) xPixels += (int)(availwUnscaled * (mXOffset - .5f) + .5f); if (availhUnscaled < 0) yPixels += (int)(availhUnscaled * (mYOffset - .5f) + .5f); if (availwUnscaled < 0) xPixels += (int) (availwUnscaled * (mXOffset - .5f) + .5f); if (availhUnscaled < 0) yPixels += (int) (availhUnscaled * (mYOffset - .5f) + .5f); mOffsetsChanged = false; mRedrawNeeded = false; Loading Loading @@ -431,17 +436,18 @@ public class ImageWallpaper extends WallpaperService { } } else { drawWallpaperWithCanvas(sh, availw, availh, xPixels, yPixels); if (FIXED_SIZED_SURFACE) { } } finally { if (FIXED_SIZED_SURFACE && !mIsHwAccelerated) { // If the surface is fixed-size, we should only need to // draw it once and then we'll let the window manager // position it appropriately. As such, we no longer needed // the loaded bitmap. Yay! // hw-accelerated path retains bitmap for faster rotation // hw-accelerated renderer retains bitmap for faster rotation mBackground = null; mWallpaperManager.forgetLoadedWallpaper(); } } } private void updateWallpaperLocked() { Loading