diff options
author | Jorge Ruesga <jorge@ruesga.com> | 2014-09-10 23:52:05 +0200 |
---|---|---|
committer | Jorge Ruesga <jorge@ruesga.com> | 2014-09-14 10:52:53 +0200 |
commit | faa982e7beda54bf28e0dbf1488428093bbbf485 (patch) | |
tree | fe23f0f6c899f2b93da12c789a529564054a107e /src/org/cyanogenmod/wallpapers/photophase/effects | |
parent | 94c617a88428b64dfd486f4a3ed28547e09ef9c8 (diff) | |
download | android_packages_wallpapers_PhotoPhase-faa982e7beda54bf28e0dbf1488428093bbbf485.tar.gz android_packages_wallpapers_PhotoPhase-faa982e7beda54bf28e0dbf1488428093bbbf485.tar.bz2 android_packages_wallpapers_PhotoPhase-faa982e7beda54bf28e0dbf1488428093bbbf485.zip |
photophase: use etc1 compression when available
When avaliable this help to decrease the memory footprint. ETC1 compression
requieres to:
- be supported by opengl
- picture couldn't have an alpha channel
- compression times shouldn't be too higher (< 1000 ms)
- initial pictures doesn't be compressed (to speed up boot)
Change-Id: I87e41db3ca7f2ccb82d4af2763609f11d7e67121
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'src/org/cyanogenmod/wallpapers/photophase/effects')
-rw-r--r-- | src/org/cyanogenmod/wallpapers/photophase/effects/PhotoPhaseEffect.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/org/cyanogenmod/wallpapers/photophase/effects/PhotoPhaseEffect.java b/src/org/cyanogenmod/wallpapers/photophase/effects/PhotoPhaseEffect.java index 0900322..bbfb2bc 100644 --- a/src/org/cyanogenmod/wallpapers/photophase/effects/PhotoPhaseEffect.java +++ b/src/org/cyanogenmod/wallpapers/photophase/effects/PhotoPhaseEffect.java @@ -158,12 +158,14 @@ public abstract class PhotoPhaseEffect extends Effect { mIdentityEffect.apply(inputTexId, width, height, outputTexId); // Create the framebuffer - GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20. GL_TEXTURE_2D, outputTexId, 0); + GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, + GLES20. GL_TEXTURE_2D, outputTexId, 0); GLESUtil.glesCheckError("glFramebufferTexture2D"); // Check if the buffer was built successfully - if (GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER) != GLES20.GL_FRAMEBUFFER_COMPLETE) { - // Something when wrong. Throw an exception + final int status = GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER); + if (status != GLES20.GL_FRAMEBUFFER_COMPLETE) { + // Something was wrong. Throw an exception GLESUtil.glesCheckError("glCheckFramebufferStatus"); int error = GLES20.glGetError(); throw new android.opengl.GLException(error, GLUtils.getEGLErrorString(error)); |