OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 package org.webrtc; | 11 package org.webrtc; |
12 | 12 |
13 import android.graphics.Canvas; | 13 import android.graphics.Canvas; |
14 import android.graphics.Rect; | 14 import android.graphics.Rect; |
15 import android.graphics.SurfaceTexture; | 15 import android.graphics.SurfaceTexture; |
16 import android.view.Surface; | 16 import android.view.Surface; |
17 import android.view.SurfaceHolder; | 17 import android.view.SurfaceHolder; |
18 | 18 |
19 import javax.microedition.khronos.egl.EGL10; | 19 import javax.microedition.khronos.egl.EGL10; |
20 import javax.microedition.khronos.egl.EGLConfig; | 20 import javax.microedition.khronos.egl.EGLConfig; |
21 import javax.microedition.khronos.egl.EGLContext; | 21 import javax.microedition.khronos.egl.EGLContext; |
22 import javax.microedition.khronos.egl.EGLDisplay; | 22 import javax.microedition.khronos.egl.EGLDisplay; |
23 import javax.microedition.khronos.egl.EGLSurface; | 23 import javax.microedition.khronos.egl.EGLSurface; |
24 | 24 |
25 /** | 25 /** |
26 * Holds EGL state and utility methods for handling an egl 1.0 EGLContext, an EG
LDisplay, | 26 * Holds EGL state and utility methods for handling an egl 1.0 EGLContext, an EG
LDisplay, |
27 * and an EGLSurface. | 27 * and an EGLSurface. |
28 */ | 28 */ |
29 class EglBase10 implements EglBase { | 29 class EglBase10 extends EglBase { |
30 // This constant is taken from EGL14.EGL_CONTEXT_CLIENT_VERSION. | 30 // This constant is taken from EGL14.EGL_CONTEXT_CLIENT_VERSION. |
31 private static final int EGL_CONTEXT_CLIENT_VERSION = 0x3098; | 31 private static final int EGL_CONTEXT_CLIENT_VERSION = 0x3098; |
32 | 32 |
33 private final EGL10 egl; | 33 private final EGL10 egl; |
34 private EGLContext eglContext; | 34 private EGLContext eglContext; |
35 private EGLConfig eglConfig; | 35 private EGLConfig eglConfig; |
36 private EGLDisplay eglDisplay; | 36 private EGLDisplay eglDisplay; |
37 private EGLSurface eglSurface = EGL10.EGL_NO_SURFACE; | 37 private EGLSurface eglSurface = EGL10.EGL_NO_SURFACE; |
38 | 38 |
39 // EGL wrapper for an actual EGLContext. | 39 // EGL wrapper for an actual EGLContext. |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 synchronized (EglBase.lock) { | 304 synchronized (EglBase.lock) { |
305 eglContext = egl.eglCreateContext(eglDisplay, eglConfig, rootContext, cont
extAttributes); | 305 eglContext = egl.eglCreateContext(eglDisplay, eglConfig, rootContext, cont
extAttributes); |
306 } | 306 } |
307 if (eglContext == EGL10.EGL_NO_CONTEXT) { | 307 if (eglContext == EGL10.EGL_NO_CONTEXT) { |
308 throw new RuntimeException( | 308 throw new RuntimeException( |
309 "Failed to create EGL context: 0x" + Integer.toHexString(egl.eglGetErr
or())); | 309 "Failed to create EGL context: 0x" + Integer.toHexString(egl.eglGetErr
or())); |
310 } | 310 } |
311 return eglContext; | 311 return eglContext; |
312 } | 312 } |
313 } | 313 } |
OLD | NEW |