diff options
author | Chih-Chung Chang <chihchung@google.com> | 2010-09-02 19:46:52 +0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2010-09-02 20:18:05 +0800 |
commit | 4170b239567c258ca77650c19d9a51e5fa638bd1 (patch) | |
tree | 864841893363f0b2c5fca883911b69e5f68ddba7 | |
parent | ef50c458c9f9e970e51e3363a46015b69ba2aa6d (diff) | |
download | Gallery3D-4170b239567c258ca77650c19d9a51e5fa638bd1.tar.gz |
Set the unpack alignment before uploading a texture.
Change-Id: I4602535b743fb4695b07837bc0196ee4d205682e
-rw-r--r-- | new3d/src/com/android/gallery3d/ui/GLCanvasImp.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/new3d/src/com/android/gallery3d/ui/GLCanvasImp.java b/new3d/src/com/android/gallery3d/ui/GLCanvasImp.java index a719573..beada90 100644 --- a/new3d/src/com/android/gallery3d/ui/GLCanvasImp.java +++ b/new3d/src/com/android/gallery3d/ui/GLCanvasImp.java @@ -589,6 +589,9 @@ public class GLCanvasImp implements GLCanvas { gl.glEnable(GL11.GL_BLEND); gl.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); + + // We use 565 or 8888 format, so set the alignment to 2 bytes/pixel. + gl.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 2); } public void setTexEnvMode(int mode) { |