2012-02-01 20:49:34 +04:00
|
|
|
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
|
2012-05-21 15:12:37 +04: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 20:49:34 +04:00
|
|
|
|
2012-04-05 19:28:50 +04:00
|
|
|
#ifndef AndroidLayerViewWrapper_h__
|
|
|
|
#define AndroidLayerViewWrapper_h__
|
2012-02-02 01:18:35 +04:00
|
|
|
|
2012-02-01 20:49:34 +04:00
|
|
|
#include <jni.h>
|
|
|
|
#include <pthread.h>
|
|
|
|
|
|
|
|
class AndroidEGLObject {
|
|
|
|
public:
|
2012-02-02 20:17:50 +04:00
|
|
|
static void Init(JNIEnv* aJEnv);
|
2012-02-01 20:49:34 +04:00
|
|
|
};
|
|
|
|
|
2012-04-05 19:28:50 +04:00
|
|
|
typedef void* EGLSurface;
|
2012-02-01 20:49:34 +04:00
|
|
|
|
|
|
|
class AndroidGLController {
|
|
|
|
public:
|
|
|
|
static void Init(JNIEnv* aJEnv);
|
|
|
|
|
2012-04-05 19:28:50 +04:00
|
|
|
void Acquire(JNIEnv* aJEnv, jobject aJObj);
|
2012-02-01 20:49:34 +04:00
|
|
|
void SetGLVersion(int aVersion);
|
2012-02-07 01:53:09 +04:00
|
|
|
EGLSurface ProvideEGLSurface();
|
2012-04-02 23:43:21 +04:00
|
|
|
void WaitForValidSurface();
|
2012-02-01 20:49:34 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
static jmethodID jSetGLVersionMethod;
|
2012-04-02 23:43:21 +04:00
|
|
|
static jmethodID jWaitForValidSurfaceMethod;
|
2012-02-07 01:53:09 +04:00
|
|
|
static jmethodID jProvideEGLSurfaceMethod;
|
2012-02-01 20:49:34 +04:00
|
|
|
|
2012-03-14 08:15:11 +04:00
|
|
|
// the JNIEnv for the compositor thread
|
2012-04-05 19:28:50 +04:00
|
|
|
JNIEnv* mJEnv;
|
|
|
|
pthread_t mThread;
|
2012-02-01 20:49:34 +04:00
|
|
|
jobject mJObj;
|
|
|
|
};
|
|
|
|
|
2012-02-02 01:18:35 +04:00
|
|
|
#endif
|
|
|
|
|