OSDN Git Service

make sure we have a context when creating the 1st surface
authorMathias Agopian <mathias@google.com>
Thu, 8 Aug 2013 03:10:20 +0000 (20:10 -0700)
committerMathias Agopian <mathias@google.com>
Thu, 8 Aug 2013 23:38:06 +0000 (16:38 -0700)
also add an option to dump the stack trace when
calling a GL function without a context.

Change-Id: I57b72bb8c322ac4253c3077bf150621bd9863b69

opengl/libs/EGL/egl.cpp
services/surfaceflinger/SurfaceFlinger.cpp

index 86637dc..f759e6b 100644 (file)
@@ -331,6 +331,11 @@ EGLBoolean egl_init_drivers() {
 
 void gl_unimplemented() {
     ALOGE("called unimplemented OpenGL ES API");
+    char value[PROPERTY_VALUE_MAX];
+    property_get("debug.egl.callstack", value, "0");
+    if (atoi(value)) {
+        CallStack stack(LOG_TAG);
+    }
 }
 
 void gl_noop() {
index bc10853..4a84e5a 100644 (file)
@@ -487,6 +487,10 @@ status_t SurfaceFlinger::readyToRun()
         }
     }
 
+    // make the GLContext current so that we can create textures when creating Layers
+    // (which may happens before we render something)
+    getDefaultDisplayDevice()->makeCurrent(mEGLDisplay, mEGLContext);
+
     // start the EventThread
     mEventThread = new EventThread(this);
     mEventQueue.setEventThread(mEventThread);