Class of android.view · SurfaceView.java · Android's reference
public class SurfaceView extends View
SurfaceView ← View
A view whose surface an app draws into itself, with its own GPU API (the Abstract of SurfaceFlinger's layers in docs/platforms/android-apps/interfaces.md): its surface is the host window, at the view's size. The surface exists while the view is attached and laid out, as Android's callbacks give it. The view draws the hole Android punches: transparent.
public SurfaceView(Context context) sourcepublic SurfaceView(Context context, AttributeSet attrs) sourcepublic SurfaceView(Context context, AttributeSet attrs, int defStyleAttr) sourcepublic SurfaceView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) sourcepublic SurfaceHolder getHolder() sourcepublic void setZOrderOnTop(boolean onTop) empty body sourcepublic void setZOrderMediaOverlay(boolean isMediaOverlay) empty body sourcepublic void setSecure(boolean isSecure) empty body sourcepublic Surface getSurfaceControl() sourceprotected void onAttachedToWindow() sourceprotected void onDetachedFromWindow() sourceprotected void onSizeChanged(int w, int h, int oldw, int oldh) sourceprotected void onWindowVisibilityChanged(int visibility) sourcepublic void draw(Canvas canvas) sourceThe hole in the window that the surface shows through, as Android's SurfaceView punches it: the view's area cleared to transparent, over the window's background. The renderer's frames are blended over the app's own presents (docs/platforms/android-apps/hwui.md), so the app's frame shows there, and the window's other views and dialogs over it.
protected void onDraw(Canvas canvas) empty body sourceMade from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.