Class PictureRecorder
- java.lang.Object
-
- io.github.humbleui.skija.impl.Native
-
- io.github.humbleui.skija.impl.Managed
-
- io.github.humbleui.skija.PictureRecorder
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class PictureRecorder extends Managed
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPictureRecorder._FinalizerHolder-
Nested classes/interfaces inherited from class io.github.humbleui.skija.impl.Managed
Managed.CleanerThunk
-
-
Field Summary
-
Fields inherited from class io.github.humbleui.skija.impl.Managed
_cleanable
-
-
Constructor Summary
Constructors Constructor Description PictureRecorder()PictureRecorder(long ptr)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static long_nBeginRecording(long ptr, float left, float top, float right, float bottom)static long_nFinishRecordingAsDrawable(long ptr)static long_nFinishRecordingAsPicture(long ptr)static long_nFinishRecordingAsPictureWithCull(long ptr, float left, float top, float right, float bottom)static long_nGetFinalizer()static long_nGetRecordingCanvas(long ptr)static long_nMake()Signal that the caller is done recording.CanvasbeginRecording(io.github.humbleui.types.Rect bounds)Returns the canvas that records the drawing commands.PicturefinishRecordingAsPicture()Signal that the caller is done recording.PicturefinishRecordingAsPicture(@NotNull io.github.humbleui.types.Rect cull)Signal that the caller is done recording, and update the cull rect to use for bounding box hierarchy (BBH) generation.@Nullable CanvasgetRecordingCanvas()-
Methods inherited from class io.github.humbleui.skija.impl.Managed
_nInvokeFinalizer, close, isClosed
-
-
-
-
Method Detail
-
beginRecording
public Canvas beginRecording(io.github.humbleui.types.Rect bounds)
Returns the canvas that records the drawing commands.- Parameters:
bounds- the cull rect used when recording this picture. Any drawing the falls outside of this rect is undefined, and may be drawn or it may not.- Returns:
- the canvas.
-
getRecordingCanvas
@Nullable public @Nullable Canvas getRecordingCanvas()
- Returns:
- the recording canvas if one is active, or null if recording is not active.
-
finishRecordingAsPicture
public Picture finishRecordingAsPicture()
Signal that the caller is done recording. This invalidates the canvas returned by
beginRecording(Rect)/getRecordingCanvas().The returned picture is immutable. If during recording drawables were added to the canvas, these will have been "drawn" into a recording canvas, so that this resulting picture will reflect their current state, but will not contain a live reference to the drawables themselves.
-
finishRecordingAsPicture
public Picture finishRecordingAsPicture(@NotNull @NotNull io.github.humbleui.types.Rect cull)
Signal that the caller is done recording, and update the cull rect to use for bounding box hierarchy (BBH) generation. The behavior is the same as callingfinishRecordingAsPicture(), except that this method updates the cull rect initially passed intobeginRecording(Rect).- Parameters:
cull- the new culling rectangle to use as the overall bound for BBH generation and subsequent culling operations.- Returns:
- the picture containing the recorded content.
-
_nMake
@Internal public static long _nMake()
Signal that the caller is done recording. This invalidates the canvas returned by
beginRecording(Rect)/getRecordingCanvas().Unlike
finishRecordingAsPicture(), which returns an immutable picture, the returned drawable may contain live references to other drawables (if they were added to the recording canvas) and therefore this drawable will reflect the current state of those nested drawables anytime it is drawn or a new picture is snapped from it (by callingDrawable.makePictureSnapshot()).
-
_nGetFinalizer
@Internal public static long _nGetFinalizer()
-
_nBeginRecording
@Internal public static long _nBeginRecording(long ptr, float left, float top, float right, float bottom)
-
_nGetRecordingCanvas
@Internal public static long _nGetRecordingCanvas(long ptr)
-
_nFinishRecordingAsPicture
@Internal public static long _nFinishRecordingAsPicture(long ptr)
-
_nFinishRecordingAsPictureWithCull
@Internal public static long _nFinishRecordingAsPictureWithCull(long ptr, float left, float top, float right, float bottom)
-
_nFinishRecordingAsDrawable
@Internal public static long _nFinishRecordingAsDrawable(long ptr)
-
-