mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
GL: Rename getEglSurface to createEglSurface.
Per documentation, eglCreateWindowSurface creates a new EGL window surface. getEglSurface suggests instead that a pre-existing surface is returned. https://registry.khronos.org/EGL/sdk/docs/man/html/eglCreateWindowSurface.xhtml PiperOrigin-RevId: 488377423
This commit is contained in:
parent
adc993dc57
commit
84a378415f
2 changed files with 12 additions and 17 deletions
|
|
@ -256,7 +256,7 @@ public final class GlUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a new {@link EGLSurface} wrapping the specified {@code surface}.
|
* Creates a new {@link EGLSurface} wrapping the specified {@code surface}.
|
||||||
*
|
*
|
||||||
* <p>The {@link EGLSurface} will configure with {@link #EGL_CONFIG_ATTRIBUTES_RGBA_8888} and
|
* <p>The {@link EGLSurface} will configure with {@link #EGL_CONFIG_ATTRIBUTES_RGBA_8888} and
|
||||||
* OpenGL ES 2.0.
|
* OpenGL ES 2.0.
|
||||||
|
|
@ -265,13 +265,13 @@ public final class GlUtil {
|
||||||
* @param surface The surface to wrap; must be a surface, surface texture or surface holder.
|
* @param surface The surface to wrap; must be a surface, surface texture or surface holder.
|
||||||
*/
|
*/
|
||||||
@RequiresApi(17)
|
@RequiresApi(17)
|
||||||
public static EGLSurface getEglSurface(EGLDisplay eglDisplay, Object surface) throws GlException {
|
public static EGLSurface createEglSurface(EGLDisplay eglDisplay, Object surface)
|
||||||
return Api17.getEglSurface(
|
throws GlException {
|
||||||
eglDisplay, surface, EGL_CONFIG_ATTRIBUTES_RGBA_8888, EGL_WINDOW_SURFACE_ATTRIBUTES_NONE);
|
return Api17.createEglSurface(eglDisplay, surface, EGL_CONFIG_ATTRIBUTES_RGBA_8888);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a new {@link EGLSurface} wrapping the specified {@code surface}.
|
* Creates a new {@link EGLSurface} wrapping the specified {@code surface}.
|
||||||
*
|
*
|
||||||
* @param eglDisplay The {@link EGLDisplay} to attach the surface to.
|
* @param eglDisplay The {@link EGLDisplay} to attach the surface to.
|
||||||
* @param surface The surface to wrap; must be a surface, surface texture or surface holder.
|
* @param surface The surface to wrap; must be a surface, surface texture or surface holder.
|
||||||
|
|
@ -279,10 +279,9 @@ public final class GlUtil {
|
||||||
* #EGL_CONFIG_ATTRIBUTES_RGBA_1010102} and {@link #EGL_CONFIG_ATTRIBUTES_RGBA_8888}.
|
* #EGL_CONFIG_ATTRIBUTES_RGBA_1010102} and {@link #EGL_CONFIG_ATTRIBUTES_RGBA_8888}.
|
||||||
*/
|
*/
|
||||||
@RequiresApi(17)
|
@RequiresApi(17)
|
||||||
public static EGLSurface getEglSurface(
|
public static EGLSurface createEglSurface(
|
||||||
EGLDisplay eglDisplay, Object surface, int[] configAttributes) throws GlException {
|
EGLDisplay eglDisplay, Object surface, int[] configAttributes) throws GlException {
|
||||||
return Api17.getEglSurface(
|
return Api17.createEglSurface(eglDisplay, surface, configAttributes);
|
||||||
eglDisplay, surface, configAttributes, EGL_WINDOW_SURFACE_ATTRIBUTES_NONE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -660,18 +659,14 @@ public final class GlUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
@DoNotInline
|
@DoNotInline
|
||||||
public static EGLSurface getEglSurface(
|
public static EGLSurface createEglSurface(
|
||||||
EGLDisplay eglDisplay,
|
EGLDisplay eglDisplay, Object surface, int[] configAttributes) throws GlException {
|
||||||
Object surface,
|
|
||||||
int[] configAttributes,
|
|
||||||
int[] windowSurfaceAttributes)
|
|
||||||
throws GlException {
|
|
||||||
EGLSurface eglSurface =
|
EGLSurface eglSurface =
|
||||||
EGL14.eglCreateWindowSurface(
|
EGL14.eglCreateWindowSurface(
|
||||||
eglDisplay,
|
eglDisplay,
|
||||||
getEglConfig(eglDisplay, configAttributes),
|
getEglConfig(eglDisplay, configAttributes),
|
||||||
surface,
|
surface,
|
||||||
windowSurfaceAttributes,
|
EGL_WINDOW_SURFACE_ATTRIBUTES_NONE,
|
||||||
/* offset= */ 0);
|
/* offset= */ 0);
|
||||||
checkEglException("Error creating surface");
|
checkEglException("Error creating surface");
|
||||||
return eglSurface;
|
return eglSurface;
|
||||||
|
|
|
||||||
|
|
@ -317,7 +317,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||||
boolean colorInfoIsHdr = ColorInfo.isTransferHdr(colorInfo);
|
boolean colorInfoIsHdr = ColorInfo.isTransferHdr(colorInfo);
|
||||||
|
|
||||||
outputEglSurface =
|
outputEglSurface =
|
||||||
GlUtil.getEglSurface(
|
GlUtil.createEglSurface(
|
||||||
eglDisplay,
|
eglDisplay,
|
||||||
outputSurfaceInfo.surface,
|
outputSurfaceInfo.surface,
|
||||||
colorInfoIsHdr
|
colorInfoIsHdr
|
||||||
|
|
@ -445,7 +445,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||||
|
|
||||||
if (eglSurface == null) {
|
if (eglSurface == null) {
|
||||||
eglSurface =
|
eglSurface =
|
||||||
GlUtil.getEglSurface(
|
GlUtil.createEglSurface(
|
||||||
eglDisplay,
|
eglDisplay,
|
||||||
surface,
|
surface,
|
||||||
useHdr
|
useHdr
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue