diff options
author | Romain Guy <romainguy@google.com> | 2012-05-16 20:01:17 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2012-05-16 20:01:17 -0700 |
commit | 4c43f66d06fe7f75ad6f9c860cf0936b8ee36082 (patch) | |
tree | f69a76ff3c0686431b43c0d2600593a00ef59828 /tests/HwAccelerationTest | |
parent | c1c140657633cc5b0ff26da1f122fab305d21e01 (diff) | |
download | frameworks_base-4c43f66d06fe7f75ad6f9c860cf0936b8ee36082.zip frameworks_base-4c43f66d06fe7f75ad6f9c860cf0936b8ee36082.tar.gz frameworks_base-4c43f66d06fe7f75ad6f9c860cf0936b8ee36082.tar.bz2 |
Fix TextureView OpenGL sample
The sample was doing something dumb: instead of binding the texture unit
to the shader's sampler, it was binding the texture name. Oops.
Change-Id: I13450dacbbd2dad362a2573aebb95e8eb87b25f0
Diffstat (limited to 'tests/HwAccelerationTest')
-rw-r--r-- | tests/HwAccelerationTest/src/com/android/test/hwui/GLTextureViewActivity.java | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/GLTextureViewActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/GLTextureViewActivity.java index 414ae0d..0e75b80 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/GLTextureViewActivity.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/GLTextureViewActivity.java @@ -210,28 +210,31 @@ public class GLTextureViewActivity extends Activity implements TextureView.Surfa glEnableVertexAttribArray(attribTexCoords); checkGlError(); - glUniform1i(uniformTexture, texture); + glUniform1i(uniformTexture, 0); + checkGlError(); + + // drawQuad + triangleVertices.position(TRIANGLE_VERTICES_DATA_POS_OFFSET); + glVertexAttribPointer(attribPosition, 3, GL_FLOAT, false, + TRIANGLE_VERTICES_DATA_STRIDE_BYTES, triangleVertices); + checkGlError(); + + triangleVertices.position(TRIANGLE_VERTICES_DATA_UV_OFFSET); + glVertexAttribPointer(attribTexCoords, 3, GL_FLOAT, false, + TRIANGLE_VERTICES_DATA_STRIDE_BYTES, triangleVertices); + checkGlError(); + + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); checkGlError(); while (!mFinished) { checkCurrent(); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - checkGlError(); - glClear(GL_COLOR_BUFFER_BIT); checkGlError(); - // drawQuad - triangleVertices.position(TRIANGLE_VERTICES_DATA_POS_OFFSET); - glVertexAttribPointer(attribPosition, 3, GL_FLOAT, false, - TRIANGLE_VERTICES_DATA_STRIDE_BYTES, triangleVertices); - - triangleVertices.position(TRIANGLE_VERTICES_DATA_UV_OFFSET); - glVertexAttribPointer(attribTexCoords, 3, GL_FLOAT, false, - TRIANGLE_VERTICES_DATA_STRIDE_BYTES, triangleVertices); - glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + checkGlError(); if (!mEgl.eglSwapBuffers(mEglDisplay, mEglSurface)) { throw new RuntimeException("Cannot swap buffers"); |