SurfaceWrapper
@CarProtocol
public final class SurfaceWrapper
A class holding the information needed to render the content on a surface.
Summary
Public constructors |
|---|
SurfaceWrapper(Creates a |
Public methods |
|
|---|---|
int |
Returns the screen density expressed as dots-per-inch of the |
int |
Returns the display id of the |
@Dimension int |
Returns the height of the contained |
@Nullable IBinder |
Returns the host token corresponding to the |
@NonNull Surface |
Returns the |
@Dimension int |
getWidth()Returns the width of the contained |
Public constructors
SurfaceWrapper
public SurfaceWrapper(
@Nullable IBinder hostToken,
@Dimension int width,
@Dimension int height,
int displayId,
int densityDpi,
@NonNull Surface surface
)
Creates a SurfaceWrapper.
| Parameters | |
|---|---|
@Nullable IBinder hostToken |
a token used for constructing SurfaceControlViewHost. see |
@Dimension int width |
the width of the surface view in pixels |
@Dimension int height |
the height of the surface view in pixels |
int displayId |
the ID of the display showing the surface |
int densityDpi |
the density of the display showing the surface expressed as dots-per-inch |
@NonNull 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 android.view.Display for the contained SurfaceView.
getDisplayId
public int getDisplayId()
Returns the display id of the android.view.Display for the SurfaceView contained in this class.
getHeight
public @Dimension int getHeight()
Returns the height of the contained SurfaceView in pixels.
getHostToken
public @Nullable IBinder getHostToken()
Returns the host token corresponding to the SurfaceView contained in this class.
getSurface
public @NonNull Surface getSurface()
Returns the Surface of the contained SurfaceView.
getWidth
public @Dimension int getWidth()
Returns the width of the contained SurfaceView in pixels.