gecko/widget/android/AndroidLayerViewWrapper.h

43 lines
1.1 KiB
C
Raw Normal View History

2012-02-01 08:49:34 -08:00
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
2012-05-21 04:12:37 -07:00
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
2012-02-01 08:49:34 -08:00
#ifndef AndroidLayerViewWrapper_h__
#define AndroidLayerViewWrapper_h__
2012-02-01 13:18:35 -08:00
2012-02-01 08:49:34 -08:00
#include <jni.h>
#include <pthread.h>
class AndroidEGLObject {
public:
static void Init(JNIEnv* aJEnv);
2012-02-01 08:49:34 -08:00
};
typedef void* EGLSurface;
2012-02-01 08:49:34 -08:00
class AndroidGLController {
public:
static void Init(JNIEnv* aJEnv);
void Acquire(JNIEnv* aJEnv, jobject aJObj);
2012-02-01 08:49:34 -08:00
void SetGLVersion(int aVersion);
void Reacquire(JNIEnv* aJEnv, jobject aJObj);
EGLSurface ProvideEGLSurface();
void WaitForValidSurface();
2012-02-01 08:49:34 -08:00
private:
static jmethodID jSetGLVersionMethod;
static jmethodID jWaitForValidSurfaceMethod;
static jmethodID jProvideEGLSurfaceMethod;
static jmethodID jResumeCompositorIfValidMethod;
2012-02-01 08:49:34 -08:00
// the JNIEnv for the compositor thread
JNIEnv* mJEnv;
pthread_t mThread;
2012-02-01 08:49:34 -08:00
jobject mJObj;
};
2012-02-01 13:18:35 -08:00
#endif