Skip to content

Commit 2b1bcca

Browse files
author
SangWook Han
committed
ImageWallpaper : get bitmap width before calc screen offset
Inside drawFrameLocked, updateWallpaperLocked() is called after calculae drawing offset using mBackgroundWidth/Height. Because mBackgroundWidth/Height is modified inside updateWallpaperLocked(), it sould be called before Mbackgroundwidth/Height is used. Many market launcher and some phone vendor launcher call suggestDesiredDimenstions with argument (w,h) instead aosp's original (w*2,h) for single page wallpaper. In that case, when launcher orientation changed, ImageWallpaper does not properly display wallpaper image and mostly you can see Black Edge at left. Change-Id: I93ebc4337b01f73d3154346943afa4afd6b1988a
1 parent a081c7b commit 2b1bcca

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/SystemUI/src/com/android/systemui/ImageWallpaper.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,13 @@ void drawFrameLocked() {
282282
updateWallpaperLocked();
283283
}
284284

285+
if (mBackground == null) {
286+
// If we somehow got to this point after we have last flushed
287+
// the wallpaper, well we really need it to draw again. So
288+
// seems like we need to reload it. Ouch.
289+
updateWallpaperLocked();
290+
}
291+
285292
SurfaceHolder sh = getSurfaceHolder();
286293
final Rect frame = sh.getSurfaceFrame();
287294
final int dw = frame.width();
@@ -303,13 +310,6 @@ void drawFrameLocked() {
303310
mLastXTranslation = xPixels;
304311
mLastYTranslation = yPixels;
305312

306-
if (mBackground == null) {
307-
// If we somehow got to this point after we have last flushed
308-
// the wallpaper, well we really need it to draw again. So
309-
// seems like we need to reload it. Ouch.
310-
updateWallpaperLocked();
311-
}
312-
313313
if (mIsHwAccelerated) {
314314
if (!drawWallpaperWithOpenGL(sh, availw, availh, xPixels, yPixels)) {
315315
drawWallpaperWithCanvas(sh, availw, availh, xPixels, yPixels);

0 commit comments

Comments
 (0)