summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/panorama/MosaicRendererSurfaceViewRenderer.java
diff options
context:
space:
mode:
authormbansal <mayank.bansal@sri.com>2011-08-02 11:31:28 -0400
committerWei-Ta Chen <weita@google.com>2011-08-05 17:20:40 -0700
commiteeb94d4de94bfd4e01f3a716803f77a530f5b92c (patch)
tree4a458d58afaccb39aa26a23ae1cd4f403c5f0bc7 /src/com/android/camera/panorama/MosaicRendererSurfaceViewRenderer.java
parent178f4d6d1f20bb5fe7f714448cac9910c2c18c1f (diff)
downloadLegacyCamera-eeb94d4de94bfd4e01f3a716803f77a530f5b92c.zip
LegacyCamera-eeb94d4de94bfd4e01f3a716803f77a530f5b92c.tar.gz
LegacyCamera-eeb94d4de94bfd4e01f3a716803f77a530f5b92c.tar.bz2
Updates for mosaic preview rendering to happen using native GLES2.0 code.
1) Added new subfolder mosaic_renderer in feature_mos/src with FrameBuffer and WarpRenderer classes. 2) Added mosaic_renderer_jni.h|cpp files to the jni folder to perform GL calls for rendering on the GL thread. 3) Updated code in feature_mos_jni.cpp to connect with mosaic_renderer_jni.cpp. 4) Added new java files in com.android.camera.panorama to encapsulate the GL JNI interface, a GLSurfaceView for display and a GLSurfaceView.Renderer for rendering. 5) Modified APP code to enable the new GL-based rendering and made relevant changes to the UI (in pano_views.xml). 6) Fixed a GL bug which was preventing the rendering from working properly after hitting the back button once. 7) Preview rendering now displays in the current frame coordinate system. 8) Fixed the ghost preview rendering bug. Change-Id: Ieb64ee3fd4a9a2c6563a311a4930ddc85ce2247c
Diffstat (limited to 'src/com/android/camera/panorama/MosaicRendererSurfaceViewRenderer.java')
-rw-r--r--src/com/android/camera/panorama/MosaicRendererSurfaceViewRenderer.java55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/com/android/camera/panorama/MosaicRendererSurfaceViewRenderer.java b/src/com/android/camera/panorama/MosaicRendererSurfaceViewRenderer.java
new file mode 100644
index 0000000..a27d4be
--- /dev/null
+++ b/src/com/android/camera/panorama/MosaicRendererSurfaceViewRenderer.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.camera.panorama;
+
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.opengles.GL10;
+
+import android.opengl.GLSurfaceView;
+
+
+public class MosaicRendererSurfaceViewRenderer implements GLSurfaceView.Renderer
+{
+ @Override
+ public void onDrawFrame(GL10 gl)
+ {
+ MosaicRenderer.step();
+ }
+
+ @Override
+ public void onSurfaceChanged(GL10 gl, int width, int height)
+ {
+ MosaicRenderer.reset(width, height);
+ }
+
+ @Override
+ public void onSurfaceCreated(GL10 gl, EGLConfig config)
+ {
+ MosaicRenderer.init();
+ }
+
+ public void setReady()
+ {
+ MosaicRenderer.ready();
+ }
+
+ public void toggleWarping()
+ {
+ MosaicRenderer.togglewarping();
+ }
+
+}