The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | ** |
| 2 | ** Copyright 2006, 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 | |
| 17 | // This source file is automatically generated |
| 18 | |
| 19 | package com.google.android.gles_jni; |
| 20 | |
Elliott Hughes | 9875750 | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 21 | import android.app.AppGlobals; |
Jack Palevich | c96812c | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 22 | import android.content.pm.ApplicationInfo; |
| 23 | import android.content.pm.IPackageManager; |
| 24 | import android.os.Build; |
Mathias Agopian | 54c2818 | 2013-02-22 20:04:22 -0800 | [diff] [blame] | 25 | import android.os.UserHandle; |
Jack Palevich | c96812c | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 26 | import android.util.Log; |
| 27 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 28 | import java.nio.Buffer; |
| 29 | import javax.microedition.khronos.opengles.GL10; |
| 30 | import javax.microedition.khronos.opengles.GL10Ext; |
| 31 | import javax.microedition.khronos.opengles.GL11; |
| 32 | import javax.microedition.khronos.opengles.GL11Ext; |
| 33 | import javax.microedition.khronos.opengles.GL11ExtensionPack; |
| 34 | |
| 35 | public class GLImpl implements GL10, GL10Ext, GL11, GL11Ext, GL11ExtensionPack { |
| 36 | |
| 37 | // Private accessors for native code |
| 38 | |
| 39 | native private static void _nativeClassInit(); |
| 40 | static { |
Jesse Hall | 2fc72d1 | 2014-05-18 15:31:54 -0700 | [diff] [blame] | 41 | _nativeClassInit(); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | Buffer _colorPointer = null; |
| 45 | Buffer _normalPointer = null; |
| 46 | Buffer _texCoordPointer = null; |
| 47 | Buffer _vertexPointer = null; |
Jack Palevich | 66089a3 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 48 | Buffer _pointSizePointerOES = null; |
| 49 | Buffer _matrixIndexPointerOES = null; |
| 50 | Buffer _weightPointerOES = null; |
Jack Palevich | e44e45c | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 51 | |
| 52 | private boolean haveCheckedExtensions; |
| 53 | private boolean have_OES_blend_equation_separate; |
| 54 | private boolean have_OES_blend_subtract; |
| 55 | private boolean have_OES_framebuffer_object; |
| 56 | private boolean have_OES_texture_cube_map; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 57 | |
| 58 | public GLImpl() { |
| 59 | } |
| 60 | |
Jack Palevich | c96812c | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 61 | public void glGetPointerv(int pname, java.nio.Buffer[] params) { |
| 62 | throw new UnsupportedOperationException("glGetPointerv"); |
| 63 | } |
| 64 | |
| 65 | private static boolean allowIndirectBuffers(String appName) { |
| 66 | boolean result = false; |
| 67 | int version = 0; |
Elliott Hughes | 9875750 | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 68 | IPackageManager pm = AppGlobals.getPackageManager(); |
Jack Palevich | c96812c | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 69 | try { |
Mathias Agopian | 54c2818 | 2013-02-22 20:04:22 -0800 | [diff] [blame] | 70 | ApplicationInfo applicationInfo = pm.getApplicationInfo(appName, 0, UserHandle.myUserId()); |
Jack Palevich | c96812c | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 71 | if (applicationInfo != null) { |
| 72 | version = applicationInfo.targetSdkVersion; |
| 73 | } |
| 74 | } catch (android.os.RemoteException e) { |
| 75 | // ignore |
| 76 | } |
| 77 | Log.e("OpenGLES", String.format( |
| 78 | "Application %s (SDK target %d) called a GL11 Pointer method with an indirect Buffer.", |
| 79 | appName, version)); |
| 80 | if (version <= Build.VERSION_CODES.CUPCAKE) { |
| 81 | result = true; |
| 82 | } |
| 83 | return result; |
| 84 | } |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 85 | |