Loading packages/SystemUI/src/com/android/systemui/ImageWallpaper.java +18 −13 Original line number Diff line number Diff line Loading @@ -627,21 +627,12 @@ public class ImageWallpaper extends WallpaperService { } mEglContext = createContext(mEgl, mEglDisplay, mEglConfig); int[] maxSize = new int[1]; Rect frame = surfaceHolder.getSurfaceFrame(); glGetIntegerv(GL_MAX_TEXTURE_SIZE, maxSize, 0); if(frame.width() > maxSize[0] || frame.height() > maxSize[0]) { mEgl.eglDestroyContext(mEglDisplay, mEglContext); mEgl.eglTerminate(mEglDisplay); Log.e(GL_LOG_TAG, "requested texture size " + frame.width() + "x" + frame.height() + " exceeds the support maximum of " + maxSize[0] + "x" + maxSize[0]); return false; if (mEglContext == EGL_NO_CONTEXT) { throw new RuntimeException("createContext failed " + GLUtils.getEGLErrorString(mEgl.eglGetError())); } mEglSurface = mEgl.eglCreateWindowSurface(mEglDisplay, mEglConfig, surfaceHolder, null); if (mEglSurface == null || mEglSurface == EGL_NO_SURFACE) { int error = mEgl.eglGetError(); if (error == EGL_BAD_NATIVE_WINDOW || error == EGL_BAD_ALLOC) { Loading @@ -658,6 +649,20 @@ public class ImageWallpaper extends WallpaperService { GLUtils.getEGLErrorString(mEgl.eglGetError())); } int[] maxSize = new int[1]; Rect frame = surfaceHolder.getSurfaceFrame(); glGetIntegerv(GL_MAX_TEXTURE_SIZE, maxSize, 0); if(frame.width() > maxSize[0] || frame.height() > maxSize[0]) { mEgl.eglDestroySurface(mEglDisplay, mEglSurface); mEgl.eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); mEgl.eglDestroyContext(mEglDisplay, mEglContext); mEgl.eglTerminate(mEglDisplay); Log.e(GL_LOG_TAG, "requested texture size " + frame.width() + "x" + frame.height() + " exceeds the support maximum of " + maxSize[0] + "x" + maxSize[0]); return false; } return true; } Loading Loading
packages/SystemUI/src/com/android/systemui/ImageWallpaper.java +18 −13 Original line number Diff line number Diff line Loading @@ -627,21 +627,12 @@ public class ImageWallpaper extends WallpaperService { } mEglContext = createContext(mEgl, mEglDisplay, mEglConfig); int[] maxSize = new int[1]; Rect frame = surfaceHolder.getSurfaceFrame(); glGetIntegerv(GL_MAX_TEXTURE_SIZE, maxSize, 0); if(frame.width() > maxSize[0] || frame.height() > maxSize[0]) { mEgl.eglDestroyContext(mEglDisplay, mEglContext); mEgl.eglTerminate(mEglDisplay); Log.e(GL_LOG_TAG, "requested texture size " + frame.width() + "x" + frame.height() + " exceeds the support maximum of " + maxSize[0] + "x" + maxSize[0]); return false; if (mEglContext == EGL_NO_CONTEXT) { throw new RuntimeException("createContext failed " + GLUtils.getEGLErrorString(mEgl.eglGetError())); } mEglSurface = mEgl.eglCreateWindowSurface(mEglDisplay, mEglConfig, surfaceHolder, null); if (mEglSurface == null || mEglSurface == EGL_NO_SURFACE) { int error = mEgl.eglGetError(); if (error == EGL_BAD_NATIVE_WINDOW || error == EGL_BAD_ALLOC) { Loading @@ -658,6 +649,20 @@ public class ImageWallpaper extends WallpaperService { GLUtils.getEGLErrorString(mEgl.eglGetError())); } int[] maxSize = new int[1]; Rect frame = surfaceHolder.getSurfaceFrame(); glGetIntegerv(GL_MAX_TEXTURE_SIZE, maxSize, 0); if(frame.width() > maxSize[0] || frame.height() > maxSize[0]) { mEgl.eglDestroySurface(mEglDisplay, mEglSurface); mEgl.eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); mEgl.eglDestroyContext(mEglDisplay, mEglContext); mEgl.eglTerminate(mEglDisplay); Log.e(GL_LOG_TAG, "requested texture size " + frame.width() + "x" + frame.height() + " exceeds the support maximum of " + maxSize[0] + "x" + maxSize[0]); return false; } return true; } Loading