Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
Android Documentation
EglCore

Class EglCore

Hierarchy

java.lang.Object

Package
com.android.grafika.gles

Overview

Core EGL state (display, context, config).

The EGLContext must only be attached to one thread at a time. This class is not thread-safe.

Fields

FLAG_RECORDABLE

public static final int FLAG_RECORDABLE
Constant Value
1

FLAG_TRY_GLES3

public static final int FLAG_TRY_GLES3
Constant Value
2

Constructors

EglCore()

Prepares EGL display and context.

Equivalent to EglCore(null, 0).

public EglCore()

EglCore( EGLContext sharedContext, int flags )

Prepares EGL display and context.

public EglCore(EGLContext sharedContext,int flags)

Constructor Parameters

sharedContext
The context to share, or null if sharing is not desired.
flags
Configuration bit flags, e.g. FLAG_RECORDABLE.

Methods

release()

Discards all resources held by this class, notably the EGL context. This must be called from the thread where the context was created.

On completion, no context will be current.

public void release()

finalize()

protected void finalize() throws java.lang.Throwable

Throws

  • java.lang.Throwable

releaseSurface( EGLSurface eglSurface )

Destroys the specified surface. Note the EGLSurface won't actually be destroyed if it's still current in a context.

public void releaseSurface(EGLSurface eglSurface)

Method Parameters

eglSurface

createWindowSurface( Object surface )

Creates an EGL surface associated with a Surface.

If this is destined for MediaCodec, the EGLConfig should have the "recordable" attribute.

public android.opengl.EGLSurface createWindowSurface(Object surface)

Method Parameters

surface

createOffscreenSurface( int width, int height )

Creates an EGL surface associated with an offscreen buffer.

public android.opengl.EGLSurface createOffscreenSurface(int width,int height)

Method Parameters

width
height

makeCurrent( EGLSurface eglSurface )

Makes our EGL context current, using the supplied surface for both "draw" and "read".

public void makeCurrent(EGLSurface eglSurface)

Method Parameters

eglSurface

makeCurrent( EGLSurface drawSurface, EGLSurface readSurface )

Makes our EGL context current, using the supplied "draw" and "read" surfaces.

public void makeCurrent(EGLSurface drawSurface,EGLSurface readSurface)

Method Parameters

drawSurface
readSurface

makeNothingCurrent()

Makes no context current.

public void makeNothingCurrent()

swapBuffers( EGLSurface eglSurface )

Calls eglSwapBuffers. Use this to "publish" the current frame.

public boolean swapBuffers(EGLSurface eglSurface)

Method Parameters

eglSurface

setPresentationTime( EGLSurface eglSurface, long nsecs )

Sends the presentation time stamp to EGL. Time is expressed in nanoseconds.

public void setPresentationTime(EGLSurface eglSurface,long nsecs)

Method Parameters

eglSurface
nsecs

isCurrent( EGLSurface eglSurface )

Returns true if our context and the specified surface are current.

public boolean isCurrent(EGLSurface eglSurface)

Method Parameters

eglSurface

querySurface( EGLSurface eglSurface, int what )

Performs a simple surface query.

public int querySurface(EGLSurface eglSurface,int what)

Method Parameters

eglSurface
what

queryString( int what )

Queries a string value.

public java.lang.String queryString(int what)

Method Parameters

what

getGlVersion()

Returns the GLES version this context is configured for (currently 2 or 3).

public int getGlVersion()

logCurrent( String msg )

Writes the current display, context, and surface to the log.

public static void logCurrent(String msg)

Method Parameters

msg

Inherited Methods

From Class Methods
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section