SurfaceWrapper

public final class SurfaceWrapper
extends Object

java.lang.Object
   ↳ androidx.car.app.activity.renderer.surface.SurfaceWrapper


A class holding the information needed to render the content on a surface.

Summary

Public constructors

SurfaceWrapper(IBinder hostToken, int width, int height, int displayId, int densityDpi, Surface surface)

Creates a SurfaceWrapper.

Public methods

int getDensityDpi()

Returns the screen density expressed as dots-per-inch of the Display for the contained SurfaceView.

int getDisplayId()

Returns the display id of the Display for the SurfaceView contained in this class.

int getHeight()

Returns the height of the contained SurfaceView in pixels.

IBinder getHostToken()

Returns the host token corresponding to the SurfaceView contained in this class.

Surface getSurface()

Returns the Surface of the contained SurfaceView.

int getWidth()

Returns the width of the contained SurfaceView in pixels.

Inherited methods

Public constructors

SurfaceWrapper

public SurfaceWrapper (IBinder hostToken, 
                int width, 
                int height, 
                int displayId, 
                int densityDpi, 
                Surface surface)

Creates a SurfaceWrapper.

Parameters
hostToken IBinder: a token used for constructing SurfaceControlViewHost. see SurfaceView for more details

width int: the width of the surface view in pixels

height int: the height of the surface view in pixels

displayId int: the ID of the display showing the surface

densityDpi int: the density of the display showing the surface expressed as dots-per-inch

surface Surface: the surface for which the wrapper is created

Public methods

getDensityDpi

public int getDensityDpi ()

Returns the screen density expressed as dots-per-inch of the Display for the contained SurfaceView.

Returns
int

getDisplayId

public int getDisplayId ()

Returns the display id of the Display for the SurfaceView contained in this class.

Returns
int

getHeight

public int getHeight ()

Returns the height of the contained SurfaceView in pixels.

Returns
int

getHostToken

public IBinder getHostToken ()

Returns the host token corresponding to the SurfaceView contained in this class.

Returns
IBinder

getSurface

public Surface getSurface ()

Returns the Surface of the contained SurfaceView.

Returns
Surface

getWidth

public int getWidth ()

Returns the width of the contained SurfaceView in pixels.

Returns
int