Bug 769269 - Update the graphics code to be able to deal with blowing away the layer controller, client, and view and creating them afresh. r=ajuma
This commit is contained in:
@@ -24,6 +24,7 @@ void AndroidEGLObject::Init(JNIEnv* aJEnv) {
|
||||
jmethodID AndroidGLController::jSetGLVersionMethod = 0;
|
||||
jmethodID AndroidGLController::jWaitForValidSurfaceMethod = 0;
|
||||
jmethodID AndroidGLController::jProvideEGLSurfaceMethod = 0;
|
||||
jmethodID AndroidGLController::jResumeCompositorIfValidMethod = 0;
|
||||
|
||||
void
|
||||
AndroidGLController::Init(JNIEnv* aJEnv)
|
||||
@@ -33,6 +34,7 @@ AndroidGLController::Init(JNIEnv* aJEnv)
|
||||
jSetGLVersionMethod = aJEnv->GetMethodID(jClass, "setGLVersion", "(I)V");
|
||||
jProvideEGLSurfaceMethod = aJEnv->GetMethodID(jClass, "provideEGLSurface",
|
||||
"()Ljavax/microedition/khronos/egl/EGLSurface;");
|
||||
jResumeCompositorIfValidMethod = aJEnv->GetMethodID(jClass, "resumeCompositorIfValid", "()V");
|
||||
jWaitForValidSurfaceMethod = aJEnv->GetMethodID(jClass, "waitForValidSurface", "()V");
|
||||
}
|
||||
|
||||
@@ -52,6 +54,16 @@ AndroidGLController::SetGLVersion(int aVersion)
|
||||
mJEnv->CallVoidMethod(mJObj, jSetGLVersionMethod, aVersion);
|
||||
}
|
||||
|
||||
void
|
||||
AndroidGLController::Reacquire(JNIEnv *aJEnv, jobject aJObj)
|
||||
{
|
||||
aJEnv->DeleteGlobalRef(mJObj);
|
||||
mJObj = aJEnv->NewGlobalRef(aJObj);
|
||||
|
||||
AutoLocalJNIFrame jniFrame(aJEnv, 0);
|
||||
aJEnv->CallVoidMethod(mJObj, jResumeCompositorIfValidMethod);
|
||||
}
|
||||
|
||||
EGLSurface
|
||||
AndroidGLController::ProvideEGLSurface()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user