6package org.mozilla.gecko.gfx;
8import javax.microedition.khronos.egl.EGL10;
9import javax.microedition.khronos.egl.EGL11;
10import javax.microedition.khronos.egl.EGLConfig;
11import javax.microedition.khronos.egl.EGLContext;
12import javax.microedition.khronos.egl.EGLDisplay;
13import javax.microedition.khronos.egl.EGLSurface;
14import javax.microedition.khronos.opengles.GL;
15import javax.microedition.khronos.opengles.GL10;
37 EGL10.EGL_RED_SIZE, 5,
38 EGL10.EGL_GREEN_SIZE, 6,
39 EGL10.EGL_BLUE_SIZE, 5,
40 EGL10.EGL_SURFACE_TYPE, EGL10.EGL_WINDOW_BIT,
66 if (!
mEGL.eglMakeCurrent(
mEGLDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE,
67 EGL10.EGL_NO_CONTEXT)) {
108 if (
mEGL.eglGetError() != EGL11.EGL_CONTEXT_LOST) {
133 }
catch (InterruptedException e) {
147 synchronized void surfaceDestroyed() {
152 synchronized void surfaceChanged(
int newWidth,
int newHeight) {
160 mEGL = (EGL10)EGLContext.getEGL();
167 int[] version =
new int[2];
195 int[] numConfigs =
new int[1];
197 numConfigs[0] <= 0) {
202 EGLConfig[] configs =
new EGLConfig[numConfigs[0]];
209 int[] red =
new int[1], green =
new int[1], blue =
new int[1];
210 for (EGLConfig
config : configs) {
214 if (red[0] == 5 && green[0] == 6 && blue[0] == 5) {
255 if (surface ==
null || surface == EGL10.EGL_NO_SURFACE) {
264 return "Error " +
mEGL.eglGetError();
static final long serialVersionUID
GLController(LayerView view)
synchronized int getHeight()
synchronized void resumeCompositorIfValid()
EGLSurface provideEGLSurface()
Provides an EGLSurface without assuming ownership of this surface.
static final int LOCAL_EGL_OPENGL_ES2_BIT
static final String LOGTAG
boolean checkForLostContext()
synchronized void waitForValidSurface()
EGLDisplay getEGLDisplay()
static final int[] CONFIG_SPEC
synchronized int getWidth()
void setGLVersion(int version)
static final int EGL_CONTEXT_CLIENT_VERSION
void initGLContext()
You must call this on the same thread you intend to use OpenGL on.
EGLContext getEGLContext()
EGLSurface getEGLSurface()
void onSurfaceCreated(GL10 gl, EGLConfig config)
void onSurfaceChanged(GL10 gl, final int width, final int height)
A view rendered by the layer compositor.
LayerRenderer getRenderer()
void compositionResumeRequested(int width, int height)