diff options
author | Owen Lin <owenlin@google.com> | 2010-05-12 15:43:14 +0800 |
---|---|---|
committer | Owen Lin <owenlin@google.com> | 2010-05-17 17:59:51 +0800 |
commit | e4caca202b8dbec941a900bf470534ffc0436ce1 (patch) | |
tree | 8fe8c9b7efdb14d8aa6201a0e26d2fd736a6662a /src/com/android/camera/ui/Texture.java | |
parent | 1d6a68e92f1d0e86826eb7af9c31c37f43925f69 (diff) | |
download | LegacyCamera-e4caca202b8dbec941a900bf470534ffc0436ce1.zip LegacyCamera-e4caca202b8dbec941a900bf470534ffc0436ce1.tar.gz LegacyCamera-e4caca202b8dbec941a900bf470534ffc0436ce1.tar.bz2 |
Using GL to draw NinePatch
Change-Id: I2aa92bba691cbfde75523c196a880d0e18eeaba4
Diffstat (limited to 'src/com/android/camera/ui/Texture.java')
-rw-r--r-- | src/com/android/camera/ui/Texture.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/camera/ui/Texture.java b/src/com/android/camera/ui/Texture.java index 4450720..ba3a3d2 100644 --- a/src/com/android/camera/ui/Texture.java +++ b/src/com/android/camera/ui/Texture.java @@ -42,8 +42,8 @@ abstract class Texture { protected int mWidth = UNSPECIFIED; protected int mHeight = UNSPECIFIED; - private int mTextureWidth; - private int mTextureHeight; + protected int mTextureWidth; + protected int mTextureHeight; protected Texture(GL11 gl, int id, int state) { mGL = gl; @@ -101,7 +101,9 @@ abstract class Texture { try { // Define a vertically flipped crop rectangle for // OES_draw_texture. - int[] cropRect = {0, mHeight, mWidth, - mHeight}; + int width = bitmap.getWidth(); + int height = bitmap.getHeight(); + int[] cropRect = {0, height, width, -height}; // Upload the bitmap to a new texture. gl.glGenTextures(1, textureId, 0); @@ -117,8 +119,6 @@ abstract class Texture { gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); - int width = bitmap.getWidth(); - int height = bitmap.getHeight(); int widthExt = Util.nextPowerOf2(width); int heightExt = Util.nextPowerOf2(height); int format = GLUtils.getInternalFormat(bitmap); |