diff options
author | Yuli Huang <yuli@google.com> | 2011-10-11 21:23:22 +0800 |
---|---|---|
committer | Yuli Huang <yuli@google.com> | 2011-10-12 17:02:27 +0800 |
commit | 80481cb46180021abe0f3cf959dacca2519b9c53 (patch) | |
tree | e7b9bb866f2375d1dcc303f860a3b5da00edf84f /src/com/android/gallery3d/photoeditor/RendererUtils.java | |
parent | c2c9df91a8f9b35d18d43593d75f65b78e6bfc38 (diff) | |
download | android_packages_apps_Snap-80481cb46180021abe0f3cf959dacca2519b9c53.tar.gz android_packages_apps_Snap-80481cb46180021abe0f3cf959dacca2519b9c53.tar.bz2 android_packages_apps_Snap-80481cb46180021abe0f3cf959dacca2519b9c53.zip |
Fix b/5392171 and b/5389281.
1. Fix b/5392171 by moving effect context creation into Filter to make
sure it'd be created when needed.
2. Revise the fix for b/5389281 by clearing surface background even
there's no photo.
Change-Id: I212a552291c7df28b75a909bf6560634ba061e9f
Diffstat (limited to 'src/com/android/gallery3d/photoeditor/RendererUtils.java')
-rw-r--r-- | src/com/android/gallery3d/photoeditor/RendererUtils.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/photoeditor/RendererUtils.java b/src/com/android/gallery3d/photoeditor/RendererUtils.java index a0cd5982d..ff593d4ef 100644 --- a/src/com/android/gallery3d/photoeditor/RendererUtils.java +++ b/src/com/android/gallery3d/photoeditor/RendererUtils.java @@ -174,6 +174,11 @@ public class RendererUtils { context.posVertices = createVerticesBuffer(vertices); } + public static void renderBackground() { + GLES20.glClearColor(0, 0, 0, 1); + GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT); + } + public static void renderTexture( RenderContext context, int texture, int viewWidth, int viewHeight) { // Use our shader program @@ -204,8 +209,6 @@ public class RendererUtils { GLES20.glUniform1i(context.texSamplerHandle, 0); // Draw! - GLES20.glClearColor(0, 0, 0, 1); - GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT); GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4); } |