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
EglSurfaceBase

Class EglSurfaceBase

Hierarchy

java.lang.Object

Package
com.android.grafika.gles
All Known Subclasses
com.android.grafika.gles.OffscreenSurface, com.android.grafika.gles.WindowSurface

Overview

Common base class for EGL surfaces.

There can be multiple surfaces associated with a single context.

Fields

mEglCore

protected com.android.grafika.gles.EglCore mEglCore

Constructors

EglSurfaceBase( EglCore eglCore )

protected EglSurfaceBase(EglCore eglCore)

Constructor Parameters

eglCore

Methods

createWindowSurface( Object surface )

Creates a window surface.

public void createWindowSurface(Object surface)

Method Parameters

surface
May be a Surface or SurfaceTexture.

createOffscreenSurface( int width, int height )

Creates an off-screen surface.

public void createOffscreenSurface(int width,int height)

Method Parameters

width
height

getWidth()

Returns the surface's width, in pixels.

If this is called on a window surface, and the underlying surface is in the process of changing size, we may not see the new size right away (e.g. in the "surfaceChanged" callback). The size should match after the next buffer swap.

public int getWidth()

getHeight()

Returns the surface's height, in pixels.

public int getHeight()

releaseEglSurface()

Release the EGL surface.

public void releaseEglSurface()

makeCurrent()

Makes our EGL context and surface current.

public void makeCurrent()

makeCurrentReadFrom( EglSurfaceBase readSurface )

Makes our EGL context and surface current for drawing, using the supplied surface for reading.

public void makeCurrentReadFrom(EglSurfaceBase readSurface)

Method Parameters

readSurface

swapBuffers()

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

public boolean swapBuffers()

setPresentationTime( long nsecs )

Sends the presentation time stamp to EGL.

public void setPresentationTime(long nsecs)

Method Parameters

nsecs
Timestamp, in nanoseconds.

saveFrame( File file )

Saves the EGL surface to a file.

Expects that this object's EGL surface is current.

public void saveFrame(File file) throws java.io.IOException

Method Parameters

file

Throws

  • java.io.IOException

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