Commit 095c52e7 by huangdarwin Committed by Ian Baker

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
parent 30b73c85
...@@ -255,7 +255,7 @@ public final class GlUtil { ...@@ -255,7 +255,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.
...@@ -264,13 +264,13 @@ public final class GlUtil { ...@@ -264,13 +264,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.
...@@ -278,10 +278,9 @@ public final class GlUtil { ...@@ -278,10 +278,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);
} }
/** /**
...@@ -659,18 +658,14 @@ public final class GlUtil { ...@@ -659,18 +658,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; ...@@ -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; ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment