OLD | NEW |
---|---|
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 | 252 |
253 @Override | 253 @Override |
254 public void swapBuffers() { | 254 public void swapBuffers() { |
255 checkIsNotReleased(); | 255 checkIsNotReleased(); |
256 if (eglSurface == EGL10.EGL_NO_SURFACE) { | 256 if (eglSurface == EGL10.EGL_NO_SURFACE) { |
257 throw new RuntimeException("No EGLSurface - can't swap buffers"); | 257 throw new RuntimeException("No EGLSurface - can't swap buffers"); |
258 } | 258 } |
259 egl.eglSwapBuffers(eglDisplay, eglSurface); | 259 egl.eglSwapBuffers(eglDisplay, eglSurface); |
260 } | 260 } |
261 | 261 |
262 @Override | |
263 public void swapBuffers(long timeStampNs) { | |
magjed_webrtc
2015/12/16 13:51:53
ditto - Remove this. It should never be called, ri
perkj_webrtc
2015/12/16 21:18:44
Done.
| |
264 // Egl 1.0 does not support the extension to set the time stamp on a surface so ignore it. | |
265 swapBuffers(); | |
266 } | |
267 | |
262 // Return an EGLDisplay, or die trying. | 268 // Return an EGLDisplay, or die trying. |
263 private EGLDisplay getEglDisplay() { | 269 private EGLDisplay getEglDisplay() { |
264 EGLDisplay eglDisplay = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); | 270 EGLDisplay eglDisplay = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); |
265 if (eglDisplay == EGL10.EGL_NO_DISPLAY) { | 271 if (eglDisplay == EGL10.EGL_NO_DISPLAY) { |
266 throw new RuntimeException("Unable to get EGL10 display"); | 272 throw new RuntimeException("Unable to get EGL10 display"); |
267 } | 273 } |
268 int[] version = new int[2]; | 274 int[] version = new int[2]; |
269 if (!egl.eglInitialize(eglDisplay, version)) { | 275 if (!egl.eglInitialize(eglDisplay, version)) { |
270 throw new RuntimeException("Unable to initialize EGL10"); | 276 throw new RuntimeException("Unable to initialize EGL10"); |
271 } | 277 } |
(...skipping 18 matching lines...) Expand all Loading... | |
290 EGLContext rootContext = | 296 EGLContext rootContext = |
291 sharedContext == null ? EGL10.EGL_NO_CONTEXT : sharedContext.eglContext; | 297 sharedContext == null ? EGL10.EGL_NO_CONTEXT : sharedContext.eglContext; |
292 EGLContext eglContext = | 298 EGLContext eglContext = |
293 egl.eglCreateContext(eglDisplay, eglConfig, rootContext, contextAttribut es); | 299 egl.eglCreateContext(eglDisplay, eglConfig, rootContext, contextAttribut es); |
294 if (eglContext == EGL10.EGL_NO_CONTEXT) { | 300 if (eglContext == EGL10.EGL_NO_CONTEXT) { |
295 throw new RuntimeException("Failed to create EGL context"); | 301 throw new RuntimeException("Failed to create EGL context"); |
296 } | 302 } |
297 return eglContext; | 303 return eglContext; |
298 } | 304 } |
299 } | 305 } |
OLD | NEW |