OSDN Git Service

update glgen to take into account recent changes
authorMathias Agopian <mathias@google.com>
Sat, 23 Feb 2013 04:04:22 +0000 (20:04 -0800)
committerMathias Agopian <mathias@google.com>
Sat, 23 Feb 2013 04:04:22 +0000 (20:04 -0800)
- it looks like UserId has been renamed to UserHandle in the
framework.
- also for some reason I don't understand glgen didn't seem
to be up to date with respect to the generated bindings in the tree.
It's like the bindings were generated with a more recent version of
glgen (maybe it was never checked in). So we fix that here.

Change-Id: Ie49522ebf67fcab9213246b4d93500e37a3cbc05

opengl/tools/glgen/gen
opengl/tools/glgen/stubs/egl/EGL14cHeader.cpp
opengl/tools/glgen/stubs/egl/eglCreateWindowSurface.cpp
opengl/tools/glgen/stubs/jsr239/GLImplHeader.java-impl

index 3359a22..fb3c3a9 100755 (executable)
@@ -27,7 +27,7 @@ echo "package android.app; import android.content.pm.IPackageManager; public cla
 echo "package android.content.pm; public class ApplicationInfo {public int targetSdkVersion;}" > out/android/content/pm/ApplicationInfo.java
 echo "package android.content.pm; public interface IPackageManager {ApplicationInfo getApplicationInfo(java.lang.String packageName, int flags, java.lang.String userId) throws android.os.RemoteException;}" > out/android/content/pm/IPackageManager.java
 echo "package android.os; public class Build {public static class VERSION_CODES { public static final int CUPCAKE = 3;};       }" > out/android/os/Build.java
-echo "package android.os; public class UserId {public static String myUserId() { return \"\"; } }" > out/android/os/UserId.java
+echo "package android.os; public class UserHandle {public static String myUserId() { return \"\"; } }" > out/android/os/UserHandle.java
 echo "package android.os; public class RemoteException extends Exception {}" > out/android/os/RemoteException.java
 echo "package android.util; public class Log {public static void w(String a, String b) {} public static void e(String a, String b) {}}" > out/android/util/Log.java
 
index 54de1e7..5fda9f8 100644 (file)
@@ -1,4 +1,3 @@
-/*
 ** Copyright 2012, The Android Open Source Project
 **
 ** Licensed under the Apache License, Version 2.0 (the "License");
index 14213b6..906cd80 100644 (file)
@@ -34,7 +34,7 @@ not_valid_surface:
         goto exit;
     }
 
-    window = android::android_Surface_getNativeWindow(_env, win);
+    window = android::android_view_Surface_getNativeWindow(_env, win);
 
     if (window == NULL)
         goto not_valid_surface;
@@ -112,7 +112,11 @@ not_valid_surface:
         goto exit;
     }
     glConsumer = android::SurfaceTexture_getSurfaceTexture(_env, win);
-    window = new android::Surface(glConsumer);
+
+    if (glConsumer == NULL)
+        goto not_valid_surface;
+
+    window = new android::Surface(glConsumer->getBufferQueue());
 
     if (window == NULL)
         goto not_valid_surface;
index e3aea76..9740235 100644 (file)
@@ -22,7 +22,7 @@ import android.app.AppGlobals;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.IPackageManager;
 import android.os.Build;
-import android.os.UserId;
+import android.os.UserHandle;
 import android.util.Log;
 
 import java.nio.Buffer;
@@ -67,7 +67,7 @@ public class GLImpl implements GL10, GL10Ext, GL11, GL11Ext, GL11ExtensionPack {
         int version = 0;
         IPackageManager pm = AppGlobals.getPackageManager();
         try {
-            ApplicationInfo applicationInfo = pm.getApplicationInfo(appName, 0, UserId.myUserId());
+            ApplicationInfo applicationInfo = pm.getApplicationInfo(appName, 0, UserHandle.myUserId());
             if (applicationInfo != null) {
                 version = applicationInfo.targetSdkVersion;
             }