MosaicRendererSurfaceViewRenderer.java revision eeb94d4de94bfd4e01f3a716803f77a530f5b92c
1/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.camera.panorama;
18
19import javax.microedition.khronos.egl.EGLConfig;
20import javax.microedition.khronos.opengles.GL10;
21
22import android.opengl.GLSurfaceView;
23
24
25public class MosaicRendererSurfaceViewRenderer implements GLSurfaceView.Renderer
26{
27    @Override
28    public void onDrawFrame(GL10 gl)
29    {
30        MosaicRenderer.step();
31    }
32
33    @Override
34    public void onSurfaceChanged(GL10 gl, int width, int height)
35    {
36        MosaicRenderer.reset(width, height);
37    }
38
39    @Override
40    public void onSurfaceCreated(GL10 gl, EGLConfig config)
41    {
42        MosaicRenderer.init();
43    }
44
45    public void setReady()
46    {
47        MosaicRenderer.ready();
48    }
49
50    public void toggleWarping()
51    {
52        MosaicRenderer.togglewarping();
53    }
54
55}
56