aboutsummaryrefslogtreecommitdiffstats
path: root/src/org
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2013-08-20 04:16:08 +0200
committerJorge Ruesga <jorge@ruesga.com>2013-08-20 04:16:08 +0200
commit3b5593668c83fc9990c7c2c9bd3d576c66a0e9d5 (patch)
treeb6aaee402ff0c3d27358a0b62011b3ac2641dcbf /src/org
parent07ed5da642865ee9abb4de11c37df6ed06e65458 (diff)
downloadandroid_packages_wallpapers_PhotoPhase-3b5593668c83fc9990c7c2c9bd3d576c66a0e9d5.tar.gz
android_packages_wallpapers_PhotoPhase-3b5593668c83fc9990c7c2c9bd3d576c66a0e9d5.tar.bz2
android_packages_wallpapers_PhotoPhase-3b5593668c83fc9990c7c2c9bd3d576c66a0e9d5.zip
Let GLES to build its own buffer based on the picture size
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'src/org')
-rw-r--r--src/org/cyanogenmod/wallpapers/photophase/effects/PhotoPhaseEffect.java11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/org/cyanogenmod/wallpapers/photophase/effects/PhotoPhaseEffect.java b/src/org/cyanogenmod/wallpapers/photophase/effects/PhotoPhaseEffect.java
index 7935a79..9b77202 100644
--- a/src/org/cyanogenmod/wallpapers/photophase/effects/PhotoPhaseEffect.java
+++ b/src/org/cyanogenmod/wallpapers/photophase/effects/PhotoPhaseEffect.java
@@ -27,7 +27,6 @@ import org.cyanogenmod.wallpapers.photophase.utils.GLESUtil;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
-import java.nio.IntBuffer;
/**
* An abstract class definition for all the PhotoPhase custom effects
@@ -59,7 +58,6 @@ public abstract class PhotoPhaseEffect extends Effect {
FloatBuffer mTexVertices;
FloatBuffer mPosVertices;
- IntBuffer mTexBuffer;
/**
* An abstract constructor of <code>Effect</code> to follow the rules
@@ -136,12 +134,7 @@ public abstract class PhotoPhaseEffect extends Effect {
// Create a new output texture
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, outputTexId);
GLESUtil.glesCheckError("glBindTexture");
- int bytes = width * height;
- if (mTexBuffer == null || mTexBuffer.capacity() < bytes) {
- mTexBuffer = IntBuffer.wrap(new int[bytes]);
- }
- mTexBuffer.clear();
- GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGB, width, height, 0, GLES20.GL_RGB, GLES20.GL_UNSIGNED_BYTE, mTexBuffer);
+ GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGB, width, height, 0, GLES20.GL_RGB, GLES20.GL_UNSIGNED_BYTE, null);
GLESUtil.glesCheckError("glTexImage2D");
// Set the parameters
@@ -199,7 +192,7 @@ public abstract class PhotoPhaseEffect extends Effect {
* @param inputTexId The input texture
*/
void apply(int inputTexId) {
- // Use our shader program
+ // Use our shader program
GLES20.glUseProgram(mProgram);
GLESUtil.glesCheckError("glUseProgram");