Skip to content

Commit ede4d56

Browse files
mikejurkaAndroid (Google) Code Review
authored andcommitted
Merge "Fix issue where static wallpaper was offset on boot" into jb-dev
2 parents cb94988 + 321357b commit ede4d56

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,16 @@ void drawFrameLocked() {
281281
return;
282282
}
283283

284-
if (mBackgroundWidth < 0 || mBackgroundHeight < 0) {
285-
// If we don't yet know the size of the wallpaper bitmap,
286-
// we need to get it now.
284+
// If we don't yet know the size of the wallpaper bitmap,
285+
// we need to get it now.
286+
boolean updateWallpaper = mBackgroundWidth < 0 || mBackgroundHeight < 0 ;
287+
288+
// If we somehow got to this point after we have last flushed
289+
// the wallpaper, well we really need it to draw again. So
290+
// seems like we need to reload it. Ouch.
291+
updateWallpaper = updateWallpaper || mBackground == null;
292+
293+
if (updateWallpaper) {
287294
updateWallpaperLocked();
288295
}
289296

@@ -308,12 +315,6 @@ void drawFrameLocked() {
308315
mLastXTranslation = xPixels;
309316
mLastYTranslation = yPixels;
310317

311-
if (mBackground == null) {
312-
// If we somehow got to this point after we have last flushed
313-
// the wallpaper, well we really need it to draw again. So
314-
// seems like we need to reload it. Ouch.
315-
updateWallpaperLocked();
316-
}
317318

318319
if (mIsHwAccelerated) {
319320
if (!drawWallpaperWithOpenGL(sh, availw, availh, xPixels, yPixels)) {

0 commit comments

Comments
 (0)