Merge "Fix default wallpaper transition issue" into qt-qpr1-dev

This commit is contained in:
Lucas Dupin
2019-09-06 17:16:23 +00:00
committed by Android (Google) Code Review

View File

@@ -111,7 +111,12 @@ public class ImageWallpaperRenderer implements GLWallpaperRenderer,
mBitmap = mWallpaperManager.getBitmap(); mBitmap = mWallpaperManager.getBitmap();
mWallpaperManager.forgetLoadedWallpaper(); mWallpaperManager.forgetLoadedWallpaper();
if (mBitmap != null) { if (mBitmap != null) {
mSurfaceSize.set(0, 0, mBitmap.getWidth(), mBitmap.getHeight()); float scale = (float) mScissor.height() / mBitmap.getHeight();
int surfaceHeight = Math.max(mScissor.height(), mBitmap.getHeight());
int surfaceWidth = scale > 1f
? Math.round(mBitmap.getWidth() * scale)
: mBitmap.getWidth();
mSurfaceSize.set(0, 0, surfaceWidth, surfaceHeight);
} }
} }
return mBitmap != null; return mBitmap != null;